modelmix 4.0.4 → 4.0.8

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
@@ -118,6 +118,7 @@ Here's a comprehensive list of available methods:
118
118
 
119
119
  | Method | Provider | Model | Price (I/O) per 1 M tokens |
120
120
  | ------------------ | ---------- | ------------------------------ | -------------------------- |
121
+ | `gpt52()` | OpenAI | gpt-5.2 | [\$1.75 / \$14.00][1] |
121
122
  | `gpt51()` | OpenAI | gpt-5.1 | [\$1.25 / \$10.00][1] |
122
123
  | `gpt5()` | OpenAI | gpt-5 | [\$1.25 / \$10.00][1] |
123
124
  | `gpt5mini()` | OpenAI | gpt-5-mini | [\$0.25 / \$2.00][1] |
@@ -125,7 +126,6 @@ Here's a comprehensive list of available methods:
125
126
  | `gpt41()` | OpenAI | gpt-4.1 | [\$2.00 / \$8.00][1] |
126
127
  | `gpt41mini()` | OpenAI | gpt-4.1-mini | [\$0.40 / \$1.60][1] |
127
128
  | `gpt41nano()` | OpenAI | gpt-4.1-nano | [\$0.10 / \$0.40][1] |
128
- | `o3()` | OpenAI | o3 | [\$10.00 / \$40.00][1] |
129
129
  | `gptOss()` | Together | gpt-oss-120B | [\$0.15 / \$0.60][7] |
130
130
  | `opus45[think]()` | Anthropic | claude-opus-4-5-20251101 | [\$5.00 / \$25.00][2] |
131
131
  | `opus41[think]()` | Anthropic | claude-opus-4-1-20250805 | [\$15.00 / \$75.00][2] |
@@ -133,9 +133,9 @@ Here's a comprehensive list of available methods:
133
133
  | `sonnet4[think]()` | Anthropic | claude-sonnet-4-20250514 | [\$3.00 / \$15.00][2] |
134
134
  | `haiku35()` | Anthropic | claude-3-5-haiku-20241022 | [\$0.80 / \$4.00][2] |
135
135
  | `haiku45[think]()` | Anthropic | claude-haiku-4-5-20251001 | [\$1.00 / \$5.00][2] |
136
- | `gemini25flash()` | Google | gemini-2.5-flash-preview-04-17 | [\$0.00 / \$0.00][3] |
137
- | `gemini25proExp()` | Google | gemini-2.5-pro-exp-03-25 | [\$0.00 / \$0.00][3] |
138
- | `gemini25pro()` | Google | gemini-2.5-pro-preview-05-06 | [\$2.50 / \$15.00][3] |
136
+ | `gemini3pro()` | Google | gemini-3-pro-preview | [\$2.00 / \$12.00][3] |
137
+ | `gemini25pro()` | Google | gemini-2.5-pro | [\$1.25 / \$10.00][3] |
138
+ | `gemini25flash()` | Google | gemini-2.5-flash | [\$0.30 / \$2.50][3] |
139
139
  | `grok3()` | Grok | grok-3 | [\$3.00 / \$15.00][6] |
140
140
  | `grok3mini()` | Grok | grok-3-mini | [\$0.30 / \$0.50][6] |
141
141
  | `grok4()` | Grok | grok-4-0709 | [\$3.00 / \$15.00][6] |
@@ -149,7 +149,7 @@ Here's a comprehensive list of available methods:
149
149
  | `kimiK2()` | Together | Kimi-K2-Instruct | [\$1.00 / \$3.00][7] |
150
150
  | `kimiK2think()` | Together | moonshotai/Kimi-K2-Thinking | [\$1.20 / \$4.00][7] |
151
151
 
152
- [1]: https://openai.com/api/pricing/ "Pricing | OpenAI"
152
+ [1]: https://platform.openai.com/docs/pricing "Pricing | OpenAI"
153
153
  [2]: https://docs.anthropic.com/en/docs/about-claude/pricing "Pricing - Anthropic"
154
154
  [3]: https://ai.google.dev/gemini-api/docs/pricing "Google AI for Developers"
155
155
  [4]: https://docs.perplexity.ai/guides/pricing "Pricing - Perplexity"
package/demo/demo.js CHANGED
@@ -1,4 +1,4 @@
1
- process.loadEnvFile();
1
+ import 'dotenv/config';
2
2
  import { ModelMix, MixOpenAI, MixAnthropic, MixPerplexity, MixOllama } from '../index.js';
3
3
 
4
4
 
