modelmix 5.1.1 → 5.1.2
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 +2 -2
- package/demo/free.js +2 -3
- package/effort.js +0 -1
- package/index.js +513 -2847
- 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 +299 -0
- package/package.json +1 -1
- package/skills/modelmix/SKILL.md +2 -2
- package/test/effort.test.js +20 -0
- package/test/model-chain.test.js +12 -0
- package/test/public-api.test.js +54 -0
- package/test/tokens.test.js +20 -0
package/README.md
CHANGED
|
@@ -117,9 +117,9 @@ const ETH = ModelMix.new()
|
|
|
117
117
|
console.log(ETH.price);
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
-
**This example uses providers with free quotas (
|
|
120
|
+
**This example uses providers with free quotas (Groq, Cerebras, and Together). OpenRouter is disabled because its GPT-OSS 120B route is no longer free. If one model runs out of quota, ModelMix automatically falls back to the next model in the chain.**
|
|
121
121
|
```javascript
|
|
122
|
-
ModelMix.new()
|
|
122
|
+
ModelMix.new({ mix: { openrouter: false } })
|
|
123
123
|
.gptOss()
|
|
124
124
|
.kimiK25()
|
|
125
125
|
.hermes3()
|
package/demo/free.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { ModelMix } from '../index.js';
|
|
2
2
|
try { process.loadEnvFile(); } catch {}
|
|
3
3
|
|
|
4
|
-
const ai = ModelMix.new({ config: { debug: 2 } })
|
|
4
|
+
const ai = ModelMix.new({ config: { debug: 2 }, mix: { openrouter: false } })
|
|
5
5
|
.gptOss()
|
|
6
6
|
.kimiK25()
|
|
7
7
|
.hermes3()
|
|
8
8
|
.addText('What is the capital of France?');
|
|
9
9
|
|
|
10
10
|
const response = await ai.message();
|
|
11
|
-
console.log('Response from
|
|
12
|
-
|
|
11
|
+
console.log('Response from a free-tier provider:', response);
|
|
13
12
|
|
package/effort.js
CHANGED