modelmix 4.0.6 → 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] |
@@ -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 }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "modelmix",
3
- "version": "4.0.6",
3
+ "version": "4.0.8",
4
4
  "description": "🧬 ModelMix - Unified API for Diverse AI LLM.",
5
5
  "main": "index.js",
6
6
  "repository": {