@@ -7,7 +7,7 @@ const mmix = new ModelMix({
7
7
  temperature: 0.5,
8
8
  },
9
9
  config: {
10
- // system: 'You are {name} from Melmac.',
10
+ system: 'You are {name} from Melmac.',
11
11
  max_history: 2,
12
12
  bottleneck: { maxConcurrent: 1 },
13
13
  debug: true,
@@ -26,25 +26,24 @@ const pplxSettings = {
26
26
 
27
27
  mmix.replace({ '{name}': 'ALF' });
28
28
 
29
- console.log("\n" + '--------| gpt5nano() |--------');
30
- const gpt = mmix.gpt5nano({ options: { temperature: 0 } }).addText("Have you ever eaten a {animal}?");
29
+ console.log("\n" + '--------| gpt51() |--------');
30
+ const opt = {
31
+ config: {
32
+ temperature: 0,
33
+ reasoning: { effort: 'none' }
34
+ }
35
+ };
36
+ const gpt = mmix.gpt51(opt).addText("Have you ever eaten a {animal}?");
31
37
  gpt.replace({ '{animal}': 'cat' });
32
38
  console.log(await gpt.json({ time: '24:00:00', message: 'Hello' }, { time: 'Time in format HH:MM:SS' }));
33
39
 
34
- console.log("\n" + '--------| sonnet4() |--------');
35
- const claude = mmix.new({ config: { debug: true } }).sonnet4();
40
+ console.log("\n" + '--------| sonnet45() |--------');
41
+ const claude = mmix.new({ config: { debug: true } }).sonnet45();
36
42
  claude.addImageFromUrl('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFUlEQVR42mP8z8BQz0AEYBxVSF+FABJADveWkH6oAAAAAElFTkSuQmCC');
37
43
  claude.addText('in one word, which is the main color of the image?');
38
44
  const imageDescription = await claude.message();
39
45
  console.log(imageDescription);
40
46
 
41
- console.log("\n" + '--------| claude-3-7-sonnet-20250219 |--------');
42
- const writer = ModelMix.new().attach('claude-3-7-sonnet-20250219', new MixAnthropic());
43
- writer.setSystem('You are a writer like Stephen King');
44
- writer.replaceKeyFromFile('{story_title}', './title.md');
45
- const story = await writer.addTextFromFile('./prompt.md').message();
46
- console.log(story);
47
-
48
47
  console.log("\n" + '--------| sonar |--------');
49
48
  const pplx = ModelMix.new().sonar(pplxSettings);
50
49
  pplx.addText('How much is ETH trading in USD?');
package/demo/package.json CHANGED
@@ -11,6 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@anthropic-ai/sdk": "^0.20.9",
14
+ "dotenv": "^17.2.3",
14
15
  "lemonlog": "^1.1.4"
15
16
  }
16
17
  }
package/index.js CHANGED
@@ -102,7 +102,13 @@ class ModelMix {
102
102
  }
103
103
  gpt51({ options = {}, config = {} } = {}) {
104
104
  return this.attach('gpt-5.1', new MixOpenAI({ options, config }));
105
- }
105
+ }
106
+ gpt52({ options = {}, config = {} } = {}) {
107
+ return this.attach('gpt-5.2', new MixOpenAI({ options, config }));
108
+ }
109
+ gpt52chat({ options = {}, config = {} } = {}) {
110
+ return this.attach('gpt-5.2-chat-latest', new MixOpenAI({ options, config }));
111
+ }
106
112
  gptOss({ options = {}, config = {}, mix = { together: false, cerebras: false, groq: true } } = {}) {
107
113
  if (mix.together) return this.attach('openai/gpt-oss-120b', new MixTogether({ options, config }));
108
114
  if (mix.cerebras) return this.attach('gpt-oss-120b', new MixCerebras({ options, config }));
@@ -159,12 +165,6 @@ class ModelMix {
159
165
  gemini25pro({ options = {}, config = {} } = {}) {
160
166
  return this.attach('gemini-2.5-pro', new MixGoogle({ options, config }));
161
167
  }
162
- gemini25proExp({ options = {}, config = {} } = {}) {
163
- return this.attach('gemini-2.5-pro-exp-03-25', new MixGoogle({ options, config }));
164
- }
165
- gemini25pro({ options = {}, config = {} } = {}) {
166
- return this.attach('gemini-2.5-pro-preview-05-06', new MixGoogle({ options, config }));
167
- }
168
168
  sonarPro({ options = {}, config = {} } = {}) {
169
169
  return this.attach('sonar-pro', new MixPerplexity({ options, config }));
170
170
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "modelmix",
3
- "version": "4.0.4",
3
+ "version": "4.0.8",
4
4
  "description": "🧬 ModelMix - Unified API for Diverse AI LLM.",
5
5
  "main": "index.js",
6
6
  "repository": {