modelmix 4.1.6 → 4.2.0
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 +4 -2
- package/demo/fireworks.js +22 -0
- package/demo/minimax.js +1 -1
- package/index.js +30 -1
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -137,10 +137,11 @@ Here's a comprehensive list of available methods:
|
|
|
137
137
|
| `gemini3flash()` | Google | gemini-3-flash-preview | [\$0.50 / \$3.00][3] |
|
|
138
138
|
| `gemini25pro()` | Google | gemini-2.5-pro | [\$1.25 / \$10.00][3] |
|
|
139
139
|
| `gemini25flash()` | Google | gemini-2.5-flash | [\$0.30 / \$2.50][3] |
|
|
140
|
-
| `grok3()` | Grok | grok-3 | [\$3.00 / \$15.00][6] |
|
|
141
140
|
| `grok4()` | Grok | grok-4-0709 | [\$3.00 / \$15.00][6] |
|
|
142
141
|
| `grok41[think]()` | Grok | grok-4-1-fast | [\$0.20 / \$0.50][6] |
|
|
143
|
-
| `
|
|
142
|
+
| `deepseekV32()` | Fireworks | fireworks/models/deepseek-v3p2 | [\$0.56 / \$1.68][10] |
|
|
143
|
+
| `GLM47()` | Fireworks | fireworks/models/glm-4p7 | [\$0.55 / \$2.19][10] |
|
|
144
|
+
| `minimaxM21()` | MiniMax | MiniMax-M2.1 | [\$0.30 / \$1.20][9] |
|
|
144
145
|
| `sonar()` | Perplexity | sonar | [\$1.00 / \$1.00][4] |
|
|
145
146
|
| `sonarPro()` | Perplexity | sonar-pro | [\$3.00 / \$15.00][4] |
|
|
146
147
|
| `scout()` | Groq | Llama-4-Scout-17B-16E-Instruct | [\$0.11 / \$0.34][5] |
|
|
@@ -159,6 +160,7 @@ Here's a comprehensive list of available methods:
|
|
|
159
160
|
[7]: https://www.together.ai/pricing "Together AI"
|
|
160
161
|
[8]: https://lambda.ai/inference "Lambda Pricing"
|
|
161
162
|
[9]: https://www.minimax.io/price "MiniMax Pricing"
|
|
163
|
+
[10]: https://fireworks.ai/pricing#serverless-pricing "Fireworks Pricing"
|
|
162
164
|
|
|
163
165
|
Each method accepts optional `options` and `config` parameters to customize the model's behavior. For example:
|
|
164
166
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
process.loadEnvFile();
|
|
2
|
+
import { ModelMix } from '../index.js';
|
|
3
|
+
|
|
4
|
+
async function main() {
|
|
5
|
+
try {
|
|
6
|
+
const ai = ModelMix.new();
|
|
7
|
+
|
|
8
|
+
const response = await ai
|
|
9
|
+
.deepseekV32()
|
|
10
|
+
.GLM47()
|
|
11
|
+
.addText('What is the capital of France?')
|
|
12
|
+
.message();
|
|
13
|
+
|
|
14
|
+
console.log(response);
|
|
15
|
+
|
|
16
|
+
} catch (error) {
|
|
17
|
+
console.error('Error:', error.message);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
main();
|
|
22
|
+
|
package/demo/minimax.js
CHANGED
package/index.js
CHANGED
|
@@ -261,10 +261,24 @@ class ModelMix {
|
|
|
261
261
|
return this.attach('MiniMax-M2', new MixMiniMax({ options, config }));
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
+
minimaxM21({ options = {}, config = {} } = {}) {
|
|
265
|
+
return this.attach('MiniMax-M2.1', new MixMiniMax({ options, config }));
|
|
266
|
+
}
|
|
267
|
+
|
|
264
268
|
minimaxM2Stable({ options = {}, config = {} } = {}) {
|
|
265
269
|
return this.attach('MiniMax-M2-Stable', new MixMiniMax({ options, config }));
|
|
266
270
|
}
|
|
267
271
|
|
|
272
|
+
deepseekV32({ options = {}, config = {}, mix = { fireworks: true } } = {}) {
|
|
273
|
+
if (mix.fireworks) this.attach('accounts/fireworks/models/deepseek-v3p2', new MixFireworks({ options, config }));
|
|
274
|
+
return this;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
GLM47({ options = {}, config = {}, mix = { fireworks: true } } = {}) {
|
|
278
|
+
if (mix.fireworks) this.attach('accounts/fireworks/models/glm-4p7', new MixFireworks({ options, config }));
|
|
279
|
+
return this;
|
|
280
|
+
}
|
|
281
|
+
|
|
268
282
|
addText(text, { role = "user" } = {}) {
|
|
269
283
|
const content = [{
|
|
270
284
|
type: "text",
|
|
@@ -1580,6 +1594,21 @@ class MixCerebras extends MixCustom {
|
|
|
1580
1594
|
}
|
|
1581
1595
|
}
|
|
1582
1596
|
|
|
1597
|
+
class MixFireworks extends MixCustom {
|
|
1598
|
+
getDefaultConfig(customConfig) {
|
|
1599
|
+
|
|
1600
|
+
if (!process.env.FIREWORKS_API_KEY) {
|
|
1601
|
+
throw new Error('Fireworks API key not found. Please provide it in config or set FIREWORKS_API_KEY environment variable.');
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
return super.getDefaultConfig({
|
|
1605
|
+
url: 'https://api.fireworks.ai/inference/v1/chat/completions',
|
|
1606
|
+
apiKey: process.env.FIREWORKS_API_KEY,
|
|
1607
|
+
...customConfig
|
|
1608
|
+
});
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1583
1612
|
class MixGoogle extends MixCustom {
|
|
1584
1613
|
getDefaultConfig(customConfig) {
|
|
1585
1614
|
return super.getDefaultConfig({
|
|
@@ -1771,4 +1800,4 @@ class MixGoogle extends MixCustom {
|
|
|
1771
1800
|
}
|
|
1772
1801
|
}
|
|
1773
1802
|
|
|
1774
|
-
module.exports = { MixCustom, ModelMix, MixAnthropic, MixMiniMax, MixOpenAI, MixPerplexity, MixOllama, MixLMStudio, MixGroq, MixTogether, MixGrok, MixCerebras, MixGoogle };
|
|
1803
|
+
module.exports = { MixCustom, ModelMix, MixAnthropic, MixMiniMax, MixOpenAI, MixPerplexity, MixOllama, MixLMStudio, MixGroq, MixTogether, MixGrok, MixCerebras, MixGoogle, MixFireworks };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "modelmix",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "🧬 ModelMix - Unified API for Diverse AI LLM.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -26,18 +26,17 @@
|
|
|
26
26
|
"opus",
|
|
27
27
|
"sonnet",
|
|
28
28
|
"multimodal",
|
|
29
|
-
"m2",
|
|
30
29
|
"gemini",
|
|
31
30
|
"ollama",
|
|
32
31
|
"lmstudio",
|
|
33
|
-
"nano",
|
|
34
32
|
"deepseek",
|
|
35
33
|
"oss",
|
|
36
34
|
"k2",
|
|
37
35
|
"reasoning",
|
|
38
36
|
"minimax",
|
|
39
|
-
"cerebras",
|
|
40
37
|
"thinking",
|
|
38
|
+
"fireworks",
|
|
39
|
+
"glm",
|
|
41
40
|
"clasen"
|
|
42
41
|
],
|
|
43
42
|
"author": "Martin Clasen",
|