Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ Two rules govern this file, and both are load-bearing:
1. **These are weak priors, never task-quality labels.** They inform the `speed` and `reliability` terms only. A model is not "better" because it is fast.
2. **Historical numbers are never presented as a current provider SLA.** Hosts are expected to inject fresher observations (see below); the committed snapshot exists so the engine is safe and useful when a catalog is temporarily unavailable.

The repository ships 69 live performance profiles (three samples per model), 9 auditable historical seeds, 84 function-calling probe results, and a built-in snapshot of the 97 text models in the public catalog (2026-11-24 sync). Eleven newly listed models passed a real structured tool-call probe and are admitted as availability fallbacks for tool-required turns. DeepSeek V4 Flash Vision Experimental and Qwen 3.8 Flash did not return a valid tool call and remain fail-closed. GPT-6.1 Sol and DeepSeek V4.1 Flash also passed a structured tool-call probe in the subsequent capability refresh. Gemini 4 Carbon, added 2026-11-11 ahead of its gateway listing, returned its own next tool call through a two-round tool history on both the streaming and non-streaming gateway paths, so it is admitted as a tool fallback too. Kimi K3.1 Pro, which replaced Kimi K3 in every chain and affinity band on 2026-11-23, passed the live profile probe (three completions, no errors, a well-formed tool call); its reasoningMath affinity is measured on K3.1 Pro (paired against K3 on 50 MGSM rows on 2026-11-23: 41/50 vs 44/50 at a 512-token budget, every gap a truncation, 46/50 each when the truncated rows were rerun at 2,048 tokens), and it moves from 0.9 to 0.88. Its other affinity values are still carried over from K3, not measured on K3.1 Pro. On 2026-11-24 Gemini 3.6 Flash replaced Gemini 3.5 Flash, and GPT-5.4 Mini replaced o4-mini, in every chain and affinity band, when the gateways began redirecting the retired ids to them; 3.6 Flash's affinity values are carried over from 3.5 Flash (which Google had been answering with 3.6 since October), not measured on 3.6. On 2026-12-01 Gemini 3.5 Flash-Lite replaces Gemini 2.5 Flash, and Gemini 3.8 Flash replaces Gemini 2.5 Pro, the same way; 3.5 Flash-Lite's extraction and chat affinity is carried over from 2.5 Flash. Mistral Large 4, Gemini 4 Argon, Hydrogen and Neon, Claude Fable 5.2, and GPT-6.2 Astra and Sol have no probe evidence yet. A model with no probe evidence can serve plain chat but never a tool-required turn.
The repository ships 69 live performance profiles (three samples per model), 9 auditable historical seeds, 84 function-calling probe results, and a built-in snapshot of the 97 text models in the public catalog (2026-11-24 sync). Eleven newly listed models passed a real structured tool-call probe and are admitted as availability fallbacks for tool-required turns. DeepSeek V4 Flash Vision Experimental and Qwen 3.8 Flash did not return a valid tool call and remain fail-closed. GPT-6.1 Sol and DeepSeek V4.1 Flash also passed a structured tool-call probe in the subsequent capability refresh. Gemini 4 Carbon, added 2026-11-11 ahead of its gateway listing, returned its own next tool call through a two-round tool history on both the streaming and non-streaming gateway paths, so it is admitted as a tool fallback too. Kimi K3.1 Pro, which replaced Kimi K3 in every chain and affinity band on 2026-11-23, passed the live profile probe (three completions, no errors, a well-formed tool call); its reasoningMath affinity is measured on K3.1 Pro (paired against K3 on 50 MGSM rows on 2026-11-23: 41/50 vs 44/50 at a 512-token budget, every gap a truncation, 46/50 each when the truncated rows were rerun at 2,048 tokens), and it moves from 0.9 to 0.88. Its other affinity values are still carried over from K3, not measured on K3.1 Pro. On 2026-11-24 Gemini 3.6 Flash replaced Gemini 3.5 Flash, and GPT-5.4 Mini replaced o4-mini, in every chain and affinity band, when the gateways began redirecting the retired ids to them; 3.6 Flash's affinity values are carried over from 3.5 Flash (which Google had been answering with 3.6 since October), not measured on 3.6. On 2026-12-01 Gemini 3.5 Flash-Lite replaces Gemini 2.5 Flash, and Gemini 3.8 Flash replaces Gemini 2.5 Pro, the same way; 3.5 Flash-Lite's extraction and chat affinity is carried over from 2.5 Flash. On 2026-12-11, when OpenAI shuts down o3, GPT-5 Mini and GPT-5 Nano, GPT-5.4 Mini replaces o3 (whose two rungs sat directly behind it and are dropped) and GPT-5.6 Luna replaces GPT-5 Mini, including as the agentic MEDIUM primary; Luna's terminal, tool-agent and web-research affinity is carried over from GPT-5 Mini, a reasoning model, not measured on Luna, which runs without reasoning. Mistral Large 4, Gemini 4 Argon, Hydrogen and Neon, Claude Fable 5.2, and GPT-6.2 Astra and Sol have no probe evidence yet. A model with no probe evidence can serve plain chat but never a tool-required turn.

