modelmix 5.1.1 → 5.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/demo/free.js +2 -3
- package/demo/short.js +4 -2
- package/effort.js +13 -4
- package/index.d.ts +2 -0
- package/index.js +517 -2843
- package/lib/content-cache.js +31 -0
- package/lib/model-chain.js +51 -0
- package/lib/object-utils.js +7 -0
- package/lib/provider-debug.js +23 -0
- package/lib/providers/anthropic.js +337 -0
- package/lib/providers/base.js +409 -0
- package/lib/providers/google.js +293 -0
- package/lib/providers/openai-compatible.js +338 -0
- package/lib/providers/openai.js +622 -0
- package/lib/providers.js +26 -0
- package/lib/template-engine.js +168 -0
- package/lib/token-usage.js +301 -0
- package/package.json +1 -1
- package/skills/modelmix/SKILL.md +4 -4
- package/test/effort.test.js +37 -0
- package/test/glm.test.js +21 -1
- package/test/model-chain.test.js +12 -0
- package/test/public-api.test.js +54 -0
- package/test/qwen.test.js +20 -0
- package/test/tokens.test.js +20 -0
package/test/qwen.test.js
CHANGED
|
@@ -61,6 +61,26 @@ describe('Qwen Model Registration Tests', () => {
|
|
|
61
61
|
expect(model.models[0].key).to.equal('qwen/qwen3.8-max');
|
|
62
62
|
});
|
|
63
63
|
|
|
64
|
+
it('should register Qwen 3.8 27B through OpenRouter', () => {
|
|
65
|
+
const model = ModelMix.new().qwen3827b();
|
|
66
|
+
|
|
67
|
+
expect(model.models).to.have.length(1);
|
|
68
|
+
expect(model.models[0].key).to.equal('qwen/qwen3.8-27b');
|
|
69
|
+
expect(model.models[0].provider).to.be.instanceOf(MixOpenRouter);
|
|
70
|
+
expect(ModelMix.calculateCost('qwen/qwen3.8-27b', {
|
|
71
|
+
input: 1_000_000,
|
|
72
|
+
cached: 250_000,
|
|
73
|
+
output: 1_000_000
|
|
74
|
+
})).to.equal(3.55);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('should support Qwen 3.8 27B in chain()', () => {
|
|
78
|
+
const model = ModelMix.new().chain('qwen3827b');
|
|
79
|
+
|
|
80
|
+
expect(model.models).to.have.length(1);
|
|
81
|
+
expect(model.models[0].key).to.equal('qwen/qwen3.8-27b');
|
|
82
|
+
});
|
|
83
|
+
|
|
64
84
|
it('should register Qwen 3.5 397B A17B through OpenRouter', () => {
|
|
65
85
|
const model = ModelMix.new().qwen35397b();
|
|
66
86
|
|
package/test/tokens.test.js
CHANGED
|
@@ -576,6 +576,26 @@ describe('Token Usage Tracking', () => {
|
|
|
576
576
|
}
|
|
577
577
|
});
|
|
578
578
|
|
|
579
|
+
it('should register GPT-OSS 120B through the current OpenRouter model ID', function () {
|
|
580
|
+
const originalOpenRouterApiKey = process.env.OPENROUTER_API_KEY;
|
|
581
|
+
process.env.OPENROUTER_API_KEY = 'test-openrouter-key';
|
|
582
|
+
|
|
583
|
+
try {
|
|
584
|
+
const model = ModelMix.new().gptOss({
|
|
585
|
+
mix: { cerebras: false, groq: true, openrouter: true, together: false }
|
|
586
|
+
});
|
|
587
|
+
|
|
588
|
+
expect(model.models.map(({ key }) => key)).to.deep.equal([
|
|
589
|
+
'openai/gpt-oss-120b',
|
|
590
|
+
'openai/gpt-oss-120b'
|
|
591
|
+
]);
|
|
592
|
+
expect(model.models[1].provider).to.be.instanceOf(MixOpenRouter);
|
|
593
|
+
} finally {
|
|
594
|
+
if (originalOpenRouterApiKey === undefined) delete process.env.OPENROUTER_API_KEY;
|
|
595
|
+
else process.env.OPENROUTER_API_KEY = originalOpenRouterApiKey;
|
|
596
|
+
}
|
|
597
|
+
});
|
|
598
|
+
|
|
579
599
|
it('should use api-key header for MiMo provider', function () {
|
|
580
600
|
const originalMimoApiKey = process.env.MIMO_API_KEY;
|
|
581
601
|
process.env.MIMO_API_KEY = 'test-mimo-key';
|