modelmix 5.0.6 → 5.1.2
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 +88 -112
- package/RLM_PLUGIN_SPEC.md +2 -2
- package/demo/fallback.js +2 -2
- package/demo/free.js +2 -3
- package/demo/gemini.js +2 -2
- package/demo/json.js +2 -2
- package/demo/mcp-simple.js +2 -2
- package/demo/mcp-tools.js +6 -6
- package/demo/mcp.js +1 -1
- package/demo/parallel-strategy.js +3 -3
- package/demo/parallel.js +2 -2
- package/demo/repl-powers.js +2 -3
- package/demo/rlm-basic.js +2 -2
- package/demo/rlm-fast.js +3 -3
- package/demo/rlm-simple.js +3 -3
- package/demo/short.js +1 -1
- package/demo/stream.js +1 -1
- package/demo/tokens.js +1 -1
- package/demo/verbose.js +5 -5
- package/effort.js +9 -3
- package/index.d.ts +0 -8
- package/index.js +499 -2861
- package/lib/content-cache.js +31 -0
- package/lib/model-chain.js +51 -0
- package/lib/object-utils.js +7 -0
- package/lib/provider-debug.js +23 -0
- package/lib/providers/anthropic.js +337 -0
- package/lib/providers/base.js +409 -0
- package/lib/providers/google.js +293 -0
- package/lib/providers/openai-compatible.js +338 -0
- package/lib/providers/openai.js +622 -0
- package/lib/providers.js +26 -0
- package/lib/template-engine.js +168 -0
- package/lib/token-usage.js +299 -0
- package/package.json +1 -1
- package/skills/modelmix/SKILL.md +10 -10
- package/test/effort.test.js +36 -0
- package/test/fallback.test.js +15 -3
- package/test/history.test.js +1 -1
- package/test/model-chain.test.js +12 -0
- package/test/moderation.test.js +1 -1
- package/test/public-api.test.js +54 -0
- package/test/tokens.test.js +20 -0
package/effort.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
const OPENAI_LEVELS = ['none', 'low', 'medium', 'high', 'xhigh'];
|
|
10
|
+
const OPENAI_LEVEL_LADDER = [...OPENAI_LEVELS, 'max'];
|
|
10
11
|
const ANTHROPIC_LEVELS = ['low', 'medium', 'high', 'xhigh', 'max'];
|
|
11
12
|
const GEMINI_LEVELS = ['minimal', 'low', 'medium', 'high'];
|
|
12
13
|
|
|
@@ -35,6 +36,9 @@ const GEMINI_BANDS = [
|
|
|
35
36
|
|
|
36
37
|
/** Exact model → supported OpenAI reasoning_effort values */
|
|
37
38
|
const OPENAI_MODEL_LEVELS = {
|
|
39
|
+
'gpt-5.6-sol': ['none', 'low', 'medium', 'high', 'xhigh', 'max'],
|
|
40
|
+
'gpt-5.6-terra': ['none', 'low', 'medium', 'high', 'xhigh', 'max'],
|
|
41
|
+
'gpt-5.6-luna': ['none', 'low', 'medium', 'high', 'xhigh', 'max'],
|
|
38
42
|
'accounts/fireworks/models/qwen3p8-2p4t-a95b': ['none', 'low', 'medium', 'high'],
|
|
39
43
|
'grok-4.6': ['low', 'medium', 'high', 'xhigh'],
|
|
40
44
|
'gpt-5': ['minimal', 'low', 'medium', 'high'],
|
|
@@ -43,7 +47,6 @@ const OPENAI_MODEL_LEVELS = {
|
|
|
43
47
|
'gpt-5.3-codex': ['low', 'medium', 'high', 'xhigh'],
|
|
44
48
|
'gpt-oss-120b': ['low', 'medium', 'high'],
|
|
45
49
|
'openai/gpt-oss-120b': ['low', 'medium', 'high'],
|
|
46
|
-
'openai/gpt-oss-120b:free': ['low', 'medium', 'high'],
|
|
47
50
|
};
|
|
48
51
|
|
|
49
52
|
/**
|
|
@@ -373,8 +376,11 @@ function mapEffort(providerFamily, effort, modelKey) {
|
|
|
373
376
|
if (modelKey === GROK420_NON_REASONING) {
|
|
374
377
|
return null;
|
|
375
378
|
}
|
|
376
|
-
const
|
|
377
|
-
const
|
|
379
|
+
const supported = supportedOpenAILevels(modelKey);
|
|
380
|
+
const desired = normalized === 100 && supported.includes('max')
|
|
381
|
+
? 'max'
|
|
382
|
+
: levelFromBands(normalized, OPENAI_BANDS);
|
|
383
|
+
const level = pickNearestLevel(desired, OPENAI_LEVEL_LADDER, supported);
|
|
378
384
|
return { reasoning_effort: level };
|
|
379
385
|
}
|
|
380
386
|
|
package/index.d.ts
CHANGED
|
@@ -441,9 +441,6 @@ export declare class ModelMix {
|
|
|
441
441
|
attach(key: string, provider: MixCustom): this;
|
|
442
442
|
|
|
443
443
|
// OpenAI
|
|
444
|
-
gpt41(args?: ModelAttachArgs): this;
|
|
445
|
-
gpt41mini(args?: ModelAttachArgs): this;
|
|
446
|
-
gpt41nano(args?: ModelAttachArgs): this;
|
|
447
444
|
gpt5(args?: ModelAttachArgs): this;
|
|
448
445
|
gpt5mini(args?: ModelAttachArgs): this;
|
|
449
446
|
gpt5nano(args?: ModelAttachArgs): this;
|
|
@@ -479,16 +476,12 @@ export declare class ModelMix {
|
|
|
479
476
|
haiku45(args?: ModelAttachArgs): this;
|
|
480
477
|
|
|
481
478
|
// Google
|
|
482
|
-
gemini25flash(args?: ModelAttachArgs): this;
|
|
483
479
|
gemini31pro(args?: ModelAttachArgs): this;
|
|
484
|
-
gemini3pro(args?: ModelAttachArgs): this;
|
|
485
|
-
gemini3flash(args?: ModelAttachArgs): this;
|
|
486
480
|
gemini37flash(args?: ModelAttachArgs): this;
|
|
487
481
|
gemini36flash(args?: ModelAttachArgs): this;
|
|
488
482
|
gemini35flash(args?: ModelAttachArgs): this;
|
|
489
483
|
gemini35flashLite(args?: ModelAttachArgs): this;
|
|
490
484
|
gemini31flashLite(args?: ModelAttachArgs): this;
|
|
491
|
-
gemini25pro(args?: ModelAttachArgs): this;
|
|
492
485
|
|
|
493
486
|
// Perplexity
|
|
494
487
|
sonarPro(args?: ModelAttachArgs): this;
|
|
@@ -516,7 +509,6 @@ export declare class ModelMix {
|
|
|
516
509
|
kimiK3(args?: ModelAttachArgs): this;
|
|
517
510
|
kimiK25(args?: ModelAttachArgs): this;
|
|
518
511
|
lmstudio(model?: string, args?: ModelAttachArgs): this;
|
|
519
|
-
minimaxM25(args?: ModelAttachArgs): this;
|
|
520
512
|
minimaxM27(args?: ModelAttachArgs): this;
|
|
521
513
|
minimaxM3(args?: ModelAttachArgs): this;
|
|
522
514
|
mimo25(args?: ModelAttachArgs): this;
|