Passing the function-call probe does **not** promote a model to primary. New tool-capable models are appended after the configured and trajectory-benchmarked candidate chains with neutral task affinity; they can recover an unavailable route immediately (cheapest first outside Premium), while primary promotion still requires an end-to-end agent evaluation.

Expand Down Expand Up @@ -431,7 +431,7 @@ Omitted entries fall back to a weak historical prior rather than disqualifying a
```bash
npm ci
npm run typecheck # tsc --noEmit
npm test # vitest — 196 tests across 12 files
npm test # vitest — 198 tests across 12 files
npm run build # tsup → dist/
npm run check # all three, and what CI runs

Expand Down
77 changes: 45 additions & 32 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

29 changes: 22 additions & 7 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,21 @@ export const DEFAULT_ROUTING_CONFIG: RoutingConfig = {
// redirected model that would drop the image.
// - google/gemini-2.5-pro -> google/gemini-3.8-flash ($0.75/$3.75), in
// place.
//
// Retirements 2026-12-11 (OpenAI shuts down o3, gpt-5-mini and gpt-5-nano —
// developers.openai.com/api/docs/deprecations, notice 2026-06-11; the
// gateways redirect each and quote the successor):
// - openai/o3 -> openai/gpt-5.4-mini ($2/$8 -> $0.75/$4.50). Both o3 rungs
// (auto and premium REASONING) sat directly behind gpt-5.4-mini, so they
// are dropped by the dedupe rule; the order actually served is unchanged.
// - openai/gpt-5-mini -> openai/gpt-5.6-luna ($0.25/$2 -> $0.20/$1.20), in
// place as the agentic MEDIUM primary. Luna inherits gpt-5-mini's
// affinity values, CARRIED, not measured (portfolio.ts) — gpt-5-mini is a
// reasoning model and luna runs without reasoning, so those values are a
// placeholder until a Terminal-Bench/tau2 run on luna.
// - openai/gpt-5-nano is NOT redirected (owner decision 2026-11-24): the
// gateways keep serving it from Azure at its own $0.05/$0.40 until
// 2027-02-09. It is hidden and in no chain, and none is added.

// Auto (balanced) tier configs - current default smart routing
tiers: {
Expand Down Expand Up @@ -1176,8 +1191,7 @@ export const DEFAULT_ROUTING_CONFIG: RoutingConfig = {
"xai/grok-4.3", // $1.50/$4, 1M ctx — xAI reasoning model, vision
"qwen/qwen3.7-plus", // $0.32/$1.28, 1M ctx — reasoning; needs a generous max_tokens (thinking is billed)
"google/gemini-3.6-flash", // $0.75/$3.75 — 3.5 Flash's successor (MGSM 5/5 on 3.5, carried)
"openai/gpt-5.4-mini", // $0.75/$4.50 — o4-mini's successor (o4-mini retired 2026-11-24)
"openai/o3", // $2/$8
"openai/gpt-5.4-mini", // $0.75/$4.50 — o4-mini's and o3's successor (retired 2026-11-24 and 2026-12-11; o3 was the next rung)
],
},
},
Expand Down Expand Up @@ -1306,8 +1320,7 @@ export const DEFAULT_ROUTING_CONFIG: RoutingConfig = {
"xai/grok-4.5", // reasoning band 0.94
"deepseek/deepseek-v4-pro", // reasoning band 0.95
"xai/grok-4.3", // $1.50/$4 — xAI reasoning model
"openai/gpt-5.4-mini", // $0.75/$4.50 — o4-mini's successor (o4-mini retired 2026-11-24)
"openai/o3", // $2/$8
"openai/gpt-5.4-mini", // $0.75/$4.50 — o4-mini's and o3's successor (retired 2026-11-24 and 2026-12-11; o3 was the next rung)
],
},
},
Expand All @@ -1324,9 +1337,11 @@ export const DEFAULT_ROUTING_CONFIG: RoutingConfig = {
],
},
MEDIUM: {
// Was moonshot/kimi-k2.7 (hidden 2026-08). GPT-5 Mini carries the
// Terminal-Bench and tau2 trajectory evidence in portfolio.ts.
primary: "openai/gpt-5-mini", // $0.25/$2 — 4/7 Terminal-Bench, 5/6 tau2 airline
// Was moonshot/kimi-k2.7 (hidden 2026-08), then GPT-5 Mini — which
// carries the Terminal-Bench and tau2 trajectory evidence in
// portfolio.ts — until its 2026-12-11 retirement. GPT-5.6 Luna is what
// the gateways serve under that name from then on.
primary: "openai/gpt-5.6-luna", // $0.20/$1.20, 1M ctx, vision + tools — gpt-5-mini's affinity (4/7 Terminal-Bench, 5/6 tau2 airline), carried
fallback: [
"google/gemini-3.6-flash", // $0.75/$3.75 — tool_agent band 0.88 (3.5's, carried)
"zai/glm-5.3-flash", // $0.15/$0.50 — tools verified
Expand Down
Loading
Loading