modelmix 4.5.12 → 4.5.16
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/MODELS.md +1 -1
- package/README.md +10 -8
- package/demo/grok.js +1 -1
- package/demo/nvidia.js +15 -0
- package/demo/short.js +1 -1
- package/index.js +46 -25
- package/package.json +1 -1
- package/skills/modelmix/SKILL.md +3 -3
- package/test/deepseek.test.js +20 -0
- package/test/grok.test.js +21 -0
- package/test/live.mcp.js +2 -2
- package/test/live.test.js +28 -8
- package/test/qwen.test.js +20 -0
- package/test/setup.js +1 -0
package/MODELS.md
CHANGED
|
@@ -352,4 +352,4 @@ All providers inherit from `MixCustom` base class which provides common function
|
|
|
352
352
|
- Uses OpenAI-compatible API interface
|
|
353
353
|
- Requires `MINIMAX_API_KEY` environment variable
|
|
354
354
|
- Inherits all OpenAI functionality including tool calling
|
|
355
|
-
- Available models: `MiniMax-M2`
|
|
355
|
+
- Available models: `MiniMax-M2.5`, `MiniMax-M2.7`
|
package/README.md
CHANGED
|
@@ -33,6 +33,7 @@ ANTHROPIC_API_KEY="sk-ant-..."
|
|
|
33
33
|
OPENAI_API_KEY="sk-proj-..."
|
|
34
34
|
OPENROUTER_API_KEY="sk-or-..."
|
|
35
35
|
MINIMAX_API_KEY="your-minimax-key..."
|
|
36
|
+
NVIDIA_API_KEY="nvapi-..."
|
|
36
37
|
...
|
|
37
38
|
GEMINI_API_KEY="AIza..."
|
|
38
39
|
```
|
|
@@ -68,7 +69,7 @@ const model = await ModelMix.new(setup)
|
|
|
68
69
|
.sonnet46() // (main model) Anthropic claude-sonnet-4-5-20250929
|
|
69
70
|
.gpt5mini() // (fallback 2) OpenAI gpt-5-mini
|
|
70
71
|
.gemini3flash({ config: { temperature: 0 } }) // (fallback 3) Google gemini-3-flash
|
|
71
|
-
.
|
|
72
|
+
.grok43() // (fallback 4) Grok grok-4.3
|
|
72
73
|
.addText("What's your name?");
|
|
73
74
|
|
|
74
75
|
console.log(await model.message());
|
|
@@ -150,23 +151,22 @@ Here's a comprehensive list of available methods:
|
|
|
150
151
|
| `opus47[think]()` | Anthropic | claude-opus-4-7 | [\$5.00 / \$25.00][2] |
|
|
151
152
|
| `opus46[think]()` | Anthropic | claude-opus-4-6 | [\$5.00 / \$25.00][2] |
|
|
152
153
|
| `sonnet46[think]()` | Anthropic | claude-sonnet-4-6 | [\$3.00 / \$15.00][2] |
|
|
153
|
-
| `sonnet45[think]()` | Anthropic | claude-sonnet-4-5-20250929 | [\$3.00 / \$15.00][2] |
|
|
154
154
|
| `haiku45[think]()` | Anthropic | claude-haiku-4-5-20251001 | [\$1.00 / \$5.00][2] |
|
|
155
155
|
| `gemini31pro()` | Google | gemini-3.1-pro-preview | [\$2.00 / \$12.00][3] |
|
|
156
|
-
| `gemini3pro()` | Google | gemini-3-pro-preview | [\$2.00 / \$12.00][3] |
|
|
157
|
-
| `gemini3flash()` | Google | gemini-3-flash-preview | [\$0.50 / \$3.00][3] |
|
|
158
156
|
| `gemini31flashLite()`| Google | gemini-3.1-flash-lite-preview | [\$0.25 / \$1.50][3] |
|
|
159
|
-
| `
|
|
157
|
+
| `grok43()` | Grok | grok-4.3 | [\$1.25 / \$2.50][6] |
|
|
158
|
+
| `grok420multiAgent()`| Grok | grok-4.20-multi-agent-0309 | [\$1.25 / \$2.50][6] |
|
|
159
|
+
| `grok420[think]()` | Grok | grok-4.20-0309 | [\$1.25 / \$2.50][6] |
|
|
160
160
|
| `grok41[think]()` | Grok | grok-4-1-fast | [\$0.20 / \$0.50][6] |
|
|
161
|
+
| `qwen36plus()` | Fireworks/Together | qwen3p6-plus / Qwen3.6-Plus | [\$0.50 / \$3.00][10] |
|
|
161
162
|
| `deepseekV4Pro()` | Fireworks | models/deepseek-v4-pro | [\$1.74 / \$3.48][10] |
|
|
162
163
|
| `GLM51()` | Fireworks | models/glm-5p1 | [\$1.05 / \$3.50][10] |
|
|
163
164
|
| `minimaxM27()` | MiniMax | MiniMax-M2.7 | [\$0.30 / \$1.20][9] |
|
|
164
165
|
| `sonar()` | Perplexity | sonar | [\$1.00 / \$1.00][4] |
|
|
165
166
|
| `sonarPro()` | Perplexity | sonar-pro | [\$3.00 / \$15.00][4] |
|
|
166
167
|
| `hermes3()` | Lambda | Hermes-3-Llama-3.1-405B-FP8 | [\$0.80 / \$0.80][8] |
|
|
167
|
-
| `qwen3()` | Together | Qwen3-235B-A22B-fp8-tput | [\$0.20 / \$0.60][7] |
|
|
168
168
|
| `kimiK25think()` | Together | Kimi-K2.5 | [\$0.50 / \$2.80][7] |
|
|
169
|
-
| `kimiK26think()` | Fireworks | models/kimi-k2p6 | [\$0.95 / \$4.00][10]
|
|
169
|
+
| `kimiK26think()` | Fireworks | models/kimi-k2p6 | [\$0.95 / \$4.00][10] |
|
|
170
170
|
|
|
171
171
|
[1]: https://platform.openai.com/docs/pricing "Pricing | OpenAI"
|
|
172
172
|
[2]: https://docs.anthropic.com/en/docs/about-claude/pricing "Pricing - Anthropic"
|
|
@@ -179,7 +179,9 @@ Here's a comprehensive list of available methods:
|
|
|
179
179
|
[9]: https://platform.minimax.io/docs/api-reference/anthropic-api-compatible-cache#supported-models-and-pricing "MiniMax Pricing"
|
|
180
180
|
[10]: https://fireworks.ai/pricing#serverless-pricing "Fireworks Pricing"
|
|
181
181
|
|
|
182
|
-
Each method accepts optional `options` and `
|
|
182
|
+
Each method accepts optional `options`, `config`, and (for multi-provider methods) `mix` parameters to customize behavior.
|
|
183
|
+
For NVIDIA on DeepSeek V4 Pro, use `deepseekV4Pro({ mix: { nvidia: true } })`.
|
|
184
|
+
For Together on Qwen 3.6 Plus, use `qwen36plus({ mix: { fireworks: false, together: true } })`.
|
|
183
185
|
|
|
184
186
|
```javascript
|
|
185
187
|
const result = await ModelMix.new({
|
package/demo/grok.js
CHANGED
package/demo/nvidia.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ModelMix } from '../index.js';
|
|
2
|
+
try { process.loadEnvFile(); } catch { }
|
|
3
|
+
|
|
4
|
+
const model = ModelMix.new()
|
|
5
|
+
.deepseekV4Flash()
|
|
6
|
+
.addText("Create exactly 5 characters for a narrative game.")
|
|
7
|
+
|
|
8
|
+
const jsonResult = await model.json([], [{
|
|
9
|
+
name: "character name",
|
|
10
|
+
role: "role in the story",
|
|
11
|
+
trait: "main trait",
|
|
12
|
+
goal: "short character goal"
|
|
13
|
+
}]);
|
|
14
|
+
|
|
15
|
+
console.log(jsonResult);
|
package/demo/short.js
CHANGED
|
@@ -13,7 +13,7 @@ const mmix = await ModelMix.new(setup)
|
|
|
13
13
|
.o4mini() // (fallback 1) OpenAI o4-mini
|
|
14
14
|
.gemini25proExp({ config: { temperature: 0 } }) // (fallback 2) Google gemini-2.5-pro-exp-03-25
|
|
15
15
|
.gpt41nano() // (fallback 3) OpenAI gpt-4.1-nano
|
|
16
|
-
.
|
|
16
|
+
.grok43() // (fallback 4) Grok grok-4.3
|
|
17
17
|
.addText("What's your name?");
|
|
18
18
|
|
|
19
19
|
console.log(await mmix.message());
|
package/index.js
CHANGED
|
@@ -73,19 +73,23 @@ const MODEL_PRICING = {
|
|
|
73
73
|
'gemini-2.5-flash': [0.30, 2.50],
|
|
74
74
|
'gemini-3.1-flash-lite-preview': [0.25, 1.50],
|
|
75
75
|
// Grok
|
|
76
|
-
'grok-4
|
|
76
|
+
'grok-4.3': [1.25, 2.50],
|
|
77
|
+
'grok-4.20-multi-agent-0309': [1.25, 2.50],
|
|
78
|
+
'grok-4.20-0309-reasoning': [1.25, 2.50],
|
|
79
|
+
'grok-4.20-0309-non-reasoning': [1.25, 2.50],
|
|
77
80
|
'grok-4-1-fast-reasoning': [0.20, 0.50],
|
|
78
81
|
'grok-4-1-fast-non-reasoning': [0.20, 0.50],
|
|
79
82
|
// Fireworks
|
|
80
83
|
'accounts/fireworks/models/deepseek-v3p2': [0.56, 1.68],
|
|
81
84
|
'accounts/fireworks/models/deepseek-v4-pro': [1.74, 3.48],
|
|
85
|
+
'deepseek-ai/DeepSeek-V4-Pro': [2.10, 4.40],
|
|
82
86
|
'accounts/fireworks/models/glm-4p7': [0.55, 2.19],
|
|
83
87
|
'accounts/fireworks/models/glm-5p1': [1.05, 3.50],
|
|
84
88
|
'accounts/fireworks/models/kimi-k2p5': [0.50, 2.80],
|
|
85
89
|
'accounts/fireworks/models/qwen3p6-plus': [0.50, 3.00],
|
|
90
|
+
'Qwen/Qwen3.6-Plus': [0.50, 3.00],
|
|
86
91
|
'fireworks/glm-5': [1.00, 3.20],
|
|
87
92
|
// MiniMax
|
|
88
|
-
'MiniMax-M2.1': [0.30, 1.20],
|
|
89
93
|
'MiniMax-M2.5': [0.30, 1.20],
|
|
90
94
|
'MiniMax-M2.7': [0.30, 1.20],
|
|
91
95
|
'fireworks/minimax-m2p5': [0.30, 1.20],
|
|
@@ -421,14 +425,17 @@ class ModelMix {
|
|
|
421
425
|
return this.attach('sonar', new MixPerplexity({ options, config }));
|
|
422
426
|
}
|
|
423
427
|
|
|
424
|
-
|
|
425
|
-
return this.attach('grok-3', new MixGrok({ options, config }));
|
|
428
|
+
grok43({ options = {}, config = {} } = {}) {
|
|
429
|
+
return this.attach('grok-4.3', new MixGrok({ options, config }));
|
|
426
430
|
}
|
|
427
|
-
|
|
428
|
-
return this.attach('grok-
|
|
431
|
+
grok420multiAgent({ options = {}, config = {} } = {}) {
|
|
432
|
+
return this.attach('grok-4.20-multi-agent-0309', new MixGrok({ options, config }));
|
|
429
433
|
}
|
|
430
|
-
|
|
431
|
-
return this.attach('grok-4-
|
|
434
|
+
grok420think({ options = {}, config = {} } = {}) {
|
|
435
|
+
return this.attach('grok-4.20-0309-reasoning', new MixGrok({ options, config }));
|
|
436
|
+
}
|
|
437
|
+
grok420({ options = {}, config = {} } = {}) {
|
|
438
|
+
return this.attach('grok-4.20-0309-non-reasoning', new MixGrok({ options, config }));
|
|
432
439
|
}
|
|
433
440
|
grok41think({ options = {}, config = {} } = {}) {
|
|
434
441
|
return this.attach('grok-4-1-fast-reasoning', new MixGrok({ options, config }));
|
|
@@ -443,8 +450,11 @@ class ModelMix {
|
|
|
443
450
|
return this;
|
|
444
451
|
}
|
|
445
452
|
|
|
446
|
-
qwen36plus({ options = {}, config = {}, mix = { } } = {}) {
|
|
447
|
-
|
|
453
|
+
qwen36plus({ options = {}, config = {}, mix = { fireworks: true } } = {}) {
|
|
454
|
+
mix = { ...this.mix, ...mix };
|
|
455
|
+
if (mix.fireworks) this.attach('accounts/fireworks/models/qwen3p6-plus', new MixFireworks({ options, config }));
|
|
456
|
+
if (mix.together) this.attach('Qwen/Qwen3.6-Plus', new MixTogether({ options, config }));
|
|
457
|
+
return this;
|
|
448
458
|
}
|
|
449
459
|
|
|
450
460
|
scout({ options = {}, config = {}, mix = {} } = {}) {
|
|
@@ -497,16 +507,6 @@ class ModelMix {
|
|
|
497
507
|
return this.attach(model, new MixLMStudio({ options, config }));
|
|
498
508
|
}
|
|
499
509
|
|
|
500
|
-
minimaxM2({ options = {}, config = {} } = {}) {
|
|
501
|
-
return this.attach('MiniMax-M2', new MixMiniMax({ options, config }));
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
minimaxM21({ options = {}, config = {}, mix = { minimax: true } } = {}) {
|
|
505
|
-
mix = { ...this.mix, ...mix };
|
|
506
|
-
if (mix.minimax) this.attach('MiniMax-M2.1', new MixMiniMax({ options, config }));
|
|
507
|
-
if (mix.cerebras) this.attach('MiniMax-M2.1', new MixCerebras({ options, config }));
|
|
508
|
-
return this;
|
|
509
|
-
}
|
|
510
510
|
|
|
511
511
|
minimaxM25({ options = {}, config = {}, mix = { minimax: true } } = {}) {
|
|
512
512
|
mix = { ...this.mix, ...mix };
|
|
@@ -515,11 +515,9 @@ class ModelMix {
|
|
|
515
515
|
return this;
|
|
516
516
|
}
|
|
517
517
|
|
|
518
|
-
minimaxM2Stable({ options = {}, config = {} } = {}) {
|
|
519
|
-
return this.attach('MiniMax-M2-Stable', new MixMiniMax({ options, config }));
|
|
520
|
-
}
|
|
521
|
-
|
|
522
518
|
minimaxM27({ options = {}, config = {}, mix = { openrouter: true, minimax: true } } = {}) {
|
|
519
|
+
mix = { ...this.mix, ...mix };
|
|
520
|
+
if (mix.nvidia) this.attach('minimaxai/minimax-m2.7', new MixNVIDIA({ options, config }));
|
|
523
521
|
if (mix.openrouter) return this.attach('minimax/minimax-m2.7', new MixOpenRouter({ options, config }));
|
|
524
522
|
if (mix.minimax) return this.attach('MiniMax-M2.7', new MixMiniMax({ options, config }));
|
|
525
523
|
if (mix.together) return this.attach('MiniMaxAI/MiniMax-M2.7', new MixTogether({ options, config }));
|
|
@@ -528,14 +526,22 @@ class ModelMix {
|
|
|
528
526
|
|
|
529
527
|
deepseekV4Pro({ options = {}, config = {}, mix = { fireworks: true } } = {}) {
|
|
530
528
|
mix = { ...this.mix, ...mix };
|
|
529
|
+
if (mix.nvidia) this.attach('deepseek-ai/deepseek-v4-pro', new MixNVIDIA({ options, config }));
|
|
531
530
|
if (mix.fireworks) this.attach('accounts/fireworks/models/deepseek-v4-pro', new MixFireworks({ options, config }));
|
|
532
531
|
if (mix.openrouter) this.attach('deepseek/deepseek-v4-pro', new MixOpenRouter({ options, config }));
|
|
533
532
|
if (mix.together) this.attach('deepseek-ai/DeepSeek-V4-Pro', new MixTogether({ options, config }));
|
|
534
533
|
return this;
|
|
535
534
|
}
|
|
536
535
|
|
|
536
|
+
deepseekV4Flash({ options = {}, config = {}, mix = { nvidia: true } } = {}) {
|
|
537
|
+
mix = { ...this.mix, ...mix };
|
|
538
|
+
if (mix.nvidia) this.attach('deepseek-ai/deepseek-v4-flash', new MixNVIDIA({ options, config }));
|
|
539
|
+
return this;
|
|
540
|
+
}
|
|
541
|
+
|
|
537
542
|
GLM51({ options = {}, config = {}, mix = { fireworks: true } } = {}) {
|
|
538
543
|
mix = { ...this.mix, ...mix };
|
|
544
|
+
if (mix.nvidia) this.attach('z-ai/glm-5.1', new MixNVIDIA({ options, config }));
|
|
539
545
|
if (mix.fireworks) this.attach('accounts/fireworks/models/glm-5p1', new MixFireworks({ options, config }));
|
|
540
546
|
if (mix.openrouter) this.attach('z-ai/glm-5.1', new MixOpenRouter({ options, config }));
|
|
541
547
|
if (mix.together) this.attach('zai-org/GLM-5.1', new MixTogether({ options, config }));
|
|
@@ -2549,6 +2555,21 @@ class MixFireworks extends MixCustom {
|
|
|
2549
2555
|
}
|
|
2550
2556
|
}
|
|
2551
2557
|
|
|
2558
|
+
class MixNVIDIA extends MixCustom {
|
|
2559
|
+
getDefaultConfig(customConfig) {
|
|
2560
|
+
|
|
2561
|
+
if (!process.env.NVIDIA_API_KEY) {
|
|
2562
|
+
throw new Error('NVIDIA API key not found. Please provide it in config or set NVIDIA_API_KEY environment variable.');
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2565
|
+
return super.getDefaultConfig({
|
|
2566
|
+
url: 'https://integrate.api.nvidia.com/v1/chat/completions',
|
|
2567
|
+
apiKey: process.env.NVIDIA_API_KEY,
|
|
2568
|
+
...customConfig
|
|
2569
|
+
});
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2552
2573
|
class MixGoogle extends MixCustom {
|
|
2553
2574
|
getDefaultConfig(customConfig) {
|
|
2554
2575
|
return super.getDefaultConfig({
|
|
@@ -2825,4 +2846,4 @@ class MixGoogle extends MixCustom {
|
|
|
2825
2846
|
}
|
|
2826
2847
|
}
|
|
2827
2848
|
|
|
2828
|
-
module.exports = { MixCustom, ModelMix, MixAnthropic, MixMiniMax, MixOpenAI, MixOpenAIResponses, MixOpenAIWebSocket, MixOpenRouter, MixPerplexity, MixOllama, MixLMStudio, MixGroq, MixTogether, MixGrok, MixCerebras, MixGoogle, MixFireworks };
|
|
2849
|
+
module.exports = { MixCustom, ModelMix, MixAnthropic, MixMiniMax, MixOpenAI, MixOpenAIResponses, MixOpenAIWebSocket, MixOpenRouter, MixPerplexity, MixOllama, MixLMStudio, MixGroq, MixTogether, MixGrok, MixCerebras, MixGoogle, MixFireworks, MixNVIDIA };
|
package/package.json
CHANGED
package/skills/modelmix/SKILL.md
CHANGED
|
@@ -104,7 +104,7 @@ Thinking variants: append `think` — e.g. `opus46think()` `sonnet46think()` `so
|
|
|
104
104
|
`gemini3pro()` `gemini3flash()` `gemini25pro()` `gemini25flash()`
|
|
105
105
|
|
|
106
106
|
### Grok
|
|
107
|
-
`
|
|
107
|
+
`grok43()` `grok420multiAgent()` `grok420()` `grok420think()` `grok41()` `grok41think()`
|
|
108
108
|
|
|
109
109
|
### Perplexity
|
|
110
110
|
`sonar()` `sonarPro()`
|
|
@@ -113,10 +113,10 @@ Thinking variants: append `think` — e.g. `opus46think()` `sonnet46think()` `so
|
|
|
113
113
|
`scout()` `maverick()`
|
|
114
114
|
|
|
115
115
|
### Together
|
|
116
|
-
`
|
|
116
|
+
`qwen36plus()` `kimiK25think()` `gptOss()`
|
|
117
117
|
|
|
118
118
|
### MiniMax
|
|
119
|
-
`minimaxM25()` `
|
|
119
|
+
`minimaxM25()` `minimaxM27()`
|
|
120
120
|
|
|
121
121
|
### Fireworks
|
|
122
122
|
`deepseekV32()` `GLM5()` `GLM47()`
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const { expect } = require('chai');
|
|
2
|
+
const { ModelMix } = require('../index.js');
|
|
3
|
+
|
|
4
|
+
describe('DeepSeek Model Registration Tests', () => {
|
|
5
|
+
it('should register Fireworks DeepSeek V4 Pro by default', () => {
|
|
6
|
+
const model = ModelMix.new();
|
|
7
|
+
model.deepseekV4Pro({ mix: { fireworks: true, openrouter: false } });
|
|
8
|
+
|
|
9
|
+
expect(model.models).to.have.length(1);
|
|
10
|
+
expect(model.models[0].key).to.equal('accounts/fireworks/models/deepseek-v4-pro');
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should register Together DeepSeek V4 Pro when together mix is enabled', () => {
|
|
14
|
+
const model = ModelMix.new();
|
|
15
|
+
model.deepseekV4Pro({ mix: { fireworks: false, openrouter: false, together: true } });
|
|
16
|
+
|
|
17
|
+
expect(model.models).to.have.length(1);
|
|
18
|
+
expect(model.models[0].key).to.equal('deepseek-ai/DeepSeek-V4-Pro');
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const { expect } = require('chai');
|
|
2
|
+
const { ModelMix } = require('../index.js');
|
|
3
|
+
|
|
4
|
+
describe('Grok Model Registration Tests', () => {
|
|
5
|
+
const grokModels = [
|
|
6
|
+
{ method: 'grok43', key: 'grok-4.3' },
|
|
7
|
+
{ method: 'grok420multiAgent', key: 'grok-4.20-multi-agent-0309' },
|
|
8
|
+
{ method: 'grok420think', key: 'grok-4.20-0309-reasoning' },
|
|
9
|
+
{ method: 'grok420', key: 'grok-4.20-0309-non-reasoning' }
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
for (const grokModel of grokModels) {
|
|
13
|
+
it(`should register ${grokModel.key} with ${grokModel.method}()`, () => {
|
|
14
|
+
const model = ModelMix.new();
|
|
15
|
+
model[grokModel.method]();
|
|
16
|
+
|
|
17
|
+
expect(model.models).to.have.length(1);
|
|
18
|
+
expect(model.models[0].key).to.equal(grokModel.key);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
package/test/live.mcp.js
CHANGED
|
@@ -191,8 +191,8 @@ describe('Live MCP Integration Tests', function () {
|
|
|
191
191
|
|
|
192
192
|
describe('Advanced MCP Tool Integration', function () {
|
|
193
193
|
|
|
194
|
-
it('should use multiple MCP tools with Grok 3
|
|
195
|
-
const model = ModelMix.new(setup).
|
|
194
|
+
it('should use multiple MCP tools with Grok 4.3', async function () {
|
|
195
|
+
const model = ModelMix.new(setup).grok43();
|
|
196
196
|
|
|
197
197
|
// Add multiple tools
|
|
198
198
|
model.addTools([
|
package/test/live.test.js
CHANGED
|
@@ -204,18 +204,38 @@ describe('Live Integration Tests', function () {
|
|
|
204
204
|
expect(response.toLowerCase()).to.include('gptoss test successful');
|
|
205
205
|
});
|
|
206
206
|
|
|
207
|
-
it('should work with
|
|
208
|
-
const model = ModelMix.new(setup).
|
|
207
|
+
it('should work with Grok 4.1 model', async function () {
|
|
208
|
+
const model = ModelMix.new(setup).grok41();
|
|
209
209
|
|
|
210
|
-
model.addText('Say "
|
|
210
|
+
model.addText('Say "grok41 test successful" and nothing else.');
|
|
211
211
|
|
|
212
212
|
const response = await model.message();
|
|
213
|
-
console.log(`
|
|
213
|
+
console.log(`Grok 4.1 response: ${response}`);
|
|
214
214
|
|
|
215
215
|
expect(response).to.be.a('string');
|
|
216
|
-
expect(response.toLowerCase()).to.include('
|
|
216
|
+
expect(response.toLowerCase()).to.include('grok41 test successful');
|
|
217
217
|
});
|
|
218
218
|
|
|
219
|
+
const grokSeriesTests = [
|
|
220
|
+
{ name: 'Grok 4.3', factory: (m) => m.grok43(), token: 'grok43' },
|
|
221
|
+
{ name: 'Grok 4.20 reasoning', factory: (m) => m.grok420think(), token: 'grok420think' },
|
|
222
|
+
{ name: 'Grok 4.20 non-reasoning', factory: (m) => m.grok420(), token: 'grok420' }
|
|
223
|
+
];
|
|
224
|
+
|
|
225
|
+
for (const grokModel of grokSeriesTests) {
|
|
226
|
+
it(`should work with ${grokModel.name} model`, async function () {
|
|
227
|
+
const model = grokModel.factory(ModelMix.new(setup));
|
|
228
|
+
|
|
229
|
+
model.addText(`Say "${grokModel.token} test successful" and nothing else.`);
|
|
230
|
+
|
|
231
|
+
const response = await model.message();
|
|
232
|
+
console.log(`${grokModel.name} response: ${response}`);
|
|
233
|
+
|
|
234
|
+
expect(response).to.be.a('string');
|
|
235
|
+
expect(response.toLowerCase()).to.include(`${grokModel.token} test successful`);
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
|
|
219
239
|
});
|
|
220
240
|
|
|
221
241
|
describe('Image Processing with JSON Output', function () {
|
|
@@ -240,8 +260,8 @@ describe('Live Integration Tests', function () {
|
|
|
240
260
|
expect(result.color).to.be.a('string').and.not.empty;
|
|
241
261
|
});
|
|
242
262
|
|
|
243
|
-
it('should process images and return JSON with Grok 4', async function () {
|
|
244
|
-
const model = ModelMix.new(setup).
|
|
263
|
+
it('should process images and return JSON with Grok 4.3', async function () {
|
|
264
|
+
const model = ModelMix.new(setup).grok43();
|
|
245
265
|
|
|
246
266
|
model.addImageFromUrl(blueSquareBase64)
|
|
247
267
|
.addText('Analyze this image and provide details in JSON format.');
|
|
@@ -252,7 +272,7 @@ describe('Live Integration Tests', function () {
|
|
|
252
272
|
description: "string"
|
|
253
273
|
});
|
|
254
274
|
|
|
255
|
-
console.log(`
|
|
275
|
+
console.log(`Grok 4.3 image JSON result:`, result);
|
|
256
276
|
|
|
257
277
|
expect(result).to.be.an('object');
|
|
258
278
|
expect(result).to.have.property('color');
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const { expect } = require('chai');
|
|
2
|
+
const { ModelMix } = require('../index.js');
|
|
3
|
+
|
|
4
|
+
describe('Qwen Model Registration Tests', () => {
|
|
5
|
+
it('should register Fireworks Qwen 3.6 Plus by default', () => {
|
|
6
|
+
const model = ModelMix.new();
|
|
7
|
+
model.qwen36plus({ mix: { fireworks: true, together: false } });
|
|
8
|
+
|
|
9
|
+
expect(model.models).to.have.length(1);
|
|
10
|
+
expect(model.models[0].key).to.equal('accounts/fireworks/models/qwen3p6-plus');
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should register Together Qwen 3.6 Plus when together mix is enabled', () => {
|
|
14
|
+
const model = ModelMix.new();
|
|
15
|
+
model.qwen36plus({ mix: { fireworks: false, openrouter: false, together: true } });
|
|
16
|
+
|
|
17
|
+
expect(model.models).to.have.length(1);
|
|
18
|
+
expect(model.models[0].key).to.equal('Qwen/Qwen3.6-Plus');
|
|
19
|
+
});
|
|
20
|
+
});
|
package/test/setup.js
CHANGED
|
@@ -29,6 +29,7 @@ process.env.GROQ_API_KEY = process.env.GROQ_API_KEY || 'gsk_test-dummy-key-for-t
|
|
|
29
29
|
process.env.TOGETHER_API_KEY = process.env.TOGETHER_API_KEY || '49a96test-dummy-key-for-testing-purposes';
|
|
30
30
|
process.env.XAI_API_KEY = process.env.XAI_API_KEY || 'xai-test-dummy-key-for-testing-purposes';
|
|
31
31
|
process.env.CEREBRAS_API_KEY = process.env.CEREBRAS_API_KEY || 'csk-test-dummy-key-for-testing-purposes';
|
|
32
|
+
process.env.NVIDIA_API_KEY = process.env.NVIDIA_API_KEY || 'nvapi-test-dummy-key-for-testing-purposes';
|
|
32
33
|
process.env.GEMINI_API_KEY = process.env.GEMINI_API_KEY || 'AIzatest-dummy-key-for-testing-purposes';
|
|
33
34
|
process.env.LAMBDA_API_KEY = process.env.LAMBDA_API_KEY || 'secret_test-dummy-key-for-testing-purposes';
|
|
34
35
|
process.env.BRAVE_API_KEY = process.env.BRAVE_API_KEY || 'BSA0test-dummy-key-for-testing-purposes_fm';
|