modelmix 4.4.7 → 4.4.11

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
@@ -42,7 +42,7 @@ For environment variables, use `dotenv` or Node's built-in `process.loadEnvFile(
42
42
  3. **Create and configure your models**:
43
43
 
44
44
  ```javascript
45
- import 'dotenv/config';
45
+ process.loadEnvFile();
46
46
  import { ModelMix } from 'modelmix';
47
47
 
48
48
  // Get structured JSON responses
package/demo/custom.js CHANGED
@@ -1,4 +1,4 @@
1
- import 'dotenv/config'
1
+ process.loadEnvFile();
2
2
 
3
3
  import { ModelMix, MixCustom } from '../index.js';
4
4
 
package/demo/demo.js CHANGED
@@ -1,7 +1,6 @@
1
- import 'dotenv/config';
1
+ process.loadEnvFile();
2
2
  import { ModelMix } from '../index.js';
3
3
 
4
-
5
4
  const mmix = new ModelMix({
6
5
  options: {
7
6
  temperature: 0.5,
@@ -14,7 +13,6 @@ const mmix = new ModelMix({
14
13
  }
15
14
  });
16
15
 
17
-
18
16
  const pplxSettings = {
19
17
  config: {
20
18
  apiKey: process.env.PPLX_API_KEY,
package/demo/fallback.js CHANGED
@@ -1,6 +1,7 @@
1
- import { ModelMix, MixOpenAI, MixAnthropic, MixGrok } from '../index.js';
2
- import dotenv from 'dotenv';
3
- dotenv.config();
1
+ import { ModelMix } from '../index.js';
2
+
3
+ process.loadEnvFile();
4
+
4
5
 
5
6
  const mmix = new ModelMix({
6
7
  config: {
package/demo/parallel.js CHANGED
@@ -1,5 +1,6 @@
1
- import 'dotenv/config';
2
- import { ModelMix, MixOpenAI } from '../index.js';
1
+ import { ModelMix } from '../index.js';
2
+
3
+ process.loadEnvFile();
3
4
 
4
5
  const mix = new ModelMix({
5
6
  options: {
package/demo/stream.js CHANGED
@@ -1,4 +1,4 @@
1
- import 'dotenv/config'
1
+ process.loadEnvFile();
2
2
  import { ModelMix } from '../index.js';
3
3
 
4
4
  await ModelMix.new().gpt41nano()
package/demo/together.js CHANGED
@@ -1,4 +1,5 @@
1
- import 'dotenv/config'
1
+ process.loadEnvFile();
2
+
2
3
  import { ModelMix, MixTogether } from '../index.js';
3
4
 
4
5
  const setup = { config: { system: "You are ALF from Melmac." } };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "modelmix",
3
- "version": "4.4.7",
3
+ "version": "4.4.11",
4
4
  "description": "🧬 Reliable interface with automatic fallback for AI LLMs.",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -48,7 +48,7 @@
48
48
  "homepage": "https://github.com/clasen/ModelMix#readme",
49
49
  "dependencies": {
50
50
  "@modelcontextprotocol/sdk": "^1.26.0",
51
- "axios": "^1.12.2",
51
+ "axios": "^1.13.5",
52
52
  "bottleneck": "^2.19.5",
53
53
  "file-type": "^16.5.4",
54
54
  "form-data": "^4.0.4",
@@ -56,21 +56,20 @@
56
56
  },
57
57
  "devDependencies": {
58
58
  "chai": "^5.2.1",
59
- "dotenv": "^17.2.1",
60
59
  "mocha": "^11.3.0",
61
60
  "nock": "^14.0.9",
62
61
  "sinon": "^21.0.0"
63
62
  },
64
63
  "scripts": {
65
- "test": "mocha test/**/*.js --timeout 10000 --require dotenv/config --require test/setup.js",
64
+ "test": "mocha test/**/*.js --timeout 10000 --require test/setup.js",
66
65
  "test:watch": "mocha test/**/*.js --watch --timeout 10000 --require test/setup.js",
67
66
  "test:json": "mocha test/json.test.js --timeout 10000 --require test/setup.js",
68
67
  "test:fallback": "mocha test/fallback.test.js --timeout 10000 --require test/setup.js",
69
68
  "test:templates": "mocha test/templates.test.js --timeout 10000 --require test/setup.js",
70
69
  "test:images": "mocha test/images.test.js --timeout 10000 --require test/setup.js",
71
70
  "test:bottleneck": "mocha test/bottleneck.test.js --timeout 10000 --require test/setup.js",
72
- "test:live": "mocha test/live.test.js --timeout 10000 --require dotenv/config --require test/setup.js",
73
- "test:live.mcp": "mocha test/live.mcp.js --timeout 60000 --require dotenv/config --require test/setup.js",
74
- "test:tokens": "mocha test/tokens.test.js --timeout 10000 --require dotenv/config --require test/setup.js"
71
+ "test:live": "mocha test/live.test.js --timeout 10000 --require test/setup.js",
72
+ "test:live.mcp": "mocha test/live.mcp.js --timeout 60000 --require test/setup.js",
73
+ "test:tokens": "mocha test/tokens.test.js --timeout 10000 --require test/setup.js"
75
74
  }
76
75
  }
package/test/setup.js CHANGED
@@ -5,6 +5,9 @@
5
5
  * It runs before each test suite and sets up the testing environment.
6
6
  */
7
7
 
8
+ // Load .env file if present (native Node.js, no dotenv dependency required)
9
+ try { process.loadEnvFile(); } catch {}
10
+
8
11
  // Set dummy environment variables for testing to prevent library errors
9
12
 
10
13
  const chai = require('chai');