@alexeiled/claude-router 1.18.0 → 1.19.0
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/.claude-plugin/plugin.json +2 -2
- package/CHANGELOG.md +22 -0
- package/README.md +3 -0
- package/docs/configuration.md +15 -4
- package/docs/evaluation.md +4 -0
- package/docs/provider-experiments.md +141 -0
- package/docs/providers.md +83 -5
- package/docs/routing-modes.md +3 -1
- package/lib/modes.mjs +3 -16
- package/lib/providers.mjs +88 -0
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "router",
|
|
3
3
|
"displayName": "Router",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"description": "Native model and effort routing within your provider. Anthropic, DeepSeek
|
|
4
|
+
"version": "1.19.0",
|
|
5
|
+
"description": "Native model and effort routing within your provider. Anthropic, DeepSeek, z.ai, MiniMax, MiMo and Kimi defaults, custom provider profiles, classifier advice and one model per subagent.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Alexei Ledenev",
|
|
8
8
|
"url": "https://github.com/alexei-led"
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.19.0 (2026-10-31)
|
|
4
|
+
|
|
5
|
+
MiniMax, MiMo and Kimi gain built-in provider profiles alongside DeepSeek and z.ai.
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `minimax` defaults use MiniMax-M3.1-Flash with low, medium, high and max effort. Legacy M3 ignores effort and is not used as a deeper tier.
|
|
10
|
+
- `mimo` defaults combine MiMo-V2.6-Flash and Pro. The router selects models without claiming undocumented effort levels; provider-default thinking stays on.
|
|
11
|
+
- `kimi` defaults use Kimi-K3.1-Pro throughout the conversation, with low, high and max effort. They do not mix K2/K3 thinking histories.
|
|
12
|
+
- Each profile includes activity and subagent routes, image/context metadata, API list prices and conservative cache accounting. [Provider tables](docs/providers.md#new-provider-modes) show every cost, balanced and quality combination.
|
|
13
|
+
- [Research and experiments](docs/provider-experiments.md) record synthetic activity checks and native streaming tools. MiMo Flash's two format failures remain visible; no measured quality or savings guarantee is claimed.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Cost mode skips unsupported effort levels when stepping down, rather than projecting back to the current level. Sparse ladders such as DeepSeek, z.ai and Kimi can now move max → high → low.
|
|
18
|
+
|
|
19
|
+
### Upgrade
|
|
20
|
+
|
|
21
|
+
- After upgrading, create `minimax-router.json`, `mimo-router.json` or `kimi-router.json` containing `{}` in the active Claude Code profile, then set `CLAUDE_ROUTER_PROVIDER` before launch. Missing or invalid files keep the native model unchanged.
|
|
22
|
+
- Start a fresh conversation when moving from another Kimi model to K3.1. Do not resume old model-specific thinking/tool history into it. Remove a fixed `CLAUDE_CODE_EFFORT_LEVEL` override to allow per-turn effort routing.
|
|
23
|
+
- Existing Anthropic users need no configuration change. Endpoint credentials and billing remain Claude Code's responsibility.
|
|
24
|
+
|
|
3
25
|
## 1.18.0 (2026-10-30)
|
|
4
26
|
|
|
5
27
|
The band and the pane now show one session cost readout: the same number, the same words, at the same moment.
|
package/README.md
CHANGED
|
@@ -23,6 +23,9 @@ With `CLAUDE_CONFIG_DIR`, put the file in that directory instead.
|
|
|
23
23
|
| Anthropic, the default | `router.json` | Haiku 5.5, Sonnet 5.5, Opus 5.5 |
|
|
24
24
|
| `deepseek` | `deepseek-router.json` | DeepSeek Flash, routed by effort |
|
|
25
25
|
| `zai` | `zai-router.json` | GLM-5.3-Flash and GLM-5.3 |
|
|
26
|
+
| `minimax` | `minimax-router.json` | MiniMax-M3.1-Flash, routed by effort |
|
|
27
|
+
| `mimo` | `mimo-router.json` | MiMo-V2.6-Flash and MiMo-V2.6-Pro, no routed effort |
|
|
28
|
+
| `kimi` | `kimi-router.json` | Kimi-K3.1-Pro, routed by effort |
|
|
26
29
|
|
|
27
30
|
OpenRouter, Ollama, other local servers and other compatible hosted providers use custom `<provider>-router.json` files.
|
|
28
31
|
They have no built-in model defaults. A selected file must exist and validate, or the router leaves Claude Code's model unchanged.
|
package/docs/configuration.md
CHANGED
|
@@ -39,18 +39,24 @@ A non-Anthropic file must exist and validate. It never falls back to `router.jso
|
|
|
39
39
|
|
|
40
40
|
### Provider prices
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
All non-Anthropic built-in model windows are at least 1M tokens.
|
|
43
43
|
Price estimates use the [DeepSeek peak API rates](https://api-docs.deepseek.com/quick_start/pricing) and [z.ai API list rates](https://docs.z.ai/guides/overview/pricing.md).
|
|
44
|
-
|
|
44
|
+
DeepSeek and z.ai rates were checked on 2026-10-28; the new provider rates on 2026-10-31.
|
|
45
45
|
|
|
46
46
|
| Model | Input / output / cached input, USD per million tokens |
|
|
47
47
|
| --- | --- |
|
|
48
48
|
| DeepSeek Flash | 0.30 / 1.20 / 0.006 |
|
|
49
49
|
| GLM-5.3-Flash | 0.15 / 0.50 / 0.03 |
|
|
50
50
|
| GLM-5.3 | 1.40 / 4.40 / 0.26 |
|
|
51
|
+
| MiniMax-M3.1-Flash | 0.15 / 0.60 / 0.015 |
|
|
52
|
+
| MiMo-V2.6-Flash | 0.14 / 0.28 / 0.0028 |
|
|
53
|
+
| MiMo-V2.6-Pro | 0.435 / 0.87 / 0.0036 |
|
|
54
|
+
| Kimi-K3.1-Pro | 2.00 / 10.00 / 0.20 |
|
|
51
55
|
|
|
52
56
|
These are fixed estimate inputs, not an invoice. DeepSeek off-peak rates differ, and z.ai plan quota uses its own multipliers.
|
|
53
|
-
|
|
57
|
+
New provider sources: [MiniMax pricing](https://platform.minimax.io/docs/pricing/overview),
|
|
58
|
+
[MiMo pricing](https://mimo.mi.com/docs/en-US/pricing), and [Kimi pricing](https://platform.kimi.ai/docs/pricing/chat).
|
|
59
|
+
All non-Anthropic built-in presets use `billing: "credits"`.
|
|
54
60
|
For an included-plan model, set `billing: "plan"` to disable the cold-input cash cap.
|
|
55
61
|
A provider name or URL does not establish its billing product.
|
|
56
62
|
|
|
@@ -61,7 +67,7 @@ A provider name or URL does not establish its billing product.
|
|
|
61
67
|
| Mode | Use | Estimate |
|
|
62
68
|
| --- | --- | --- |
|
|
63
69
|
| `explicit` | Anthropic default | Configured write multipliers and TTLs |
|
|
64
|
-
| `automatic` |
|
|
70
|
+
| `automatic` | All other built-in profiles and custom-profile default | Reported hit/miss input rates, no separate write premium |
|
|
65
71
|
| `disabled` | No cache discount to model | All input at the uncached rate, never marked warm |
|
|
66
72
|
|
|
67
73
|
Automatic-cache bounds allow a future hit or a full miss, including after an observed miss.
|
|
@@ -83,6 +89,11 @@ An unknown cache state is not proof of a miss.
|
|
|
83
89
|
|
|
84
90
|
[DeepSeek caching](https://api-docs.deepseek.com/guides/kv_cache) is automatic and best-effort. Its Anthropic endpoint ignores explicit cache controls.
|
|
85
91
|
[z.ai caching](https://docs.z.ai/guides/capabilities/cache.md) has no verified model-specific TTL.
|
|
92
|
+
MiniMax and MiMo expose automatic prefix caching; no retention guarantee is assumed here.
|
|
93
|
+
Kimi's default five-minute cache fills cost the ordinary input rate; the preset does not select top-level one-hour
|
|
94
|
+
cache control, whose writes cost twice as much. Its observed default fills/reads are priced, but TTL is not used
|
|
95
|
+
to promise future hits. A custom client that selects one-hour Kimi caching must configure its write premium.
|
|
96
|
+
MiMo's currently free cache-write promotion is not treated as free cold input.
|
|
86
97
|
Claude Code's `DISABLE_PROMPT_CACHING` does not establish whether an automatic server cache is disabled.
|
|
87
98
|
|
|
88
99
|
Valid observed usage can still be priced for activity statistics.
|
package/docs/evaluation.md
CHANGED
|
@@ -21,6 +21,10 @@ Terminal engineering and SRE results differ. Neither GLM model leads every activ
|
|
|
21
21
|
Measured max-effort results do not establish low/high performance or an optimal routing matrix.
|
|
22
22
|
The original DeepSeek benchmark profile does not establish the quality of its newer hosted 1017 snapshot.
|
|
23
23
|
|
|
24
|
+
MiniMax, MiMo and Kimi have [separate sourced research and live checks](provider-experiments.md), including
|
|
25
|
+
all activity/mode routes, retained output-format failures and native streaming tool continuations.
|
|
26
|
+
Those small synthetic checks do not establish repository-quality rankings or optimal efforts.
|
|
27
|
+
|
|
24
28
|
### Compatibility checks
|
|
25
29
|
|
|
26
30
|
On 2026-10-28, six synthetic live requests per provider returned HTTP 200.
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# MiniMax, MiMo and Kimi evidence
|
|
2
|
+
|
|
3
|
+
Checked 2026-10-31. The [default routes](providers.md#built-in-defaults) are conservative starting policies,
|
|
4
|
+
not an optimal activity matrix or measured savings. These execution providers are separate from the classifier.
|
|
5
|
+
|
|
6
|
+
## Contracts and selection
|
|
7
|
+
|
|
8
|
+
| Provider | Selected model(s) | Documented controls used | Why |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| MiniMax | MiniMax-M3.1-Flash | low, medium, high, max | Current effort-capable model; cheaper than M3. M3 ignores effort. |
|
|
11
|
+
| MiMo | MiMo-V2.6-Flash / Pro | No routed effort | Flash for volume, Pro for harder work. Anthropic docs establish binary thinking, not depth levels. |
|
|
12
|
+
| Kimi | Kimi-K3.1-Pro | low, high, max | Cheaper successor to K3; one model avoids mixing preserved-thinking histories. |
|
|
13
|
+
|
|
14
|
+
MiniMax also documents `xhigh`, but some Claude Code versions serialize it as `high`. The preset omits it
|
|
15
|
+
rather than claim an extra distinct compute setting. Raw `xhigh` acceptance was checked, not native normalization.
|
|
16
|
+
Kimi K2.7 is not used as a cheap tier: its lifecycle notice closes access for new users on 2026-10-31
|
|
17
|
+
and plans retirement by the end of December 2026. Existing K3 users must start a fresh conversation to migrate to K3.1.
|
|
18
|
+
|
|
19
|
+
The local model-cards catalog was an initial reference: MiniMax M3 verified 2026-07-14 and Kimi K3/K2.7
|
|
20
|
+
verified 2026-09-13. It has no M3.1 Flash, K3.1 or MiMo record. Current official endpoint docs supersede
|
|
21
|
+
older catalog controls and K2 context claims.
|
|
22
|
+
|
|
23
|
+
### Primary sources
|
|
24
|
+
|
|
25
|
+
- MiniMax [Messages](https://platform.minimax.io/docs/api-reference/text-chat-anthropic),
|
|
26
|
+
[SDK compatibility](https://platform.minimax.io/docs/api-reference/text-anthropic-api),
|
|
27
|
+
[pricing](https://platform.minimax.io/docs/pricing/overview),
|
|
28
|
+
[automatic caching](https://platform.minimax.io/docs/api-reference/text-prompt-caching),
|
|
29
|
+
[Claude Code](https://platform.minimax.io/docs/m-plan/claude-code),
|
|
30
|
+
[Flash release](https://www.minimax.io/blog/minimax-m31f).
|
|
31
|
+
- MiMo [Anthropic API](https://mimo.mi.com/docs/en-US/api/chat/anthropic-api),
|
|
32
|
+
[model selection](https://mimo.mi.com/docs/quick-start/summary/model),
|
|
33
|
+
[pricing](https://mimo.mi.com/docs/en-US/pricing),
|
|
34
|
+
[Claude Code](https://mimo.mi.com/docs/integration/claudecode),
|
|
35
|
+
[deep thinking](https://mimo.mi.com/docs/en-US/quick-start/usage-guide/text-generation/deep-thinking).
|
|
36
|
+
- Kimi [Messages](https://platform.kimi.ai/docs/api/messages),
|
|
37
|
+
[models and lifecycle](https://platform.kimi.ai/docs/models),
|
|
38
|
+
[K3.1 guide](https://platform.kimi.ai/docs/guide/kimi-k3-1-pro-quickstart),
|
|
39
|
+
[pricing](https://platform.kimi.ai/docs/pricing/chat),
|
|
40
|
+
[caching](https://platform.kimi.ai/docs/guide/context-caching),
|
|
41
|
+
[K3 session guidance](https://forum.moonshot.ai/t/kimi-k3-is-here-our-most-capable-model/480).
|
|
42
|
+
|
|
43
|
+
Vendor results motivate the model choices, not the exact activity overrides. No independent head-to-head
|
|
44
|
+
repository benchmark establishes which effort each activity needs. Token prices are not prices per successful task.
|
|
45
|
+
|
|
46
|
+
## Live checks
|
|
47
|
+
|
|
48
|
+
All prompts and fixtures were synthetic. No real repository code, private conversations or credentials
|
|
49
|
+
are included in artifacts. Credential files stay local. JSON checks save final answers and usage, never reasoning text.
|
|
50
|
+
|
|
51
|
+
### Raw controls
|
|
52
|
+
|
|
53
|
+
[`provider-controls.json`](../experiments/mod-router/results/provider-controls.json) records 20 HTTP 200 requests:
|
|
54
|
+
old/new MiniMax, both MiMo models, and old/new Kimi. The body used a prime-number JSON prompt,
|
|
55
|
+
`max_tokens: 2048`, `thinking: {type: "adaptive"}`, and the recorded `output_config.effort`.
|
|
56
|
+
All responses named the requested model.
|
|
57
|
+
|
|
58
|
+
HTTP acceptance alone cannot distinguish honored fields from ignored fields. In particular, M3 success does not
|
|
59
|
+
make it effort-controllable, and MiMo low/high/max success does not establish different reasoning depths.
|
|
60
|
+
The production MiMo preset therefore lists no effort levels. Xiaomi's documented default thinking remains on;
|
|
61
|
+
Claude Code may still send its session effort and adaptive thinking, accepted in the native smoke test.
|
|
62
|
+
|
|
63
|
+
### Activity and mode microchecks
|
|
64
|
+
|
|
65
|
+
`node scripts/probe-provider-routes.mjs <provider> <budget-usd>` is billed and opt-in.
|
|
66
|
+
It asks one deterministic JSON task for each distinct activity/model/effort route across all tiers and modes,
|
|
67
|
+
using [the checked-in tasks](../test/fixtures/provider-tasks.json). Every mode/tier cell references its measured route.
|
|
68
|
+
The tests check small code-contract outputs, a boundary bug, an import graph, topological planning, SQL injection,
|
|
69
|
+
replica status and a configuration reference. They are **not code editing or repository-quality benchmarks**.
|
|
70
|
+
|
|
71
|
+
| Provider | Distinct calls | Exact JSON checks passed | Estimated API-list cost |
|
|
72
|
+
| --- | ---: | ---: | ---: |
|
|
73
|
+
| MiniMax | 28 | 28 | $0.001472 |
|
|
74
|
+
| MiMo | 14 | 12 | $0.001001 |
|
|
75
|
+
| Kimi | 21 | 21 | $0.024376 |
|
|
76
|
+
|
|
77
|
+
Results: [MiniMax](../experiments/mod-router/results/provider-routes-minimax.json),
|
|
78
|
+
[MiMo](../experiments/mod-router/results/provider-routes-mimo.json),
|
|
79
|
+
[Kimi](../experiments/mod-router/results/provider-routes-kimi.json).
|
|
80
|
+
|
|
81
|
+
MiMo Flash returned objects instead of module-name strings for `explore`, and added prose to an otherwise correct
|
|
82
|
+
`plan` array. Those are retained failures, not retried or hidden by a permissive parser. Pro passed both.
|
|
83
|
+
One sample does not justify moving every exploration or planning task to Pro.
|
|
84
|
+
MiniMax/Kimi low effort also passed these easy tasks, so the sample does not prove high/max necessary for harder work.
|
|
85
|
+
|
|
86
|
+
### Native streaming and tools
|
|
87
|
+
|
|
88
|
+
Claude Code **2.1.316** loaded the production Mod in isolated homes. Each provider ran a pinned high turn,
|
|
89
|
+
a Read tool continuation, a pinned micro turn, and another Read continuation: four upstream requests.
|
|
90
|
+
The test forwarded only these synthetic requests to fixed provider endpoints, capped output at 2,048 tokens,
|
|
91
|
+
and verified the requested/served model, supported routed effort and final marker.
|
|
92
|
+
|
|
93
|
+
| Provider | Observed transition | Result |
|
|
94
|
+
| --- | --- | --- |
|
|
95
|
+
| MiniMax | M3.1 Flash max → low | Passed |
|
|
96
|
+
| MiMo | Pro → Flash, session effort retained | Passed |
|
|
97
|
+
| Kimi | K3.1 Pro max → low, same model | Passed |
|
|
98
|
+
|
|
99
|
+
Artifacts: [MiniMax](../experiments/mod-router/results/provider-native-minimax.json),
|
|
100
|
+
[MiMo](../experiments/mod-router/results/provider-native-mimo.json),
|
|
101
|
+
[Kimi](../experiments/mod-router/results/provider-native-kimi.json).
|
|
102
|
+
Repeat with `node experiments/mod-router/scripts/provider-live.mjs <provider> <budget-usd>` (billed).
|
|
103
|
+
This temporary diagnostic forwarder is **not** part of the shipped router.
|
|
104
|
+
|
|
105
|
+
All three reported positive cache reads on tool continuations. MiniMax/MiMo streamed usage omitted cache-creation
|
|
106
|
+
counts; the engine compatibility check covers omitted-counter normalization. Kimi reported ordinary-price five-minute
|
|
107
|
+
cache fills and cache reads; the native request contained no top-level one-hour cache control.
|
|
108
|
+
No cross-effort hit-rate or TTL guarantee follows from these few requests.
|
|
109
|
+
|
|
110
|
+
The operator approved a $5 ceiling. Raw controls, microchecks and two native smoke passes together accounted for
|
|
111
|
+
approximately **$0.0625** at published list prices, including the superseded first native pass.
|
|
112
|
+
The [spend record](../experiments/mod-router/results/provider-experiment-spend.json) includes the superseded pass's
|
|
113
|
+
captured console totals so the aggregate can be reproduced. This is not a provider invoice or subscription-quota estimate.
|
|
114
|
+
The scripts enforce **per-invocation** ceilings only; the supervisor tracked the aggregate manually, not with a shared
|
|
115
|
+
runtime ledger. Each repeat needs a fresh spending authorization.
|
|
116
|
+
|
|
117
|
+
## Offline checks
|
|
118
|
+
|
|
119
|
+
`npm run test:providers` uses Claude Code and a loopback-only API with dummy credentials, not paid calls.
|
|
120
|
+
It covers all five non-Anthropic built-ins, profile selection, high/micro transitions, tools, omitted usage,
|
|
121
|
+
missing files and invalid configuration. Unit tests cover every new tier × activity × mode, pinning,
|
|
122
|
+
file isolation, reset/undo, metadata, lack of MiMo effort controls and the single-model Kimi catalog.
|
|
123
|
+
The tables in [Providers](providers.md#new-provider-modes) are generated and checked against the actual route transform.
|
|
124
|
+
|
|
125
|
+
Cost mode now steps to the next supported lower effort, skipping gaps: `max → high → low` on Kimi,
|
|
126
|
+
DeepSeek and z.ai. Previously upward projection could return the original effort and make cost mode a no-op.
|
|
127
|
+
MiMo has no effort lever; adjacent equal routes intentionally remain equal.
|
|
128
|
+
|
|
129
|
+
## Limits and upgrade triggers
|
|
130
|
+
|
|
131
|
+
Not tested: native images/video, near-1M context, compaction or rewind with provider thinking signatures,
|
|
132
|
+
forced tool choice, sustained rate limits, subscription eligibility, or real per-activity task quality and savings.
|
|
133
|
+
Raw API vision support is documented, not an end-to-end screenshot result.
|
|
134
|
+
|
|
135
|
+
MiMo Token Plan terms restrict general API/backend automation; use the documented PAYG endpoint and prices
|
|
136
|
+
for these experiments. A Claude Code integration does not establish that every non-coding automation qualifies
|
|
137
|
+
for a subscription. Check your plan terms and endpoint separately.
|
|
138
|
+
|
|
139
|
+
Keep these small presets until a representative coding/debug/review workload measures task success, retries,
|
|
140
|
+
total input/output, latency and cost per accepted change. Expand activity overrides only when that evidence
|
|
141
|
+
supports a difference. Do not add K2/K3 mixing or unsupported effort controls to make the tables look richer.
|
package/docs/providers.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Claude Router routes models and effort within the provider that Claude Code already uses.
|
|
4
4
|
Set a provider name and give the router a matching JSON file. No provider-specific plugin or proxy is needed.
|
|
5
5
|
|
|
6
|
-
**Built-in profiles:** Anthropic, DeepSeek
|
|
6
|
+
**Built-in profiles:** Anthropic, DeepSeek, z.ai, MiniMax, MiMo and Kimi.
|
|
7
7
|
**Custom profiles:** OpenRouter, Ollama, other local servers, and other hosted providers with a Claude Code-compatible Anthropic endpoint.
|
|
8
8
|
Custom profiles need their own model settings. They do not inherit Claude models.
|
|
9
9
|
|
|
@@ -42,12 +42,15 @@ The directory is `CLAUDE_CONFIG_DIR` when set, otherwise `~/.claude`.
|
|
|
42
42
|
| Unset, empty, or `anthropic` | `router.json` | Haiku 5.5, Sonnet 5.5, Opus 5.5 |
|
|
43
43
|
| `deepseek` | `deepseek-router.json` | DeepSeek Flash |
|
|
44
44
|
| `zai` | `zai-router.json` | GLM-5.3-Flash, GLM-5.3 |
|
|
45
|
+
| `minimax` | `minimax-router.json` | MiniMax-M3.1-Flash |
|
|
46
|
+
| `mimo` | `mimo-router.json` | MiMo-V2.6-Flash, MiMo-V2.6-Pro |
|
|
47
|
+
| `kimi` | `kimi-router.json` | Kimi-K3.1-Pro |
|
|
45
48
|
| `openrouter` | `openrouter-router.json` | None. Supply a complete profile. |
|
|
46
49
|
| `ollama` | `ollama-router.json` | None. Supply a complete profile. |
|
|
47
50
|
| Any other valid name | `<provider>-router.json` | None. Supply a complete profile. |
|
|
48
51
|
|
|
49
52
|
Names are local profile identifiers, not a provider registry or an endpoint lookup.
|
|
50
|
-
For example, `
|
|
53
|
+
For example, `local` or `my-gateway` can name a custom profile.
|
|
51
54
|
Names must start with a lowercase letter, contain only lowercase letters, digits and hyphens, and have at most 64 characters.
|
|
52
55
|
|
|
53
56
|
**Setting the name does not change Claude Code's endpoint, credentials or billing product.**
|
|
@@ -68,8 +71,20 @@ For an all-local setup, [configure the Ollama classifier](user-guide.md#use-olla
|
|
|
68
71
|
## Built-in defaults
|
|
69
72
|
|
|
70
73
|
Anthropic is the default when no provider name is set.
|
|
71
|
-
|
|
72
|
-
A file containing `{}` is enough
|
|
74
|
+
Every non-Anthropic built-in requires its named file, even when you want only defaults.
|
|
75
|
+
A file containing `{}` is enough. MiniMax, MiMo and Kimi require Router 1.19.0 or newer.
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
# First create the selected profile file containing {}, then launch on a configured model:
|
|
79
|
+
CLAUDE_ROUTER_PROVIDER=minimax claude --model 'MiniMax-M3.1-Flash[1m]'
|
|
80
|
+
CLAUDE_ROUTER_PROVIDER=mimo claude --model 'mimo-v2.6-flash[1m]'
|
|
81
|
+
CLAUDE_ROUTER_PROVIDER=kimi claude --model 'kimi-k3.1-pro[1m]'
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Remove a fixed `CLAUDE_CODE_EFFORT_LEVEL` override if you want the router's per-turn efforts.
|
|
85
|
+
When migrating Kimi, start a **fresh conversation**. Its preserved thinking/signatures are model-specific;
|
|
86
|
+
resuming another model's history into K3-family models is not a supported migration.
|
|
87
|
+
The default Kimi ladder uses one model throughout, not a K2/K3 mixture.
|
|
73
88
|
|
|
74
89
|
### Model IDs
|
|
75
90
|
|
|
@@ -81,6 +96,10 @@ A file containing `{}` is enough for either.
|
|
|
81
96
|
| DeepSeek | `flash` | `deepseek-flash[1m]` |
|
|
82
97
|
| z.ai | `flash` | `glm-5.3-flash[1m]` |
|
|
83
98
|
| z.ai | `glm` | `glm-5.3[1m]` |
|
|
99
|
+
| MiniMax | `flash` | `MiniMax-M3.1-Flash[1m]` |
|
|
100
|
+
| MiMo | `flash` | `mimo-v2.6-flash[1m]` |
|
|
101
|
+
| MiMo | `pro` | `mimo-v2.6-pro[1m]` |
|
|
102
|
+
| Kimi | `k3` | `kimi-k3.1-pro[1m]` |
|
|
84
103
|
|
|
85
104
|
`[1m]` is a Claude Code context hint, not a different served model.
|
|
86
105
|
Changing Claude Code's model-slot environment variables does not update this catalog.
|
|
@@ -95,8 +114,13 @@ Each cell is `model alias · effort`. All profiles start at tier `low`.
|
|
|
95
114
|
| Anthropic | haiku · medium | haiku · high | opus · medium | opus · xhigh |
|
|
96
115
|
| DeepSeek | flash · low | flash · high | flash · high | flash · max |
|
|
97
116
|
| z.ai | flash · low | flash · high | glm · high | glm · max |
|
|
117
|
+
| MiniMax | flash · low | flash · medium | flash · high | flash · max |
|
|
118
|
+
| MiMo | flash · none | flash · none | pro · none | pro · none |
|
|
119
|
+
| Kimi | k3 · low | k3 · high | k3 · high | k3 · max |
|
|
98
120
|
|
|
99
121
|
A provider can use one model at several efforts. Two tiers can also share the same model and effort.
|
|
122
|
+
`none` for MiMo means **no routed effort**, not thinking off. Claude Code may still send its session effort;
|
|
123
|
+
Xiaomi does not document granular reasoning levels for its Anthropic endpoint. The preset lists `efforts: []`.
|
|
100
124
|
|
|
101
125
|
### Activity overrides
|
|
102
126
|
|
|
@@ -110,9 +134,13 @@ With activity routing on, these cells replace the base route. Other cells keep t
|
|
|
110
134
|
| z.ai | `code`, `debug`, `plan`, `review` | `medium` | glm · max |
|
|
111
135
|
| z.ai | `ops`, `explore`, `docs` | `medium` | flash · high |
|
|
112
136
|
| z.ai | `ops`, `explore`, `docs` | `high` | flash · max |
|
|
137
|
+
| MiniMax | `code`, `debug`, `plan`, `review` | `medium` | flash · max |
|
|
138
|
+
| MiMo | `ops`, `explore`, `docs` | `medium` | flash · none |
|
|
139
|
+
| Kimi | `code`, `debug`, `plan`, `review` | `medium` | k3 · max |
|
|
113
140
|
|
|
114
141
|
GLM-5.3 is text-only. Image-bearing history excludes it when the router can select a compatible route.
|
|
115
|
-
The default models all have a
|
|
142
|
+
The default models all have a context window of at least 1M tokens.
|
|
143
|
+
The four new model entries support image input at the provider; native image and near-limit context paths have not been tested.
|
|
116
144
|
|
|
117
145
|
Subagent routing is on for built-in profiles:
|
|
118
146
|
|
|
@@ -121,6 +149,9 @@ Subagent routing is on for built-in profiles:
|
|
|
121
149
|
| Anthropic | haiku | sonnet | opus |
|
|
122
150
|
| DeepSeek | flash | flash | flash |
|
|
123
151
|
| z.ai | flash | glm | glm |
|
|
152
|
+
| MiniMax | flash | flash | flash |
|
|
153
|
+
| MiMo | flash | pro | pro |
|
|
154
|
+
| Kimi | k3 | k3 | k3 |
|
|
124
155
|
|
|
125
156
|
Subagents receive a model at spawn, not a routed effort. Their own effort setting still applies.
|
|
126
157
|
|
|
@@ -128,6 +159,53 @@ These defaults are starting policies, not measured quality or savings guarantees
|
|
|
128
159
|
See [the evidence and limits](evaluation.md#provider-profiles).
|
|
129
160
|
For prices and cache settings, see [the configuration reference](configuration.md#provider-profiles).
|
|
130
161
|
|
|
162
|
+
## New provider modes
|
|
163
|
+
|
|
164
|
+
These are configured routes by tier and activity, before vote, context, failure, dwell and cache-cost guards.
|
|
165
|
+
`base/uncertain` means the tier's base route; an uncertain classifier tier keeps the incumbent tier.
|
|
166
|
+
A pin bypasses modes and activities. The ordinary [mode rules](routing-modes.md) apply without provider-specific code.
|
|
167
|
+
Generate these tables with `node scripts/provider-matrix.mjs`.
|
|
168
|
+
|
|
169
|
+
<!-- provider-matrix:start -->
|
|
170
|
+
**minimax**
|
|
171
|
+
|
|
172
|
+
| Tier | Activities | cost | balanced | quality |
|
|
173
|
+
| --- | --- | --- | --- | --- |
|
|
174
|
+
| micro | base/uncertain, code, debug, explore, plan, review, ops, docs | flash · low | flash · low | flash · low |
|
|
175
|
+
| low | base/uncertain, code, debug, explore, plan, review, ops, docs | flash · low | flash · medium | flash · high |
|
|
176
|
+
| medium | base/uncertain, explore, ops, docs | flash · medium | flash · high | flash · max |
|
|
177
|
+
| medium | code, debug, plan, review | flash · high | flash · max | flash · max |
|
|
178
|
+
| high | base/uncertain, code, debug, explore, plan, review, ops, docs | flash · high | flash · max | flash · max |
|
|
179
|
+
|
|
180
|
+
**mimo**
|
|
181
|
+
|
|
182
|
+
| Tier | Activities | cost | balanced | quality |
|
|
183
|
+
| --- | --- | --- | --- | --- |
|
|
184
|
+
| micro | base/uncertain, code, debug, explore, plan, review, ops, docs | flash · no routed effort | flash · no routed effort | flash · no routed effort |
|
|
185
|
+
| low | base/uncertain, code, debug, plan, review | flash · no routed effort | flash · no routed effort | pro · no routed effort |
|
|
186
|
+
| low | explore, ops, docs | flash · no routed effort | flash · no routed effort | flash · no routed effort |
|
|
187
|
+
| medium | base/uncertain, code, debug, plan, review | flash · no routed effort | pro · no routed effort | pro · no routed effort |
|
|
188
|
+
| medium | explore, ops, docs | flash · no routed effort | flash · no routed effort | pro · no routed effort |
|
|
189
|
+
| high | base/uncertain, code, debug, plan, review | pro · no routed effort | pro · no routed effort | pro · no routed effort |
|
|
190
|
+
| high | explore, ops, docs | flash · no routed effort | pro · no routed effort | pro · no routed effort |
|
|
191
|
+
|
|
192
|
+
**kimi**
|
|
193
|
+
|
|
194
|
+
| Tier | Activities | cost | balanced | quality |
|
|
195
|
+
| --- | --- | --- | --- | --- |
|
|
196
|
+
| micro | base/uncertain, code, debug, explore, plan, review, ops, docs | k3 · low | k3 · low | k3 · low |
|
|
197
|
+
| low | base/uncertain, code, debug, explore, plan, review, ops, docs | k3 · low | k3 · high | k3 · max |
|
|
198
|
+
| medium | base/uncertain, explore, ops, docs | k3 · low | k3 · high | k3 · max |
|
|
199
|
+
| medium | code, debug, plan, review | k3 · high | k3 · max | k3 · max |
|
|
200
|
+
| high | base/uncertain, code, debug, explore, plan, review, ops, docs | k3 · high | k3 · max | k3 · max |
|
|
201
|
+
<!-- provider-matrix:end -->
|
|
202
|
+
|
|
203
|
+
MiniMax uses all four preset effort levels. `xhigh` is omitted because some Claude Code versions send it as `high`;
|
|
204
|
+
`max` supplies the deeper setting. Legacy M3 ignores effort and is not a stronger tier by default.
|
|
205
|
+
MiMo's cost/quality modes change models where a neighbouring tier permits it; otherwise the route stays the same.
|
|
206
|
+
Kimi uses only `low`, `high`, `max`, the documented controls, and never promotes a session into another model.
|
|
207
|
+
These are starting policies, not an optimal activity matrix. See [research and experiments](provider-experiments.md).
|
|
208
|
+
|
|
131
209
|
## Add another provider
|
|
132
210
|
|
|
133
211
|
No code change or provider registration is needed.
|
package/docs/routing-modes.md
CHANGED
|
@@ -15,7 +15,9 @@ In every mode:
|
|
|
15
15
|
- A pin (`/router pin <tier>`) runs that tier's configured route. With routing off (`/router off`, `/model`),
|
|
16
16
|
Claude's model runs, as before.
|
|
17
17
|
- A route never loses its effort: an effort level moves only within what the model lists in `models.<alias>.efforts`,
|
|
18
|
-
|
|
18
|
+
skipping unsupported levels in the direction of the move. For example, `cost` moves `max → high → low`
|
|
19
|
+
on a model listing only those three. A route with a `null` effort (the session's) or a model without efforts has no effort step.
|
|
20
|
+
- [MiniMax, MiMo and Kimi tables](providers.md#new-provider-modes) show every new preset's mode/activity combination.
|
|
19
21
|
|
|
20
22
|
## Choose a mode
|
|
21
23
|
|
package/lib/modes.mjs
CHANGED
|
@@ -3,19 +3,6 @@
|
|
|
3
3
|
import { ACTIVITIES, DEFAULTS, EFFORTS, ROUTING_MODES, rank, resolveRoute, sameRoute, TIERS } from './config.mjs';
|
|
4
4
|
import { clampEffort } from './cost.mjs';
|
|
5
5
|
|
|
6
|
-
// `wanted` on a model that lists `supported`: itself, else the next higher listed, else the highest lower one.
|
|
7
|
-
export function projectEffort(supported, wanted) {
|
|
8
|
-
if (supported.includes(wanted)) return wanted;
|
|
9
|
-
const at = EFFORTS.indexOf(wanted);
|
|
10
|
-
return (
|
|
11
|
-
EFFORTS.slice(at + 1).find((e) => supported.includes(e)) ??
|
|
12
|
-
EFFORTS.slice(0, at)
|
|
13
|
-
.reverse()
|
|
14
|
-
.find((e) => supported.includes(e)) ??
|
|
15
|
-
null
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
6
|
// The route's effort one level up (`step` 1) or down (-1), on what the model lists; null when it cannot move that
|
|
20
7
|
// way: a null effort (the session's), a model without efforts, or no listed level in that direction. The model's
|
|
21
8
|
// lowest listed level is the floor, so a route never loses its effort.
|
|
@@ -23,9 +10,9 @@ function steppedEffort(config, route, step) {
|
|
|
23
10
|
const supported = config.models[route.model].efforts;
|
|
24
11
|
const from = clampEffort(route.effort, supported);
|
|
25
12
|
if (!from) return null;
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
return
|
|
13
|
+
const at = EFFORTS.indexOf(from);
|
|
14
|
+
const choices = step < 0 ? EFFORTS.slice(0, at).reverse() : EFFORTS.slice(at + 1);
|
|
15
|
+
return choices.find((effort) => supported.includes(effort)) ?? null;
|
|
29
16
|
}
|
|
30
17
|
|
|
31
18
|
// The route `mode` runs for tier and activity, always from the configured routes. `cost` takes the tier below (never
|
package/lib/providers.mjs
CHANGED
|
@@ -18,6 +18,94 @@ const agents = (light, heavy) => ({
|
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
export const PROVIDER_DEFAULTS = {
|
|
21
|
+
minimax: {
|
|
22
|
+
models: {
|
|
23
|
+
flash: {
|
|
24
|
+
id: 'MiniMax-M3.1-Flash[1m]',
|
|
25
|
+
input: 0.15,
|
|
26
|
+
output: 0.6,
|
|
27
|
+
cacheRead: 0.015,
|
|
28
|
+
contextWindow: 1_000_000,
|
|
29
|
+
billing: 'credits',
|
|
30
|
+
// xhigh is documented but some Claude Code versions serialize it as high; use max instead.
|
|
31
|
+
efforts: ['low', 'medium', 'high', 'max'],
|
|
32
|
+
strength: 1,
|
|
33
|
+
imageInput: true,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
routes: {
|
|
37
|
+
micro: route('flash', 'low'),
|
|
38
|
+
low: route('flash', 'medium'),
|
|
39
|
+
medium: route('flash', 'high'),
|
|
40
|
+
high: route('flash', 'max'),
|
|
41
|
+
},
|
|
42
|
+
activities: Object.fromEntries(
|
|
43
|
+
['code', 'debug', 'plan', 'review'].map((a) => [a, { medium: route('flash', 'max') }]),
|
|
44
|
+
),
|
|
45
|
+
subagents: agents('flash', 'flash'),
|
|
46
|
+
cache: AUTOMATIC,
|
|
47
|
+
},
|
|
48
|
+
mimo: {
|
|
49
|
+
models: {
|
|
50
|
+
flash: {
|
|
51
|
+
id: 'mimo-v2.6-flash[1m]',
|
|
52
|
+
input: 0.14,
|
|
53
|
+
output: 0.28,
|
|
54
|
+
cacheRead: 0.0028,
|
|
55
|
+
contextWindow: 1_000_000,
|
|
56
|
+
billing: 'credits',
|
|
57
|
+
// The Anthropic endpoint documents binary thinking, not granular effort. Keep its default thinking.
|
|
58
|
+
efforts: [],
|
|
59
|
+
strength: 1,
|
|
60
|
+
imageInput: true,
|
|
61
|
+
},
|
|
62
|
+
pro: {
|
|
63
|
+
id: 'mimo-v2.6-pro[1m]',
|
|
64
|
+
input: 0.435,
|
|
65
|
+
output: 0.87,
|
|
66
|
+
cacheRead: 0.0036,
|
|
67
|
+
contextWindow: 1_000_000,
|
|
68
|
+
billing: 'credits',
|
|
69
|
+
efforts: [],
|
|
70
|
+
strength: 2,
|
|
71
|
+
imageInput: true,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
routes: {
|
|
75
|
+
micro: route('flash', null),
|
|
76
|
+
low: route('flash', null),
|
|
77
|
+
medium: route('pro', null),
|
|
78
|
+
high: route('pro', null),
|
|
79
|
+
},
|
|
80
|
+
activities: Object.fromEntries(['ops', 'explore', 'docs'].map((a) => [a, { medium: route('flash', null) }])),
|
|
81
|
+
subagents: agents('flash', 'pro'),
|
|
82
|
+
cache: AUTOMATIC,
|
|
83
|
+
},
|
|
84
|
+
kimi: {
|
|
85
|
+
// One model throughout the conversation: K3-family thinking/signatures must survive tool continuations.
|
|
86
|
+
models: {
|
|
87
|
+
k3: {
|
|
88
|
+
id: 'kimi-k3.1-pro[1m]',
|
|
89
|
+
input: 2,
|
|
90
|
+
output: 10,
|
|
91
|
+
cacheRead: 0.2,
|
|
92
|
+
contextWindow: 1_048_576,
|
|
93
|
+
billing: 'credits',
|
|
94
|
+
efforts: EFFORTS,
|
|
95
|
+
strength: 1,
|
|
96
|
+
imageInput: true,
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
routes: {
|
|
100
|
+
micro: route('k3', 'low'),
|
|
101
|
+
low: route('k3', 'high'),
|
|
102
|
+
medium: route('k3', 'high'),
|
|
103
|
+
high: route('k3', 'max'),
|
|
104
|
+
},
|
|
105
|
+
activities: Object.fromEntries(['code', 'debug', 'plan', 'review'].map((a) => [a, { medium: route('k3', 'max') }])),
|
|
106
|
+
subagents: agents('k3', 'k3'),
|
|
107
|
+
cache: AUTOMATIC,
|
|
108
|
+
},
|
|
21
109
|
deepseek: {
|
|
22
110
|
models: {
|
|
23
111
|
flash: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexeiled/claude-router",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Native Claude Code model and effort routing with Anthropic, DeepSeek
|
|
3
|
+
"version": "1.19.0",
|
|
4
|
+
"description": "Native Claude Code model and effort routing with Anthropic, DeepSeek, z.ai, MiniMax, MiMo and Kimi defaults, custom provider profiles, and classifier advice.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Alexei Ledenev",
|
|
7
7
|
"repository": {
|