mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 06:04:51 +00:00
feat(ai): add Hugging Face provider support
- Add huggingface to KnownProvider type - Add HF_TOKEN env var mapping - Process huggingface models from models.dev (14 models) - Use openai-completions API with compat settings - Add tests for all provider test suites - Update documentation fixes #994
This commit is contained in:
parent
f3cfb7e1ae
commit
c808de605a
16 changed files with 562 additions and 23 deletions
|
|
@ -366,6 +366,22 @@ describe("Context overflow error handling", () => {
|
|||
}, 120000);
|
||||
});
|
||||
|
||||
// =============================================================================
|
||||
// Hugging Face
|
||||
// Uses OpenAI-compatible Inference Router
|
||||
// =============================================================================
|
||||
|
||||
describe.skipIf(!process.env.HF_TOKEN)("Hugging Face", () => {
|
||||
it("Kimi-K2.5 - should detect overflow via isContextOverflow", async () => {
|
||||
const model = getModel("huggingface", "moonshotai/Kimi-K2.5");
|
||||
const result = await testContextOverflow(model, process.env.HF_TOKEN!);
|
||||
logResult(result);
|
||||
|
||||
expect(result.stopReason).toBe("error");
|
||||
expect(isContextOverflow(result.response, model.contextWindow)).toBe(true);
|
||||
}, 120000);
|
||||
});
|
||||
|
||||
// =============================================================================
|
||||
// z.ai
|
||||
// Special case: Sometimes accepts overflow silently, sometimes rate limits
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue