modelmix 4.1.8 → 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 CHANGED
@@ -139,6 +139,8 @@ Here's a comprehensive list of available methods:
139
139
  | `gemini25flash()` | Google | gemini-2.5-flash | [\$0.30 / \$2.50][3] |
140
140
  | `grok4()` | Grok | grok-4-0709 | [\$3.00 / \$15.00][6] |
141
141
  | `grok41[think]()` | Grok | grok-4-1-fast | [\$0.20 / \$0.50][6] |
142
+ | `deepseekV32()` | Fireworks | fireworks/models/deepseek-v3p2 | [\$0.56 / \$1.68][10] |
143
+ | `GLM47()` | Fireworks | fireworks/models/glm-4p7 | [\$0.55 / \$2.19][10] |
142
144
  | `minimaxM21()` | MiniMax | MiniMax-M2.1 | [\$0.30 / \$1.20][9] |
143
145
  | `sonar()` | Perplexity | sonar | [\$1.00 / \$1.00][4] |
144
146
  | `sonarPro()` | Perplexity | sonar-pro | [\$3.00 / \$15.00][4] |
@@ -158,6 +160,7 @@ Here's a comprehensive list of available methods:
158
160
  [7]: https://www.together.ai/pricing "Together AI"
159
161
  [8]: https://lambda.ai/inference "Lambda Pricing"
160
162
  [9]: https://www.minimax.io/price "MiniMax Pricing"
163
+ [10]: https://fireworks.ai/pricing#serverless-pricing "Fireworks Pricing"
161
164
 
162
165
  Each method accepts optional `options` and `config` parameters to customize the model's behavior. For example:
163
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/index.js CHANGED
@@ -269,6 +269,16 @@ class ModelMix {
269
269
  return this.attach('MiniMax-M2-Stable', new MixMiniMax({ options, config }));
270
270
  }
271
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
+
272
282
  addText(text, { role = "user" } = {}) {
273
283
  const content = [{
274
284
  type: "text",
@@ -1584,6 +1594,21 @@ class MixCerebras extends MixCustom {
1584
1594
  }
1585
1595
  }
1586
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
+
1587
1612
  class MixGoogle extends MixCustom {
1588
1613
  getDefaultConfig(customConfig) {
1589
1614
  return super.getDefaultConfig({
@@ -1775,4 +1800,4 @@ class MixGoogle extends MixCustom {
1775
1800
  }
1776
1801
  }
1777
1802
 
1778
- 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.1.8",
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",