modelmix 4.6.2 → 4.6.5

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 CHANGED
@@ -49,7 +49,7 @@ try { process.loadEnvFile(); } catch {}
49
49
 
50
50
  // Get structured JSON responses
51
51
  const model = ModelMix.new()
52
- .sonnet46() // Anthropic claude-sonnet-4-6
52
+ .opus5() // Anthropic claude-opus-5
53
53
  .addText("Name and capital of 3 South American countries.");
54
54
 
55
55
  const outputExample = { countries: [{ name: "", capital: "" }] };
@@ -67,9 +67,9 @@ const setup = {
67
67
  };
68
68
 
69
69
  const model = await ModelMix.new(setup)
70
- .sonnet46() // (main model) Anthropic claude-sonnet-4-5-20250929
71
- .gpt5mini() // (fallback 2) OpenAI gpt-5-mini
72
- .gemini3flash({ config: { temperature: 0 } }) // (fallback 3) Google gemini-3-flash
70
+ .sonnet5() // (main model) Anthropic claude-sonnet-5
71
+ .gpt56luna() // (fallback 2) OpenAI gpt-5.6-luna
72
+ .gemini36flash({ config: { temperature: 0 } }) // (fallback 3) Google gemini-36-flash
73
73
  .grok43() // (fallback 4) Grok grok-4.3
74
74
  .addText("What's your name?");
75
75
 
@@ -114,7 +114,7 @@ BRAVE_API_KEY="BSA0..._fm"
114
114
  ```
115
115
 
116
116
  ```javascript
117
- const mmix = ModelMix.new({ config: { max_history: 10 } }).gpt5nano();
117
+ const mmix = ModelMix.new({ config: { max_history: 10 } }).gpt56sol();
118
118
  mmix.setSystem('You are an assistant and today is ' + new Date().toISOString());
119
119
 
120
120
  // Add web search capability through MCP
@@ -154,6 +154,7 @@ Here's a comprehensive list of available methods:
154
154
  | `gpt41nano()` | OpenAI | gpt-4.1-nano | [\$0.10 / \$0.40][1] |
155
155
  | `gptOss()` | Together | gpt-oss-120B | [\$0.15 / \$0.60][7] |
156
156
  | `fable5[think]()` | Anthropic | claude-fable-5 | [\$10.00 / \$50.00][2] |
157
+ | `opus5[think]()` | Anthropic | claude-opus-5 | [\$5.00 / \$25.00][2] |
157
158
  | `opus48[think]()` | Anthropic | claude-opus-4-8 | [\$5.00 / \$25.00][2] |
158
159
  | `opus47[think]()` | Anthropic | claude-opus-4-7 | [\$5.00 / \$25.00][2] |
159
160
  | `opus46[think]()` | Anthropic | claude-opus-4-6 | [\$5.00 / \$25.00][2] |
@@ -161,7 +162,8 @@ Here's a comprehensive list of available methods:
161
162
  | `sonnet46[think]()` | Anthropic | claude-sonnet-4-6 | [\$3.00 / \$15.00][2] |
162
163
  | `haiku45[think]()` | Anthropic | claude-haiku-4-5-20251001 | [\$1.00 / \$5.00][2] |
163
164
  | `gemini31pro()` | Google | gemini-3.1-pro-preview | [\$2.00 / \$12.00][3] |
164
- | `gemini35flash()` | Google | gemini-3.5-flash | N/A |
165
+ | `gemini36flash()` | Google | gemini-3.6-flash | [\$1.50 / \$7.50][3] |
166
+ | `gemini35flash()` | Google | gemini-3.5-flash | [\$0.75 / \$4.50][3] |
165
167
  | `gemini31flashLite()`| Google | gemini-3.1-flash-lite-preview | [\$0.25 / \$1.50][3] |
166
168
  | `grok43()` | Grok | grok-4.3 | [\$1.25 / \$2.50][6] |
167
169
  | `grok420multiAgent()`| Grok | grok-4.20-multi-agent-0309 | [\$1.25 / \$2.50][6] |
@@ -250,7 +252,7 @@ Analyze the following and provide 3 key insights:
250
252
 
251
253
  **`app.js`**
252
254
  ```javascript
253
- const gpt = ModelMix.new().gpt5mini();
255
+ const gpt = ModelMix.new().gpt56luna();
254
256
 
255
257
  gpt.setSystemFromFile('./prompts/system.md');
256
258
  gpt.addTextFromFile('./prompts/task.md');
@@ -330,7 +332,7 @@ await model.json(schemaExample, schemaDescription, options)
330
332
 
331
333
  ```javascript
332
334
  const model = ModelMix.new()
333
- .gpt5mini()
335
+ .gpt56luna()
334
336
  .addText('Name and capital of 3 South American countries.');
335
337
 
336
338
  const result = await model.json({ countries: [{ name: "", capital: "" }] });
package/index.js CHANGED
@@ -62,6 +62,7 @@ const MODEL_PRICING = {
62
62
  'openai/gpt-oss-120b:free': [0, 0],
63
63
  // Anthropic
64
64
  'claude-fable-5': [10.00, 50.00],
65
+ 'claude-opus-5': [5.00, 25.00],
65
66
  'claude-sonnet-5': [3.00, 15.00],
66
67
  'claude-opus-4-8': [5.00, 25.00],
67
68
  'claude-opus-4-7': [5.00, 25.00],
@@ -76,6 +77,7 @@ const MODEL_PRICING = {
76
77
  'gemini-3.1-pro-preview':[2.00, 12.00],
77
78
  'gemini-3-pro-preview': [2.00, 12.00],
78
79
  'gemini-3-flash-preview': [0.50, 3.00],
80
+ 'gemini-3.6-flash': [1.50, 7.50],
79
81
  'gemini-3.5-flash': [0.75, 4.50],
80
82
  'gemini-2.5-pro': [1.25, 10.00],
81
83
  'gemini-2.5-flash': [0.30, 2.50],
@@ -366,9 +368,16 @@ class ModelMix {
366
368
  return this.attach('claude-fable-5', new MixAnthropic({ options, config }));
367
369
  }
368
370
  fable5think({ options = {}, config = {} } = {}) {
369
- options = { ...MixAnthropic.fableThinkingOptions, ...options };
371
+ options = { ...MixAnthropic.maxEffortThinkingOptions, ...options };
370
372
  return this.attach('claude-fable-5', new MixAnthropic({ options, config }));
371
373
  }
374
+ opus5({ options = {}, config = {} } = {}) {
375
+ return this.attach('claude-opus-5', new MixAnthropic({ options, config }));
376
+ }
377
+ opus5think({ options = {}, config = {} } = {}) {
378
+ options = { ...MixAnthropic.maxEffortThinkingOptions, ...options };
379
+ return this.attach('claude-opus-5', new MixAnthropic({ options, config }));
380
+ }
372
381
  opus48think({ options = {}, config = {} } = {}) {
373
382
  options = { ...MixAnthropic.thinkingOptions, ...options };
374
383
  return this.attach('claude-opus-4-8', new MixAnthropic({ options, config }));
@@ -448,6 +457,9 @@ class ModelMix {
448
457
  gemini3flash({ options = {}, config = {} } = {}) {
449
458
  return this.attach('gemini-3-flash-preview', new MixGoogle({ options, config }));
450
459
  }
460
+ gemini36flash({ options = {}, config = {} } = {}) {
461
+ return this.attach('gemini-3.6-flash', new MixGoogle({ options, config }));
462
+ }
451
463
  gemini35flash({ options = {}, config = {} } = {}) {
452
464
  return this.attach('gemini-3.5-flash', new MixGoogle({ options, config }));
453
465
  }
@@ -2172,7 +2184,7 @@ class MixAnthropic extends MixCustom {
2172
2184
  temperature: 1
2173
2185
  };
2174
2186
 
2175
- static fableThinkingOptions = {
2187
+ static maxEffortThinkingOptions = {
2176
2188
  output_config: { effort: 'max' },
2177
2189
  thinking: { display: 'summarized' },
2178
2190
  temperature: 1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "modelmix",
3
- "version": "4.6.2",
3
+ "version": "4.6.5",
4
4
  "description": "🧬 Reliable interface with automatic fallback for AI LLMs.",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -24,6 +24,7 @@
24
24
  "kimi",
25
25
  "mythos",
26
26
  "gpt5",
27
+ "opus5",
27
28
  "fable",
28
29
  "sonnet",
29
30
  "openrouter",
@@ -96,12 +96,12 @@ If `sonnet46` fails, it automatically tries `gpt52`, then `gemini3flash`.
96
96
  `gpt52()` `gpt52chat()` `gpt51()` `gpt5()` `gpt5mini()` `gpt5nano()` `gpt45()` `gpt41()` `gpt41mini()` `gpt41nano()` `o3()` `o4mini()`
97
97
 
98
98
  ### Anthropic
99
- `fable5()` `opus48()` `opus47()` `opus46()` `opus41()` `sonnet5()` `sonnet46()` `sonnet45()` `sonnet4()` `haiku45()` `haiku35()`
99
+ `fable5()` `opus5()` `opus48()` `opus47()` `opus46()` `opus41()` `sonnet5()` `sonnet46()` `sonnet45()` `sonnet4()` `haiku45()` `haiku35()`
100
100
 
101
- Thinking variants: append `think` — e.g. `fable5think()` `opus48think()` `opus47think()` `opus46think()` `sonnet5think()` `sonnet46think()` `sonnet45think()` `sonnet4think()` `opus41think()` `haiku45think()`
101
+ Thinking variants: append `think` — e.g. `fable5think()` `opus5think()` `opus48think()` `opus47think()` `opus46think()` `sonnet5think()` `sonnet46think()` `sonnet45think()` `sonnet4think()` `opus41think()` `haiku45think()`
102
102
 
103
103
  ### Google
104
- `gemini3pro()` `gemini3flash()` `gemini35flash()` `gemini25pro()` `gemini25flash()`
104
+ `gemini3pro()` `gemini3flash()` `gemini36flash()` `gemini35flash()` `gemini25pro()` `gemini25flash()`
105
105
 
106
106
  ### Grok
107
107
  `grok43()` `grok420multiAgent()` `grok420()` `grok420think()` `grok41()` `grok41think()`
@@ -21,6 +21,25 @@ describe('Anthropic Model Registration Tests', () => {
21
21
  expect(model.models[0].provider.options.thinking).to.deep.equal({ display: 'summarized' });
22
22
  });
23
23
 
24
+ it('should register Claude Opus 5', () => {
25
+ const model = ModelMix.new();
26
+ model.opus5();
27
+
28
+ expect(model.models).to.have.length(1);
29
+ expect(model.models[0].key).to.equal('claude-opus-5');
30
+ expect(model.models[0].provider).to.be.instanceOf(MixAnthropic);
31
+ });
32
+
33
+ it('should register Claude Opus 5 with max effort thinking', () => {
34
+ const model = ModelMix.new();
35
+ model.opus5think();
36
+
37
+ expect(model.models).to.have.length(1);
38
+ expect(model.models[0].key).to.equal('claude-opus-5');
39
+ expect(model.models[0].provider.options.output_config).to.deep.equal({ effort: 'max' });
40
+ expect(model.models[0].provider.options.thinking).to.deep.equal({ display: 'summarized' });
41
+ });
42
+
24
43
  it('should register Claude Opus 4.8', () => {
25
44
  const model = ModelMix.new();
26
45
  model.opus48();
@@ -105,13 +105,17 @@ describe('Token Usage Tracking', () => {
105
105
  expect(ModelMix.calculateCost('gpt-5.6-luna', { input: 1_000_000, output: 1_000_000 })).to.equal(7);
106
106
  });
107
107
 
108
- it('should register Gemini 3.5 Flash shortcut with Google provider', function () {
108
+ it('should register Gemini Flash shortcuts with Google provider', function () {
109
109
  const model = ModelMix.new()
110
+ .gemini36flash()
110
111
  .gemini35flash();
111
112
 
112
- expect(model.models).to.have.length(1);
113
- expect(model.models[0].key).to.equal('gemini-3.5-flash');
114
- expect(model.models[0].provider).to.be.instanceOf(MixGoogle);
113
+ expect(model.models.map(({ key }) => key)).to.deep.equal([
114
+ 'gemini-3.6-flash',
115
+ 'gemini-3.5-flash'
116
+ ]);
117
+ expect(model.models.every(({ provider }) => provider instanceof MixGoogle)).to.equal(true);
118
+ expect(ModelMix.calculateCost('gemini-3.6-flash', { input: 1_000_000, output: 1_000_000 })).to.equal(9);
115
119
  expect(ModelMix.calculateCost('gemini-3.5-flash', { input: 1_000_000, output: 1_000_000 })).to.equal(5.25);
116
120
  });
117
121