@alexeiled/claude-router 1.5.0 → 1.5.1
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 +1 -1
- package/CHANGELOG.md +11 -0
- package/README.md +4 -4
- package/docs/architecture.md +3 -3
- package/docs/native-router.md +9 -9
- package/docs/router-band.svg +67 -50
- package/docs/router-pane-classifier.svg +24 -7
- package/docs/router-pane-now.svg +18 -6
- package/docs/router-pane-routing.svg +20 -7
- package/docs/user-guide.md +28 -28
- package/hooks/native-router.mjs +17 -9
- package/lib/band.mjs +40 -18
- package/lib/display.mjs +3 -0
- package/lib/panel.mjs +10 -8
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "router",
|
|
3
3
|
"displayName": "Router",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.1",
|
|
5
5
|
"description": "Model and effort routing for the main conversation, advised by a prompt classifier (Jev, Clef, Clef Flash, OpenAI or local Ollama). Preserves subagent model choices.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Alexei Ledenev",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.5.1 (2026-10-09)
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- The band and pane name the mode **Routing on** and **Routing off**, not Auto and Manual. The footer reads `routing off`. The commands `/router auto` and `/router off` are unchanged.
|
|
8
|
+
- In the pane, the mode buttons use the hotkeys `o` (Routing on) and `f` (Routing off). They were `a` and `m`.
|
|
9
|
+
- A fresh session on a model no tier routes to starts with routing off, and the band says why: `Sonnet 5.5 is not a routing tier`. The note stays until the mode changes.
|
|
10
|
+
- The **Routing off** button sits on the band line while routing is on. It was reachable only on hover.
|
|
11
|
+
- The model-change toast reads `Model changed: old → new · reason`.
|
|
12
|
+
- The band uses the design prototype's colors: tier chips, filled buttons, an accent color while a turn is classified. Yellow is reserved for warnings.
|
|
13
|
+
|
|
3
14
|
## 1.5.0 (2026-10-08)
|
|
4
15
|
|
|
5
16
|
Two classifiers are new: OpenAI and a local Ollama model. Jev stays the default, and nothing changes until you select one of the new classifiers.
|
package/README.md
CHANGED
|
@@ -38,11 +38,11 @@ sequenceDiagram
|
|
|
38
38
|
participant API as Anthropic
|
|
39
39
|
Dev->>Code: Prompt
|
|
40
40
|
Code->>Mod: Main or subagent step
|
|
41
|
-
alt Main conversation
|
|
41
|
+
alt Main conversation, routing on
|
|
42
42
|
Mod->>Cls: Bounded prompt and dialogue
|
|
43
43
|
Cls-->>Mod: Tier advice
|
|
44
44
|
Mod-->>Code: Selected model and effort
|
|
45
|
-
else
|
|
45
|
+
else Routing off or subagent
|
|
46
46
|
Mod-->>Code: Original model and effort
|
|
47
47
|
end
|
|
48
48
|
Code->>API: Native request and tools
|
|
@@ -70,7 +70,7 @@ claude plugin marketplace add alexei-led/claude-router
|
|
|
70
70
|
claude plugin install router@alexei-led-claude-router
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
Start Claude Code on the full baseline model, for example `claude --model claude-haiku-5-5`. Run `/plugin configure router` and save the key. For any other classifier, save its credentials, or run `ollama serve` with a pulled model, then pick the classifier on the pane's Classifier tab. A new session on a model that one of the tiers routes to starts
|
|
73
|
+
Start Claude Code on the full baseline model, for example `claude --model claude-haiku-5-5`. Run `/plugin configure router` and save the key. For any other classifier, save its credentials, or run `ollama serve` with a pulled model, then pick the classifier on the pane's Classifier tab. A new session on a model that one of the tiers routes to starts with routing on; on another model it starts with routing off and says why, and `/router auto` turns routing on.
|
|
74
74
|
|
|
75
75
|
Claude Code updates the plugin at startup when auto-update is on for this marketplace. Otherwise run `claude plugin marketplace update alexei-led-claude-router`, then `claude plugin update router@alexei-led-claude-router`.
|
|
76
76
|
|
|
@@ -86,7 +86,7 @@ claude --plugin-dir "$PWD" --model claude-haiku-5-5
|
|
|
86
86
|
|
|
87
87
|
In Claude Code, run `/plugin configure router` and save your classifier key in the sensitive plugin option. The Mod adds its status band and `/router` pane. No status-line setup or gateway environment variables are needed.
|
|
88
88
|
|
|
89
|
-
Run `/router` to open the pane: route status, per-tier controls, tuning, and usage. Run `/model` to select a model and
|
|
89
|
+
Run `/router` to open the pane: route status, per-tier controls, tuning, and usage. Run `/model` to select a model and turn routing off, and `/router auto` to turn it back on. For controls, metrics, tuning, and troubleshooting, see the [user guide](docs/user-guide.md).
|
|
90
90
|
|
|
91
91
|
Before a push, run the same checks as CI. `npm run setup` installs Biome and TypeScript into `tools/`; the plugin root keeps no lockfile, so Claude Code installs nothing with the plugin. `npm run validate` and `npm run test:plugin` need the `claude` CLI: they load the Mod in the Claude Code engine, which refuses some faults that lint and unit tests miss.
|
|
92
92
|
|
package/docs/architecture.md
CHANGED
|
@@ -14,12 +14,12 @@ sequenceDiagram
|
|
|
14
14
|
participant API as Anthropic
|
|
15
15
|
Dev->>Code: Prompt
|
|
16
16
|
Code->>Mod: turn.start and turn.step
|
|
17
|
-
alt Main conversation,
|
|
17
|
+
alt Main conversation, routing on
|
|
18
18
|
Mod->>Cls: Current prompt and bounded dialogue
|
|
19
19
|
Cls-->>Mod: Tier advice
|
|
20
20
|
Note over Mod: Apply votes, context fit, cache costs and failure rules
|
|
21
21
|
Mod-->>Code: Forward model and effort
|
|
22
|
-
else
|
|
22
|
+
else Routing off, subagent, or unavailable
|
|
23
23
|
Mod-->>Code: Forward model and effort unchanged
|
|
24
24
|
end
|
|
25
25
|
Code->>API: Native authenticated request
|
|
@@ -69,7 +69,7 @@ An explicit context-window failure marks that model ineligible until the next hi
|
|
|
69
69
|
|
|
70
70
|
`$.state` stores route decisions, response observations, and UI state for the active session. Version-checked writes reject stale turn results. A private in-memory view merges state writes during one dispatch because state reads are frozen for that dispatch.
|
|
71
71
|
|
|
72
|
-
Clear, branch, rewind, and committed compaction clear cache evidence and votes. A turn in progress keeps its route, pin, and any engine fallback. `/clear` starts the new session
|
|
72
|
+
Clear, branch, rewind, and committed compaction clear cache evidence and votes. A turn in progress keeps its route, pin, and any engine fallback. `/clear` starts the new session with routing on. A fresh session on a model that a configured tier routes to starts with routing on. A fresh session on any other model starts with routing off, and the band names the reason. Session start sets the mode; the band and pane only read it, even when they draw first. Resume restores the selected session's saved mode. Hot reload retains valid `$.state`. Running `/model` turns routing off, including an explicit choice of the baseline. `/router auto` resumes routing. `/router off` also turns routing off. Pins apply to the next turn and its tool continuations. The prior route resumes afterward.
|
|
73
73
|
|
|
74
74
|
Subagent events pass directly to Claude Code. They do not create classifier requests or change main-conversation metrics. This is the selected scope because Mods do not expose whether a subagent model was explicit or inherited.
|
|
75
75
|
|
package/docs/native-router.md
CHANGED
|
@@ -12,21 +12,21 @@ The default tiers are defined in [Configuration](configuration.md#built-in-defau
|
|
|
12
12
|
|
|
13
13
|
## Controls and session modes
|
|
14
14
|
|
|
15
|
-
| Control | Behavior
|
|
16
|
-
| -------------------- |
|
|
17
|
-
| `/router` | Open the pane. Without a UI surface, print short status.
|
|
18
|
-
| `/router auto` | Enable automatic routing.
|
|
19
|
-
| `/router off` |
|
|
20
|
-
| `/router pin <tier>` | Pin the next turn and tool continuations.
|
|
21
|
-
| `/model <name>` | Select a model and
|
|
15
|
+
| Control | Behavior |
|
|
16
|
+
| -------------------- | ----------------------------------------------------------------------------- |
|
|
17
|
+
| `/router` | Open the pane. Without a UI surface, print short status. |
|
|
18
|
+
| `/router auto` | Enable automatic routing. |
|
|
19
|
+
| `/router off` | Turn routing off and keep Claude's selected model. |
|
|
20
|
+
| `/router pin <tier>` | Pin the next turn and tool continuations. Routing on must already be enabled. |
|
|
21
|
+
| `/model <name>` | Select a model and turn routing off. `/router auto` turns it back on. |
|
|
22
22
|
|
|
23
23
|
The pane's **Set up** and **Credentials → Edit** buttons open Claude Code's secure plugin configuration. Claude Code refuses `$.command.run` from inside a `command.run` hook, so the Mod starts that dialog from a timer after the press returns.
|
|
24
24
|
|
|
25
|
-
Mode belongs to a Claude Code session. Clear starts a new session
|
|
25
|
+
Mode belongs to a Claude Code session. Clear starts a new session with routing on. Resume restores the saved mode for that session. A new or forked session has a new ID: it starts with routing on for a model that one of the tiers routes to and with routing off for any other model, as a fresh launch does. A pin applies to one logical turn, then the prior route resumes. A history reset clears votes and cache evidence; the current turn keeps its route, pin and any native fallback.
|
|
26
26
|
|
|
27
27
|
## Router pane
|
|
28
28
|
|
|
29
|
-
The status band is one line above the prompt: a tier meter, the route, a short reason, classifier support, and context and cache use. Segments drop by priority when the band is narrow.
|
|
29
|
+
The status band is one line above the prompt: a tier meter, the route, a short reason, classifier support, and context and cache use. Segments drop by priority when the band is narrow. A **Routing off** button sits on the band while routing is on, and hovering reveals pins and a two-row view. A fresh session on a model no tier routes to shows `<model> is not a routing tier` on the band until the mode changes. The band yields to surveys and does not describe subagent transcripts. A model change between turns raises a toast. A pin, or a step that changes only the effort, such as `medium` to `high` on the defaults, raises none. While the classifier runs, the turn's spinner says `Choosing model`. In Manual mode or when routing is unavailable, the prompt footer carries `routing off` or `routing unavailable`. The **Router** button opens the pane. The pane has four tabs, Now, Routing, Classifier, and Usage, with Routing on and Routing off on every tab. The [user guide](user-guide.md#open-the-router-pane) describes each tab.
|
|
30
30
|
|
|
31
31
|
| Reading | Meaning and limits |
|
|
32
32
|
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
package/docs/router-band.svg
CHANGED
|
@@ -1,47 +1,55 @@
|
|
|
1
1
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 922 379" role="img" aria-labelledby="title desc">
|
|
2
2
|
<title id="title">The Router band above the Claude Code prompt</title>
|
|
3
|
-
<desc id="desc">Five band states drawn by the router code: routed to high, two rows with the hover row, a pending pin, a missing classifier key, and
|
|
3
|
+
<desc id="desc">Five band states drawn by the router code: routed to high, two rows with the hover row, a pending pin, a missing classifier key, and routing off.</desc>
|
|
4
4
|
<style>
|
|
5
5
|
text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13px; }
|
|
6
6
|
.cap { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 12px; fill: #9a988f; }
|
|
7
7
|
</style>
|
|
8
8
|
<rect width="922" height="379" rx="8" fill="#1c1c1c"/>
|
|
9
|
-
<text class="cap" x="20" y="30">
|
|
9
|
+
<text class="cap" x="20" y="30">Routing on: routed to the high tier on a clear jump</text>
|
|
10
10
|
<rect x="12" y="38" width="897.6" height="29" rx="5" fill="#232323"/>
|
|
11
11
|
<text x="24.0" y="56" fill="#e0708a" xml:space="preserve">▂</text>
|
|
12
12
|
<text x="31.8" y="56" fill="#e0708a" xml:space="preserve">▄</text>
|
|
13
13
|
<text x="39.6" y="56" fill="#e0708a" xml:space="preserve">▆</text>
|
|
14
14
|
<text x="47.4" y="56" fill="#e0708a" xml:space="preserve">█</text>
|
|
15
|
-
<
|
|
15
|
+
<rect x="55.2" y="42" width="46.8" height="18" rx="4" fill="#e0708a"/>
|
|
16
|
+
<text x="55.2" y="56" fill="#0d1016" font-weight="700" xml:space="preserve"> high </text>
|
|
16
17
|
<text x="102.0" y="56" fill="#d0d0d0" xml:space="preserve">Opus 5.5 · xhigh</text>
|
|
17
18
|
<text x="226.8" y="56" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
18
|
-
<
|
|
19
|
-
<text x="
|
|
20
|
-
<text x="
|
|
21
|
-
<text x="
|
|
22
|
-
<text x="
|
|
23
|
-
<text x="
|
|
24
|
-
<text x="
|
|
25
|
-
<text x="
|
|
26
|
-
<text x="
|
|
27
|
-
<text
|
|
19
|
+
<rect x="265.8" y="42" width="117.0" height="18" rx="4" fill="#2e3340"/>
|
|
20
|
+
<text x="265.8" y="56" fill="#d0d0d0" xml:space="preserve">[ Routing off ]</text>
|
|
21
|
+
<text x="382.8" y="56" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
22
|
+
<text x="421.8" y="56" fill="#7c7c7c" xml:space="preserve">↑ jump</text>
|
|
23
|
+
<text x="468.6" y="56" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
24
|
+
<text x="507.6" y="56" fill="#7c7c7c" xml:space="preserve">Jev 88% ≥ 82%</text>
|
|
25
|
+
<text x="609.0" y="56" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
26
|
+
<text x="648.0" y="56" fill="#d0d0d0" xml:space="preserve">ctx </text>
|
|
27
|
+
<text x="679.2" y="56" fill="#87d787" xml:space="preserve">40%</text>
|
|
28
|
+
<text x="702.6" y="56" fill="#d0d0d0" xml:space="preserve"> · cache </text>
|
|
29
|
+
<text x="772.8" y="56" fill="#87d787" xml:space="preserve">100%</text>
|
|
30
|
+
<text x="819.6" y="56" fill="#d0d0d0" xml:space="preserve">Router</text>
|
|
31
|
+
<text class="cap" x="20" y="95">Two rows, with the hover row shown: recent replies by tier, pins, Routing off</text>
|
|
28
32
|
<rect x="12" y="103" width="897.6" height="67" rx="5" fill="#232323"/>
|
|
29
33
|
<text x="24.0" y="121" fill="#e0708a" xml:space="preserve">▂</text>
|
|
30
34
|
<text x="31.8" y="121" fill="#e0708a" xml:space="preserve">▄</text>
|
|
31
35
|
<text x="39.6" y="121" fill="#e0708a" xml:space="preserve">▆</text>
|
|
32
36
|
<text x="47.4" y="121" fill="#e0708a" xml:space="preserve">█</text>
|
|
33
|
-
<
|
|
37
|
+
<rect x="55.2" y="107" width="46.8" height="18" rx="4" fill="#e0708a"/>
|
|
38
|
+
<text x="55.2" y="121" fill="#0d1016" font-weight="700" xml:space="preserve"> high </text>
|
|
34
39
|
<text x="102.0" y="121" fill="#d0d0d0" xml:space="preserve">Opus 5.5 · xhigh</text>
|
|
35
40
|
<text x="226.8" y="121" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
36
|
-
<
|
|
37
|
-
<text x="
|
|
38
|
-
<text x="
|
|
39
|
-
<text x="
|
|
40
|
-
<text x="
|
|
41
|
-
<text x="
|
|
42
|
-
<text x="
|
|
43
|
-
<text x="
|
|
44
|
-
<text x="
|
|
41
|
+
<rect x="265.8" y="107" width="117.0" height="18" rx="4" fill="#2e3340"/>
|
|
42
|
+
<text x="265.8" y="121" fill="#d0d0d0" xml:space="preserve">[ Routing off ]</text>
|
|
43
|
+
<text x="382.8" y="121" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
44
|
+
<text x="421.8" y="121" fill="#7c7c7c" xml:space="preserve">↑ jump</text>
|
|
45
|
+
<text x="468.6" y="121" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
46
|
+
<text x="507.6" y="121" fill="#7c7c7c" xml:space="preserve">Jev 88% ≥ 82%</text>
|
|
47
|
+
<text x="609.0" y="121" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
48
|
+
<text x="648.0" y="121" fill="#d0d0d0" xml:space="preserve">ctx </text>
|
|
49
|
+
<text x="679.2" y="121" fill="#87d787" xml:space="preserve">40%</text>
|
|
50
|
+
<text x="702.6" y="121" fill="#d0d0d0" xml:space="preserve"> · cache </text>
|
|
51
|
+
<text x="772.8" y="121" fill="#87d787" xml:space="preserve">100%</text>
|
|
52
|
+
<text x="819.6" y="121" fill="#d0d0d0" xml:space="preserve">Router</text>
|
|
45
53
|
<text x="24.0" y="140" fill="#7c7c7c" xml:space="preserve">replies </text>
|
|
46
54
|
<text x="86.4" y="140" fill="#5f9fe0" xml:space="preserve">█</text>
|
|
47
55
|
<text x="94.2" y="140" fill="#5f9fe0" xml:space="preserve">█</text>
|
|
@@ -65,55 +73,64 @@
|
|
|
65
73
|
<text x="234.6" y="140" fill="#e0708a" xml:space="preserve">█</text>
|
|
66
74
|
<text x="242.4" y="140" fill="#7c7c7c" xml:space="preserve"> 3 switches · tax ≈ $0.48 · cache saved ≈ $1.52</text>
|
|
67
75
|
<text x="24.0" y="159" fill="#7c7c7c" xml:space="preserve">pin next turn </text>
|
|
76
|
+
<rect x="133.2" y="145" width="70.2" height="18" rx="4" fill="#2e3340"/>
|
|
68
77
|
<text x="133.2" y="159" fill="#d0d0d0" xml:space="preserve">[ micro ]</text>
|
|
78
|
+
<rect x="211.2" y="145" width="54.6" height="18" rx="4" fill="#2e3340"/>
|
|
69
79
|
<text x="211.2" y="159" fill="#d0d0d0" xml:space="preserve">[ low ]</text>
|
|
80
|
+
<rect x="273.6" y="145" width="78.0" height="18" rx="4" fill="#2e3340"/>
|
|
70
81
|
<text x="273.6" y="159" fill="#d0d0d0" xml:space="preserve">[ medium ]</text>
|
|
82
|
+
<rect x="359.4" y="145" width="62.4" height="18" rx="4" fill="#2e3340"/>
|
|
71
83
|
<text x="359.4" y="159" fill="#d0d0d0" xml:space="preserve">[ high ]</text>
|
|
72
|
-
<
|
|
73
|
-
<text x="
|
|
84
|
+
<rect x="445.2" y="145" width="117.0" height="18" rx="4" fill="#2e3340"/>
|
|
85
|
+
<text x="445.2" y="159" fill="#d0d0d0" xml:space="preserve">[ Routing off ]</text>
|
|
86
|
+
<rect x="570.0" y="145" width="70.2" height="18" rx="4" fill="#2e3340"/>
|
|
87
|
+
<text x="570.0" y="159" fill="#d0d0d0" xml:space="preserve">[ 1 row ]</text>
|
|
74
88
|
<text class="cap" x="20" y="198">A pin waits for the next turn; ✕ cancels it</text>
|
|
75
89
|
<rect x="12" y="206" width="897.6" height="29" rx="5" fill="#232323"/>
|
|
76
90
|
<text x="24.0" y="224" fill="#5f9fe0" xml:space="preserve">▂</text>
|
|
77
91
|
<text x="31.8" y="224" fill="#5f9fe0" xml:space="preserve">▄</text>
|
|
78
92
|
<text x="39.6" y="224" fill="#7c7c7c" xml:space="preserve">▆</text>
|
|
79
93
|
<text x="47.4" y="224" fill="#7c7c7c" xml:space="preserve">█</text>
|
|
80
|
-
<
|
|
94
|
+
<rect x="55.2" y="210" width="39.0" height="18" rx="4" fill="#5f9fe0"/>
|
|
95
|
+
<text x="55.2" y="224" fill="#0d1016" font-weight="700" xml:space="preserve"> low </text>
|
|
81
96
|
<text x="94.2" y="224" fill="#d0d0d0" xml:space="preserve">Haiku 5.5 · high</text>
|
|
82
97
|
<text x="219.0" y="224" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
83
|
-
<
|
|
84
|
-
<text x="
|
|
85
|
-
<text x="
|
|
86
|
-
<text x="
|
|
87
|
-
<text x="
|
|
88
|
-
<text x="
|
|
89
|
-
<text x="
|
|
90
|
-
<text x="
|
|
91
|
-
<text x="
|
|
92
|
-
<text
|
|
93
|
-
<text x="718.2" y="224" fill="#d0d0d0" xml:space="preserve">Router</text>
|
|
94
|
-
<text class="cap" x="20" y="263">No classifier key: Router keeps the model and offers Set up</text>
|
|
98
|
+
<rect x="258.0" y="210" width="117.0" height="18" rx="4" fill="#2e3340"/>
|
|
99
|
+
<text x="258.0" y="224" fill="#d0d0d0" xml:space="preserve">[ Routing off ]</text>
|
|
100
|
+
<text x="375.0" y="224" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
101
|
+
<text x="414.0" y="224" fill="#7c9cff" xml:space="preserve">⏵ next turn: </text>
|
|
102
|
+
<text x="515.4" y="224" fill="#d7af5f" font-weight="700" xml:space="preserve">medium</text>
|
|
103
|
+
<text x="570.0" y="224" fill="#d0d0d0" xml:space="preserve">✕</text>
|
|
104
|
+
<text x="577.8" y="224" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
105
|
+
<text x="616.8" y="224" fill="#7c7c7c" xml:space="preserve">= fits</text>
|
|
106
|
+
<text x="679.2" y="224" fill="#d0d0d0" xml:space="preserve">Router</text>
|
|
107
|
+
<text class="cap" x="20" y="263">No classifier key: routing keeps the model and offers Set up</text>
|
|
95
108
|
<rect x="12" y="271" width="897.6" height="29" rx="5" fill="#232323"/>
|
|
96
|
-
<text x="24.0" y="289" fill="#
|
|
109
|
+
<text x="24.0" y="289" fill="#f0b429" xml:space="preserve">⚠ Jev: no API key</text>
|
|
97
110
|
<text x="156.6" y="289" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
98
|
-
<
|
|
111
|
+
<rect x="195.6" y="275" width="78.0" height="18" rx="4" fill="#87afff"/>
|
|
112
|
+
<text x="195.6" y="289" fill="#0d1016" font-weight="700" xml:space="preserve">[ Set up ]</text>
|
|
99
113
|
<text x="273.6" y="289" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
100
114
|
<text x="312.6" y="289" fill="#5f9fe0" xml:space="preserve">▂</text>
|
|
101
115
|
<text x="320.4" y="289" fill="#5f9fe0" xml:space="preserve">▄</text>
|
|
102
116
|
<text x="328.2" y="289" fill="#7c7c7c" xml:space="preserve">▆</text>
|
|
103
117
|
<text x="336.0" y="289" fill="#7c7c7c" xml:space="preserve">█</text>
|
|
104
|
-
<
|
|
118
|
+
<rect x="343.8" y="275" width="39.0" height="18" rx="4" fill="#5f9fe0"/>
|
|
119
|
+
<text x="343.8" y="289" fill="#0d1016" font-weight="700" xml:space="preserve"> low </text>
|
|
105
120
|
<text x="382.8" y="289" fill="#d0d0d0" xml:space="preserve">Haiku 5.5 · high</text>
|
|
106
121
|
<text x="507.6" y="289" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
107
|
-
<text x="546.6" y="289" fill="#
|
|
122
|
+
<text x="546.6" y="289" fill="#f0b429" xml:space="preserve">keeping model</text>
|
|
108
123
|
<text x="663.6" y="289" fill="#d0d0d0" xml:space="preserve">Router</text>
|
|
109
|
-
<text class="cap" x="20" y="328">
|
|
124
|
+
<text class="cap" x="20" y="328">Routing off: /model chose the model; Routing on resumes routing</text>
|
|
110
125
|
<rect x="12" y="336" width="897.6" height="29" rx="5" fill="#232323"/>
|
|
111
126
|
<text x="24.0" y="354" fill="#7c7c7c" xml:space="preserve">○ </text>
|
|
112
|
-
<text x="39.6" y="354" fill="#d0d0d0" xml:space="preserve">
|
|
113
|
-
<
|
|
114
|
-
<text x="
|
|
115
|
-
<text x="
|
|
116
|
-
<text x="351.6" y="354" fill="#7c7c7c" xml:space="preserve">
|
|
117
|
-
<text x="
|
|
118
|
-
<
|
|
127
|
+
<text x="39.6" y="354" fill="#d0d0d0" xml:space="preserve">Routing </text>
|
|
128
|
+
<rect x="102.0" y="340" width="23.4" height="18" rx="4" fill="#2a3040"/>
|
|
129
|
+
<text x="102.0" y="354" fill="#8b93a7" xml:space="preserve">off</text>
|
|
130
|
+
<text x="125.4" y="354" fill="#d0d0d0" xml:space="preserve"> · every turn uses Sonnet 5.5</text>
|
|
131
|
+
<text x="351.6" y="354" fill="#7c7c7c" xml:space="preserve"> (/model)</text>
|
|
132
|
+
<text x="421.8" y="354" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
133
|
+
<rect x="460.8" y="340" width="109.2" height="18" rx="4" fill="#87afff"/>
|
|
134
|
+
<text x="460.8" y="354" fill="#0d1016" font-weight="700" xml:space="preserve">[ Routing on ]</text>
|
|
135
|
+
<text x="585.6" y="354" fill="#d0d0d0" xml:space="preserve">Router</text>
|
|
119
136
|
</svg>
|
|
@@ -7,33 +7,47 @@
|
|
|
7
7
|
</style>
|
|
8
8
|
<rect width="899" height="401" rx="8" fill="#1c1c1c"/>
|
|
9
9
|
<rect x="10" y="10" width="879" height="381" rx="6" fill="none" stroke="#3f5f8f"/>
|
|
10
|
-
<text x="24.0" y="34" fill="#5fafd7" font-weight="700" xml:space="preserve">
|
|
11
|
-
<text x="
|
|
12
|
-
<
|
|
13
|
-
<text x="
|
|
14
|
-
<
|
|
10
|
+
<text x="24.0" y="34" fill="#5fafd7" font-weight="700" xml:space="preserve">ROUTING · on</text>
|
|
11
|
+
<text x="141.0" y="34" fill="#87d787" xml:space="preserve">Clef Flash ready</text>
|
|
12
|
+
<rect x="24.0" y="39" width="109.2" height="18" rx="4" fill="#87afff"/>
|
|
13
|
+
<text x="24.0" y="53" fill="#0d1016" font-weight="700" xml:space="preserve">[ Routing on ]</text>
|
|
14
|
+
<rect x="141.0" y="39" width="117.0" height="18" rx="4" fill="#2e3340"/>
|
|
15
|
+
<text x="141.0" y="53" fill="#d0d0d0" xml:space="preserve">[ Routing off ]</text>
|
|
16
|
+
<text x="258.0" y="53" fill="#7c7c7c" xml:space="preserve"> Routing off keeps the /model choice</text>
|
|
17
|
+
<rect x="24.0" y="58" width="54.6" height="18" rx="4" fill="#2e3340"/>
|
|
15
18
|
<text x="24.0" y="72" fill="#d0d0d0" xml:space="preserve">[ Now ]</text>
|
|
19
|
+
<rect x="86.4" y="58" width="85.8" height="18" rx="4" fill="#2e3340"/>
|
|
16
20
|
<text x="86.4" y="72" fill="#d0d0d0" xml:space="preserve">[ Routing ]</text>
|
|
17
|
-
<
|
|
21
|
+
<rect x="180.0" y="58" width="109.2" height="18" rx="4" fill="#87afff"/>
|
|
22
|
+
<text x="180.0" y="72" fill="#0d1016" font-weight="700" xml:space="preserve">[ Classifier ]</text>
|
|
23
|
+
<rect x="297.0" y="58" width="70.2" height="18" rx="4" fill="#2e3340"/>
|
|
18
24
|
<text x="297.0" y="72" fill="#d0d0d0" xml:space="preserve">[ Usage ]</text>
|
|
25
|
+
<rect x="375.0" y="58" width="39.0" height="18" rx="4" fill="#2e3340"/>
|
|
19
26
|
<text x="375.0" y="72" fill="#d0d0d0" xml:space="preserve">[ ? ]</text>
|
|
20
27
|
<text x="24.0" y="110" fill="#5fafd7" font-weight="700" xml:space="preserve">CLASSIFIER</text>
|
|
21
28
|
<text x="102.0" y="110" fill="#7c7c7c" xml:space="preserve"> · applies next turn · saves at once</text>
|
|
22
29
|
<text x="24.0" y="129" fill="#7c7c7c" xml:space="preserve">Asked once per new turn.</text>
|
|
30
|
+
<rect x="24.0" y="134" width="132.6" height="18" rx="4" fill="#2e3340"/>
|
|
23
31
|
<text x="24.0" y="148" fill="#d0d0d0" xml:space="preserve">[ ○ Jev ]</text>
|
|
24
32
|
<text x="164.4" y="148" fill="#7c7c7c" xml:space="preserve">api.typesafe.ai</text>
|
|
25
33
|
<text x="320.4" y="148" fill="#d7af5f" xml:space="preserve">○ no API key </text>
|
|
34
|
+
<rect x="429.6" y="134" width="78.0" height="18" rx="4" fill="#2e3340"/>
|
|
26
35
|
<text x="429.6" y="148" fill="#d0d0d0" xml:space="preserve">[ Set up ]</text>
|
|
36
|
+
<rect x="24.0" y="153" width="132.6" height="18" rx="4" fill="#2e3340"/>
|
|
27
37
|
<text x="24.0" y="167" fill="#d0d0d0" xml:space="preserve">[ ○ Clef ]</text>
|
|
28
38
|
<text x="164.4" y="167" fill="#7c7c7c" xml:space="preserve">api.cloudflare.com</text>
|
|
29
39
|
<text x="320.4" y="167" fill="#87d787" xml:space="preserve">● ready</text>
|
|
30
|
-
<
|
|
40
|
+
<rect x="24.0" y="172" width="132.6" height="18" rx="4" fill="#87afff"/>
|
|
41
|
+
<text x="24.0" y="186" fill="#0d1016" font-weight="700" xml:space="preserve">[ ◉ Clef Flash ]</text>
|
|
31
42
|
<text x="164.4" y="186" fill="#7c7c7c" xml:space="preserve">api.cloudflare.com</text>
|
|
32
43
|
<text x="320.4" y="186" fill="#87d787" xml:space="preserve">● ready</text>
|
|
44
|
+
<rect x="24.0" y="191" width="132.6" height="18" rx="4" fill="#2e3340"/>
|
|
33
45
|
<text x="24.0" y="205" fill="#d0d0d0" xml:space="preserve">[ ○ OpenAI ]</text>
|
|
34
46
|
<text x="164.4" y="205" fill="#7c7c7c" xml:space="preserve">api.openai.com</text>
|
|
35
47
|
<text x="320.4" y="205" fill="#d7af5f" xml:space="preserve">○ no API key </text>
|
|
48
|
+
<rect x="429.6" y="191" width="78.0" height="18" rx="4" fill="#2e3340"/>
|
|
36
49
|
<text x="429.6" y="205" fill="#d0d0d0" xml:space="preserve">[ Set up ]</text>
|
|
50
|
+
<rect x="24.0" y="210" width="132.6" height="18" rx="4" fill="#2e3340"/>
|
|
37
51
|
<text x="24.0" y="224" fill="#d0d0d0" xml:space="preserve">[ ○ Ollama ]</text>
|
|
38
52
|
<text x="164.4" y="224" fill="#7c7c7c" xml:space="preserve">127.0.0.1:11434</text>
|
|
39
53
|
<text x="320.4" y="224" fill="#87d787" xml:space="preserve">● ready</text>
|
|
@@ -43,10 +57,13 @@
|
|
|
43
57
|
<text x="24.0" y="262" fill="#d0d0d0" xml:space="preserve">Health active · 0 recent failures</text>
|
|
44
58
|
<text x="24.0" y="281" fill="#7c7c7c" xml:space="preserve">Sends prompt + 6 recent turns → api.cloudflare.com</text>
|
|
45
59
|
<text x="24.0" y="300" fill="#d0d0d0" xml:space="preserve">Credentials </text>
|
|
60
|
+
<rect x="125.4" y="286" width="62.4" height="18" rx="4" fill="#2e3340"/>
|
|
46
61
|
<text x="125.4" y="300" fill="#d0d0d0" xml:space="preserve">[ Edit ]</text>
|
|
47
62
|
<text x="187.8" y="300" fill="#7c7c7c" xml:space="preserve"> opens /plugin configure</text>
|
|
48
63
|
<text x="24.0" y="319" fill="#7c7c7c" xml:space="preserve"> Jev: API key · Clef, Clef Flash: API token, account ID · OpenAI: API key · Ollama: no key needed</text>
|
|
49
64
|
<text x="24.0" y="357" fill="#87d787" xml:space="preserve">Saved: classifier Clef → Clef Flash. Applies from the next turn. </text>
|
|
65
|
+
<rect x="538.8" y="343" width="62.4" height="18" rx="4" fill="#2e3340"/>
|
|
50
66
|
<text x="538.8" y="357" fill="#d0d0d0" xml:space="preserve">[ Undo ]</text>
|
|
67
|
+
<rect x="24.0" y="362" width="70.2" height="18" rx="4" fill="#2e3340"/>
|
|
51
68
|
<text x="24.0" y="376" fill="#d0d0d0" xml:space="preserve">[ Close ]</text>
|
|
52
69
|
</svg>
|
package/docs/router-pane-now.svg
CHANGED
|
@@ -7,15 +7,22 @@
|
|
|
7
7
|
</style>
|
|
8
8
|
<rect width="594" height="496" rx="8" fill="#1c1c1c"/>
|
|
9
9
|
<rect x="10" y="10" width="574" height="476" rx="6" fill="none" stroke="#3f5f8f"/>
|
|
10
|
-
<text x="24.0" y="34" fill="#5fafd7" font-weight="700" xml:space="preserve">
|
|
11
|
-
<text x="
|
|
12
|
-
<
|
|
13
|
-
<text x="
|
|
14
|
-
<
|
|
15
|
-
<text x="
|
|
10
|
+
<text x="24.0" y="34" fill="#5fafd7" font-weight="700" xml:space="preserve">ROUTING · on</text>
|
|
11
|
+
<text x="141.0" y="34" fill="#87d787" xml:space="preserve">Jev ready · 347 ms</text>
|
|
12
|
+
<rect x="24.0" y="39" width="109.2" height="18" rx="4" fill="#87afff"/>
|
|
13
|
+
<text x="24.0" y="53" fill="#0d1016" font-weight="700" xml:space="preserve">[ Routing on ]</text>
|
|
14
|
+
<rect x="141.0" y="39" width="117.0" height="18" rx="4" fill="#2e3340"/>
|
|
15
|
+
<text x="141.0" y="53" fill="#d0d0d0" xml:space="preserve">[ Routing off ]</text>
|
|
16
|
+
<text x="258.0" y="53" fill="#7c7c7c" xml:space="preserve"> Routing off keeps the /model choice</text>
|
|
17
|
+
<rect x="24.0" y="58" width="54.6" height="18" rx="4" fill="#87afff"/>
|
|
18
|
+
<text x="24.0" y="72" fill="#0d1016" font-weight="700" xml:space="preserve">[ Now ]</text>
|
|
19
|
+
<rect x="86.4" y="58" width="85.8" height="18" rx="4" fill="#2e3340"/>
|
|
16
20
|
<text x="86.4" y="72" fill="#d0d0d0" xml:space="preserve">[ Routing ]</text>
|
|
21
|
+
<rect x="180.0" y="58" width="109.2" height="18" rx="4" fill="#2e3340"/>
|
|
17
22
|
<text x="180.0" y="72" fill="#d0d0d0" xml:space="preserve">[ Classifier ]</text>
|
|
23
|
+
<rect x="297.0" y="58" width="70.2" height="18" rx="4" fill="#2e3340"/>
|
|
18
24
|
<text x="297.0" y="72" fill="#d0d0d0" xml:space="preserve">[ Usage ]</text>
|
|
25
|
+
<rect x="375.0" y="58" width="39.0" height="18" rx="4" fill="#2e3340"/>
|
|
19
26
|
<text x="375.0" y="72" fill="#d0d0d0" xml:space="preserve">[ ? ]</text>
|
|
20
27
|
<text x="24.0" y="110" fill="#d0d0d0" xml:space="preserve">Now </text>
|
|
21
28
|
<text x="78.6" y="110" fill="#e0708a" font-weight="700" xml:space="preserve">▌high </text>
|
|
@@ -29,21 +36,25 @@
|
|
|
29
36
|
<text x="102.0" y="205" fill="#d0d0d0" xml:space="preserve">Opus 5.5 · xhigh </text>
|
|
30
37
|
<text x="273.6" y="205" fill="#e0708a" xml:space="preserve">█████████░</text>
|
|
31
38
|
<text x="351.6" y="205" fill="#d0d0d0" xml:space="preserve"> 88% </text>
|
|
39
|
+
<rect x="406.2" y="191" width="54.6" height="18" rx="4" fill="#2e3340"/>
|
|
32
40
|
<text x="406.2" y="205" fill="#d0d0d0" xml:space="preserve">[ pin ]</text>
|
|
33
41
|
<text x="39.6" y="224" fill="#d7af5f" font-weight="700" xml:space="preserve">medium </text>
|
|
34
42
|
<text x="102.0" y="224" fill="#d0d0d0" xml:space="preserve">Opus 5.5 · medium </text>
|
|
35
43
|
<text x="273.6" y="224" fill="#d7af5f" xml:space="preserve">█░░░░░░░░░</text>
|
|
36
44
|
<text x="351.6" y="224" fill="#d0d0d0" xml:space="preserve"> 7% </text>
|
|
45
|
+
<rect x="406.2" y="210" width="54.6" height="18" rx="4" fill="#2e3340"/>
|
|
37
46
|
<text x="406.2" y="224" fill="#d0d0d0" xml:space="preserve">[ pin ]</text>
|
|
38
47
|
<text x="39.6" y="243" fill="#5f9fe0" font-weight="700" xml:space="preserve">low </text>
|
|
39
48
|
<text x="102.0" y="243" fill="#d0d0d0" xml:space="preserve">Haiku 5.5 · high </text>
|
|
40
49
|
<text x="273.6" y="243" fill="#5f9fe0" xml:space="preserve">░░░░░░░░░░</text>
|
|
41
50
|
<text x="351.6" y="243" fill="#d0d0d0" xml:space="preserve"> 3% </text>
|
|
51
|
+
<rect x="406.2" y="229" width="54.6" height="18" rx="4" fill="#2e3340"/>
|
|
42
52
|
<text x="406.2" y="243" fill="#d0d0d0" xml:space="preserve">[ pin ]</text>
|
|
43
53
|
<text x="39.6" y="262" fill="#5fd7af" font-weight="700" xml:space="preserve">micro </text>
|
|
44
54
|
<text x="102.0" y="262" fill="#d0d0d0" xml:space="preserve">Haiku 5.5 · medium </text>
|
|
45
55
|
<text x="273.6" y="262" fill="#5fd7af" xml:space="preserve">░░░░░░░░░░</text>
|
|
46
56
|
<text x="351.6" y="262" fill="#d0d0d0" xml:space="preserve"> 2% </text>
|
|
57
|
+
<rect x="406.2" y="248" width="54.6" height="18" rx="4" fill="#2e3340"/>
|
|
47
58
|
<text x="406.2" y="262" fill="#d0d0d0" xml:space="preserve">[ pin ]</text>
|
|
48
59
|
<text x="24.0" y="281" fill="#7c7c7c" xml:space="preserve"> switch needs 82% · Jev gave 88% up · tax ≈ $0.48</text>
|
|
49
60
|
<text x="24.0" y="300" fill="#7c7c7c" xml:space="preserve"> Pins serve the next turn only.</text>
|
|
@@ -82,5 +93,6 @@
|
|
|
82
93
|
<text x="24.0" y="452" fill="#d0d0d0" xml:space="preserve">Cost $18.003 </text>
|
|
83
94
|
<text x="156.6" y="452" fill="#7c7c7c" xml:space="preserve">by Claude</text>
|
|
84
95
|
<text x="226.8" y="452" fill="#d0d0d0" xml:space="preserve"> · cache saved ≈ $1.52</text>
|
|
96
|
+
<rect x="24.0" y="457" width="70.2" height="18" rx="4" fill="#2e3340"/>
|
|
85
97
|
<text x="24.0" y="471" fill="#d0d0d0" xml:space="preserve">[ Close ]</text>
|
|
86
98
|
</svg>
|
|
@@ -7,15 +7,22 @@
|
|
|
7
7
|
</style>
|
|
8
8
|
<rect width="594" height="686" rx="8" fill="#1c1c1c"/>
|
|
9
9
|
<rect x="10" y="10" width="574" height="666" rx="6" fill="none" stroke="#3f5f8f"/>
|
|
10
|
-
<text x="24.0" y="34" fill="#5fafd7" font-weight="700" xml:space="preserve">
|
|
11
|
-
<text x="
|
|
12
|
-
<
|
|
13
|
-
<text x="
|
|
14
|
-
<
|
|
10
|
+
<text x="24.0" y="34" fill="#5fafd7" font-weight="700" xml:space="preserve">ROUTING · on</text>
|
|
11
|
+
<text x="141.0" y="34" fill="#87d787" xml:space="preserve">Jev ready · 347 ms</text>
|
|
12
|
+
<rect x="24.0" y="39" width="109.2" height="18" rx="4" fill="#87afff"/>
|
|
13
|
+
<text x="24.0" y="53" fill="#0d1016" font-weight="700" xml:space="preserve">[ Routing on ]</text>
|
|
14
|
+
<rect x="141.0" y="39" width="117.0" height="18" rx="4" fill="#2e3340"/>
|
|
15
|
+
<text x="141.0" y="53" fill="#d0d0d0" xml:space="preserve">[ Routing off ]</text>
|
|
16
|
+
<text x="258.0" y="53" fill="#7c7c7c" xml:space="preserve"> Routing off keeps the /model choice</text>
|
|
17
|
+
<rect x="24.0" y="58" width="54.6" height="18" rx="4" fill="#2e3340"/>
|
|
15
18
|
<text x="24.0" y="72" fill="#d0d0d0" xml:space="preserve">[ Now ]</text>
|
|
16
|
-
<
|
|
19
|
+
<rect x="86.4" y="58" width="101.4" height="18" rx="4" fill="#87afff"/>
|
|
20
|
+
<text x="86.4" y="72" fill="#0d1016" font-weight="700" xml:space="preserve">[ Routing ● ]</text>
|
|
21
|
+
<rect x="195.6" y="58" width="109.2" height="18" rx="4" fill="#2e3340"/>
|
|
17
22
|
<text x="195.6" y="72" fill="#d0d0d0" xml:space="preserve">[ Classifier ]</text>
|
|
23
|
+
<rect x="312.6" y="58" width="70.2" height="18" rx="4" fill="#2e3340"/>
|
|
18
24
|
<text x="312.6" y="72" fill="#d0d0d0" xml:space="preserve">[ Usage ]</text>
|
|
25
|
+
<rect x="390.6" y="58" width="39.0" height="18" rx="4" fill="#2e3340"/>
|
|
19
26
|
<text x="390.6" y="72" fill="#d0d0d0" xml:space="preserve">[ ? ]</text>
|
|
20
27
|
<text x="24.0" y="110" fill="#5fafd7" font-weight="700" xml:space="preserve">ROUTES</text>
|
|
21
28
|
<text x="70.8" y="110" fill="#7c7c7c" xml:space="preserve"> · applies next turn · edit, then Save</text>
|
|
@@ -53,6 +60,7 @@
|
|
|
53
60
|
<text x="24.0" y="319" fill="#7c7c7c" xml:space="preserve">· </text>
|
|
54
61
|
<text x="39.6" y="319" fill="#d0d0d0" xml:space="preserve">micro → low </text>
|
|
55
62
|
<text x="164.4" y="319" fill="#d0d0d0" xml:space="preserve">same model, new effort: priced as a new cache</text>
|
|
63
|
+
<rect x="24.0" y="324" width="218.4" height="18" rx="4" fill="#2e3340"/>
|
|
56
64
|
<text x="24.0" y="338" fill="#d0d0d0" xml:space="preserve">[ Reset routes to defaults ]</text>
|
|
57
65
|
<text x="24.0" y="357" fill="#7c7c7c" xml:space="preserve">A new model ID needs router.json → models: price, window, efforts.</text>
|
|
58
66
|
<text x="24.0" y="395" fill="#5fafd7" font-weight="700" xml:space="preserve">POLICY</text>
|
|
@@ -66,16 +74,21 @@
|
|
|
66
74
|
<text x="24.0" y="452" fill="#d0d0d0" xml:space="preserve">Credits cap</text>
|
|
67
75
|
<text x="180.0" y="452" fill="#d0d0d0" xml:space="preserve">$2.00 ▾</text>
|
|
68
76
|
<text x="289.2" y="452" fill="#7c7c7c" xml:space="preserve">max cold write on credits</text>
|
|
77
|
+
<rect x="24.0" y="457" width="218.4" height="18" rx="4" fill="#2e3340"/>
|
|
69
78
|
<text x="24.0" y="471" fill="#d0d0d0" xml:space="preserve">[ Reset policy to defaults ]</text>
|
|
70
79
|
<text x="24.0" y="509" fill="#5fafd7" font-weight="700" xml:space="preserve">CONFIG</text>
|
|
71
80
|
<text x="24.0" y="528" fill="#d0d0d0" xml:space="preserve">File ~/.claude/router.json </text>
|
|
81
|
+
<rect x="273.6" y="514" width="62.4" height="18" rx="4" fill="#2e3340"/>
|
|
72
82
|
<text x="273.6" y="528" fill="#d0d0d0" xml:space="preserve">[ copy ]</text>
|
|
73
83
|
<text x="24.0" y="547" fill="#7c7c7c" xml:space="preserve">Main conversation only. Subagents keep their own model.</text>
|
|
74
84
|
<text x="24.0" y="585" fill="#7c7c7c" xml:space="preserve">router.json changes:</text>
|
|
75
85
|
<text x="24.0" y="604" fill="#e06c6c" xml:space="preserve">- routes.medium Opus 5.5 · medium</text>
|
|
76
86
|
<text x="24.0" y="623" fill="#87d787" xml:space="preserve">+ routes.medium Sonnet 5.5 · xhigh</text>
|
|
77
87
|
<text x="24.0" y="642" fill="#d7af5f" xml:space="preserve">● 1 unsaved routing change </text>
|
|
78
|
-
<
|
|
88
|
+
<rect x="242.4" y="628" width="62.4" height="18" rx="4" fill="#87afff"/>
|
|
89
|
+
<text x="242.4" y="642" fill="#0d1016" font-weight="700" xml:space="preserve">[ Save ]</text>
|
|
90
|
+
<rect x="312.6" y="628" width="85.8" height="18" rx="4" fill="#2e3340"/>
|
|
79
91
|
<text x="312.6" y="642" fill="#d0d0d0" xml:space="preserve">[ Discard ]</text>
|
|
92
|
+
<rect x="24.0" y="647" width="70.2" height="18" rx="4" fill="#2e3340"/>
|
|
80
93
|
<text x="24.0" y="661" fill="#d0d0d0" xml:space="preserve">[ Close ]</text>
|
|
81
94
|
</svg>
|
package/docs/user-guide.md
CHANGED
|
@@ -9,7 +9,7 @@ claude plugin marketplace add alexei-led/claude-router
|
|
|
9
9
|
claude plugin install router@alexei-led-claude-router
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Start with the full baseline model so
|
|
12
|
+
Start with the full baseline model so routing has a known starting point:
|
|
13
13
|
|
|
14
14
|
```sh
|
|
15
15
|
claude --model claude-haiku-5-5
|
|
@@ -24,7 +24,7 @@ In Claude Code:
|
|
|
24
24
|
- **OpenAI**: an OpenAI API key. The prompt text goes to OpenAI.
|
|
25
25
|
- **Ollama**: no credential. Run `ollama serve` and pull the model; the prompt text stays on this machine.
|
|
26
26
|
3. To use another classifier, open the pane's **Classifier** tab and select its row. See [Choose the classifier](#choose-the-classifier).
|
|
27
|
-
4. Check the band above the prompt:
|
|
27
|
+
4. Check the band above the prompt: `Routing on · ready`. On a model that no tier routes to, the session starts with routing off and the band says why; run `/router auto` to route.
|
|
28
28
|
|
|
29
29
|
Keys are stored as sensitive plugin options. Do not paste them into a model conversation. The [configuration guide](configuration.md) covers optional settings and migrations.
|
|
30
30
|
|
|
@@ -32,7 +32,7 @@ Keys are stored as sensitive plugin options. Do not paste them into a model conv
|
|
|
32
32
|
|
|
33
33
|
Router draws one line above the prompt. The line ends with a **Router** button that opens the pane. When the band is narrow, the less important parts drop first: classifier figures, then context and cache, then the reason. The tier and model always stay, except behind a classifier warning: the warning and its **Set up** button come first, and the route gives way to them.
|
|
34
34
|
|
|
35
|
-

|
|
36
36
|
|
|
37
37
|
Read the first line of the picture from left to right:
|
|
38
38
|
|
|
@@ -42,19 +42,19 @@ Read the first line of the picture from left to right:
|
|
|
42
42
|
- **Classifier support**: what the active classifier, such as Jev or Clef Flash, gave the switch against the bar the policy required.
|
|
43
43
|
- **ctx** and **cache**: context use and cache reuse on the last reply. They turn yellow at 60% context and red at 80%.
|
|
44
44
|
|
|
45
|
-
| Band shows | Meaning
|
|
46
|
-
| ------------------------------------------- |
|
|
47
|
-
| `
|
|
48
|
-
| `choosing for this turn…` | The classifier and local policy are running. The spinner says `Choosing model`.
|
|
49
|
-
| `⏵ next turn: high ✕` | A pin is set. **✕** cancels it.
|
|
50
|
-
| `⚠ Jev: no API key · keeping model` | The active classifier lacks a setting. **Set up** opens the secure plugin dialog.
|
|
51
|
-
| `⚠ Clef: no account ID · keeping model` | Clef has its API token but no Cloudflare account ID. **Set up** opens the dialog.
|
|
52
|
-
| `⚠ Jev timed out · keeping model` | The classifier failed: timed out, unreachable, rejected the key, or paused.
|
|
53
|
-
| `○
|
|
54
|
-
| `✕
|
|
55
|
-
| `○ Router · subagents keep their own model` | You are viewing a subagent's transcript, which Router does not route.
|
|
45
|
+
| Band shows | Meaning |
|
|
46
|
+
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
47
|
+
| `Routing on · ready` | Routing is on and ready for a new turn. |
|
|
48
|
+
| `choosing for this turn…` | The classifier and local policy are running. The spinner says `Choosing model`. |
|
|
49
|
+
| `⏵ next turn: high ✕` | A pin is set. **✕** cancels it. |
|
|
50
|
+
| `⚠ Jev: no API key · keeping model` | The active classifier lacks a setting. **Set up** opens the secure plugin dialog. |
|
|
51
|
+
| `⚠ Clef: no account ID · keeping model` | Clef has its API token but no Cloudflare account ID. **Set up** opens the dialog. |
|
|
52
|
+
| `⚠ Jev timed out · keeping model` | The classifier failed: timed out, unreachable, rejected the key, or paused. |
|
|
53
|
+
| `○ Routing off · every turn uses …` | Routing is off: Claude's model answers every turn. **Routing on** turns it back on. The footer also shows `routing off`. |
|
|
54
|
+
| `✕ Routing unavailable` | Nothing routes: an old Claude Code or leftover v0.8 settings. **Fix** opens the pane. |
|
|
55
|
+
| `○ Router · subagents keep their own model` | You are viewing a subagent's transcript, which Router does not route. |
|
|
56
56
|
|
|
57
|
-
Hover over the band for a second row: pin a tier for the next turn,
|
|
57
|
+
The band's **Routing off** button turns routing off, and **Routing on** turns it back on. Hover over the band for a second row: pin a tier for the next turn, or show two rows. The two-row band adds a strip of recent replies colored by tier, the switch count, the switch tax, and the cache saving. Router remembers that choice across sessions. When Router changes the model between turns, a toast reads `Model changed: old → new · reason`. A pin does not raise one, and neither does a change of effort alone.
|
|
58
58
|
|
|
59
59
|
The band steps aside while a survey needs the space.
|
|
60
60
|
|
|
@@ -79,7 +79,7 @@ The **Routing** tab edits the routes and the policy. In the picture, `medium` wa
|
|
|
79
79
|
| 3 Classifier | The classifier rows with their credentials state, the active classifier's deadline and health, and the credentials each classifier needs. |
|
|
80
80
|
| 4 Usage | Claude-reported cost, context and cache detail, input per reply, quota, and configured-price estimates. |
|
|
81
81
|
|
|
82
|
-
**
|
|
82
|
+
**Routing on** and **Routing off** stay at the top of every tab. **?** shows what the estimates leave out.
|
|
83
83
|
|
|
84
84
|
### Save and undo changes
|
|
85
85
|
|
|
@@ -96,7 +96,7 @@ Every write applies from the next turn and can be undone. **Undo** (`u`) puts ba
|
|
|
96
96
|
- **Context** compares the larger available context reading with the routed model's configured window. The router reserves 20% of that window. Values can be unknown when Claude does not provide the needed estimate.
|
|
97
97
|
- **Cache** reuse is cache-read tokens divided by the last response's input counters.
|
|
98
98
|
- **Classifier support**, such as **Jev support**, is the probability the classifier gave each tier on the last classified turn. The line under it compares the support for a switch with the bar the policy required, and shows the estimated switch tax.
|
|
99
|
-
- **Replies** colors each of the last 30 main-conversation replies by the tier that served it. A dot marks a reply the router did not choose, such as one
|
|
99
|
+
- **Replies** colors each of the last 30 main-conversation replies by the tier that served it. A dot marks a reply the router did not choose, such as one with routing off.
|
|
100
100
|
- **Input per reply** scales the last 30 input sizes from the lowest to the highest reading. It is a scale comparison, not a forecast.
|
|
101
101
|
- **Cache read benefit** is a configured-price estimate for cached reads before write costs. It is not a measured saving.
|
|
102
102
|
- **Next-turn difference** compares the candidate with the current model under five-minute and one-hour cache-write scenarios. A negative number means the candidate is estimated to cost less for that request.
|
|
@@ -106,17 +106,17 @@ There is no router-side spend or savings ledger. The pane does not include class
|
|
|
106
106
|
|
|
107
107
|
## Change routing
|
|
108
108
|
|
|
109
|
-
| Command or action | Result
|
|
110
|
-
| ---------------------------------------- |
|
|
111
|
-
| `/router` | Open the pane.
|
|
112
|
-
| `/router auto` | Resume automatic routing.
|
|
113
|
-
| `/router off` |
|
|
114
|
-
| `/router pin <micro\|low\|medium\|high>` | Pin the next turn and its tool continuations.
|
|
115
|
-
| `/model <name>` | Select a model and
|
|
116
|
-
| **
|
|
117
|
-
| **pin** on the Now tab | Pin that tier for the next turn.
|
|
109
|
+
| Command or action | Result |
|
|
110
|
+
| ---------------------------------------- | --------------------------------------------------------------------------------- |
|
|
111
|
+
| `/router` | Open the pane. |
|
|
112
|
+
| `/router auto` | Resume automatic routing. |
|
|
113
|
+
| `/router off` | Turn routing off and keep Claude's selected model. |
|
|
114
|
+
| `/router pin <micro\|low\|medium\|high>` | Pin the next turn and its tool continuations. Routing on must already be enabled. |
|
|
115
|
+
| `/model <name>` | Select a model and turn routing off. Use `/router auto` to turn it back on. |
|
|
116
|
+
| **Routing on** / **Routing off** | The same as `/router auto` and `/router off`. |
|
|
117
|
+
| **pin** on the Now tab | Pin that tier for the next turn. Routing on must already be enabled. |
|
|
118
118
|
|
|
119
|
-
A pin does not change the next turn after the pinned turn finishes. A fresh session on a model that one of the tiers routes to starts
|
|
119
|
+
A pin does not change the next turn after the pinned turn finishes. A fresh session on a model that one of the tiers routes to starts with routing on. A fresh session on any other model starts with routing off. `/clear` starts the new session with routing on. Resuming a saved session restores its saved routing on or off.
|
|
120
120
|
|
|
121
121
|
## Edit routes and policy
|
|
122
122
|
|
|
@@ -198,7 +198,7 @@ To stop routing for a session, run `/router off`. To stop loading the Mod, run `
|
|
|
198
198
|
| Status says `no API key` or `no API token` | The active classifier's plugin option is unset or unavailable to this process. | Select **Set up** in the pane, or run `/plugin configure router`. Save the option and start a new turn. |
|
|
199
199
|
| Status says `no account ID` | Clef or Clef Flash is active without the Cloudflare account ID. | Run `/plugin configure router` and save the Cloudflare account ID. |
|
|
200
200
|
| Route stays on the current model | The classifier timed out, failed, is paused, or network policy refused it. | Read the status band and the pane header. Network policy refusal is not bypassed. |
|
|
201
|
-
| `/model` changed but routing stopped | Choosing a model
|
|
201
|
+
| `/model` changed but routing stopped | Choosing a model turns routing off. | Run `/router auto` to turn routing back on. |
|
|
202
202
|
| Router reports invalid configuration | `router.json` is invalid, or project/local settings redirect the router profile. | Inspect `router.json`, remove project/local `HOME` or `CLAUDE_CONFIG_DIR` overrides, or run the [migration command](configuration.md#convert-an-older-routerjson). |
|
|
203
203
|
| Router says old settings need migration | `router.json` still contains v0.8 gateway keys or the 1.1 `jev` section. | Run the [migration command](configuration.md#convert-an-older-routerjson). |
|
|
204
204
|
| `⚠ OpenAI rejected the key · keeping model` | The OpenAI key is wrong, revoked, or lacks access to `gpt-6-luna`. | Run `/plugin configure router` and save a valid OpenAI API key. |
|
package/hooks/native-router.mjs
CHANGED
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
GATEWAY_CLEANUP,
|
|
23
23
|
GATEWAY_SETTINGS,
|
|
24
24
|
missingCredentials,
|
|
25
|
+
NOT_A_TIER_REASON,
|
|
25
26
|
} from '../lib/display.mjs';
|
|
26
27
|
import { clip } from '../lib/facts.mjs';
|
|
27
28
|
import { renderPanel, routeDraftOf, routingChanges } from '../lib/panel.mjs';
|
|
@@ -95,13 +96,20 @@ async function modeOf($, router, fallback = 'auto') {
|
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
|
|
98
|
-
// A saved preference wins; a fresh session starts
|
|
99
|
+
// A saved preference wins; a fresh session starts with routing on for a model some tier routes to, and off for any other.
|
|
99
100
|
async function startMode($, router, model) {
|
|
100
101
|
const mode = await modeOf($, router, tierForModel(router.config, model) === null ? 'manual' : 'auto');
|
|
101
102
|
router.modes.set(await $.session.id(), mode);
|
|
102
103
|
return mode;
|
|
103
104
|
}
|
|
104
105
|
|
|
106
|
+
// A fresh Manual start on a non-tier model gets a reason the band can show; a saved mode carries none.
|
|
107
|
+
async function startView($, router, model) {
|
|
108
|
+
const fresh = (await modeOf($, router, null)) === null;
|
|
109
|
+
const mode = await startMode($, router, model);
|
|
110
|
+
return fresh && mode === 'manual' ? { mode, reason: NOT_A_TIER_REASON } : { mode };
|
|
111
|
+
}
|
|
112
|
+
|
|
105
113
|
async function rememberMode($, mode) {
|
|
106
114
|
try {
|
|
107
115
|
await $.store.set(`${MODE_PREFIX}${await $.session.id()}`, mode);
|
|
@@ -133,7 +141,7 @@ async function changeMode($, router, mode) {
|
|
|
133
141
|
mode,
|
|
134
142
|
pendingPin: null,
|
|
135
143
|
phase: view.phase === 'unavailable' ? 'unavailable' : mode === 'manual' ? 'manual' : 'ready',
|
|
136
|
-
reason: mode === 'manual' ? 'routing
|
|
144
|
+
reason: mode === 'manual' ? 'routing off' : 'ready',
|
|
137
145
|
...(!saved ? { notice: 'Mode changed for this session. Resume preference could not be saved.' } : {}),
|
|
138
146
|
});
|
|
139
147
|
}
|
|
@@ -142,7 +150,7 @@ async function setPin($, router, tier) {
|
|
|
142
150
|
const view = router.view ?? (await readView($, router));
|
|
143
151
|
if (view.phase === 'unavailable') return `Routing unavailable: ${view.error}.`;
|
|
144
152
|
const mode = await modeOf($, router, view.mode);
|
|
145
|
-
if (mode === 'manual') return 'Routing is
|
|
153
|
+
if (mode === 'manual') return 'Routing is off. Turn routing on before pinning a turn.';
|
|
146
154
|
await updateView($, router, { pendingPin: tier });
|
|
147
155
|
return `${tier} pinned for the next turn and its tool continuations.`;
|
|
148
156
|
}
|
|
@@ -223,7 +231,7 @@ async function saveConfig($, path, change) {
|
|
|
223
231
|
function detailText(config, view) {
|
|
224
232
|
const missing = missingCredentials(config, view, config.classifier);
|
|
225
233
|
return [
|
|
226
|
-
`Router — ${view.mode === 'auto' ? '
|
|
234
|
+
`Router — routing ${view.mode === 'auto' ? 'on' : 'off'}`,
|
|
227
235
|
`Native model: ${view.nativeModel}`,
|
|
228
236
|
`Selected: ${view.selectedModel ?? 'not selected'}`,
|
|
229
237
|
`Observed: ${view.actualModel ?? 'no response yet'}`,
|
|
@@ -232,7 +240,7 @@ function detailText(config, view) {
|
|
|
232
240
|
`Context: ${view.contextKnown ? `${view.contextTokens} tokens (estimate)` : 'unknown'}`,
|
|
233
241
|
`Observed cache: ${view.cacheRead ?? 'unknown'} read, ${view.cacheWrite ?? 'unknown'} written tokens`,
|
|
234
242
|
view.pendingPin ? `Next turn pin: ${view.pendingPin}` : 'No next-turn pin.',
|
|
235
|
-
'
|
|
243
|
+
'Routing on picks a model for each turn. Routing off keeps Claude’s model. Pins serve one turn only.',
|
|
236
244
|
'Cache lifetime is an estimate. Claude’s cost ledger owns session totals.',
|
|
237
245
|
...(view.error === GATEWAY_SETTINGS ? GATEWAY_CLEANUP : []),
|
|
238
246
|
].join('\n');
|
|
@@ -562,7 +570,7 @@ export function register(on, options) {
|
|
|
562
570
|
Boolean(base?.includes('127.0.0.1:43170') || base?.includes('localhost:43170'));
|
|
563
571
|
await updateView($, router, {
|
|
564
572
|
nativeModel: model,
|
|
565
|
-
|
|
573
|
+
...(await startView($, router, model)),
|
|
566
574
|
phase: gateway || !supported ? 'unavailable' : 'ready',
|
|
567
575
|
error: !supported ? 'requires Claude Code 2.1.289 or newer' : gateway ? GATEWAY_SETTINGS : null,
|
|
568
576
|
...(sameClassifier ? {} : CLEARED_READINGS),
|
|
@@ -608,7 +616,7 @@ export function register(on, options) {
|
|
|
608
616
|
const [action, tier] = e.args.trim().split(/\s+/);
|
|
609
617
|
if (action === 'auto' || action === 'off') {
|
|
610
618
|
await changeMode($, router, action === 'auto' ? 'auto' : 'manual');
|
|
611
|
-
return { text: action === 'auto' ? '
|
|
619
|
+
return { text: action === 'auto' ? 'Routing on.' : 'Routing off: Claude’s model is kept.' };
|
|
612
620
|
}
|
|
613
621
|
if (action === 'pin')
|
|
614
622
|
return { text: TIERS.includes(tier) ? await setPin($, router, tier) : `Choose ${TIERS.join(', ')}.` };
|
|
@@ -771,9 +779,9 @@ export function register(on, options) {
|
|
|
771
779
|
const view = await readView($, router);
|
|
772
780
|
const label =
|
|
773
781
|
view.phase === 'unavailable'
|
|
774
|
-
? '
|
|
782
|
+
? 'routing unavailable'
|
|
775
783
|
: (await modeOf($, router, view.mode)) === 'manual'
|
|
776
|
-
? '
|
|
784
|
+
? 'routing off'
|
|
777
785
|
: null;
|
|
778
786
|
return label ? next({ ...e, props: { ...e.props, modes: [...e.props.modes, label] } }) : next(e);
|
|
779
787
|
});
|
package/lib/band.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
classifierWarns,
|
|
6
6
|
GATEWAY_SETTINGS,
|
|
7
7
|
modelName,
|
|
8
|
+
NOT_A_TIER_REASON,
|
|
8
9
|
percent,
|
|
9
10
|
routeLabel,
|
|
10
11
|
SHORT_REASONS,
|
|
@@ -20,7 +21,12 @@ const SEPARATOR = ' · ';
|
|
|
20
21
|
const ROUTER_BUTTON = 8;
|
|
21
22
|
const STRIP = 20;
|
|
22
23
|
|
|
24
|
+
// Hex, like TIER_COLOR, so every surface draws the same shades. Yellow stays out: it marks a fault that needs action.
|
|
25
|
+
const COLOR = { accent: '#7c9cff', off: '#2a3040', muted: '#8b93a7', warn: '#f0b429', ink: '#0d1016' };
|
|
26
|
+
|
|
23
27
|
const part = (text, style = {}) => ({ text, style });
|
|
28
|
+
// A filled chip: the text on a background, as the prototype's status pills.
|
|
29
|
+
const pill = (text, background) => part(` ${text} `, { backgroundColor: background, color: COLOR.ink, bold: true });
|
|
24
30
|
const button = (props) => ({ button: props });
|
|
25
31
|
// `priority` 0 never drops; higher numbers drop first when the band is narrow.
|
|
26
32
|
const segment = (priority, ...parts) => ({ priority, parts: parts.flat().filter(Boolean) });
|
|
@@ -56,6 +62,13 @@ function meter(tier, dim = false) {
|
|
|
56
62
|
return [...BARS].map((bar, i) => part(bar, i <= lit ? { color: TIER_COLOR[tier] } : { dimColor: true }));
|
|
57
63
|
}
|
|
58
64
|
|
|
65
|
+
// The classifier is working: every bar in the accent colour.
|
|
66
|
+
const pendingMeter = () => [...BARS].map((bar) => part(bar, { color: COLOR.accent }));
|
|
67
|
+
|
|
68
|
+
// Turns routing off: the one control in Auto that pauses it.
|
|
69
|
+
const routingOffButton = (actions, variant) =>
|
|
70
|
+
button({ key: 'band-manual-main', label: 'Routing off', variant, onPress: () => actions.mode('manual') });
|
|
71
|
+
|
|
59
72
|
const route = (view) => routeLabel(view.actualModel ?? view.selectedModel ?? view.nativeModel, view.effort);
|
|
60
73
|
|
|
61
74
|
function served(view) {
|
|
@@ -73,7 +86,7 @@ function supportText(config, estimate) {
|
|
|
73
86
|
export function bandSegments(config, view, usage, actions) {
|
|
74
87
|
if (view.phase === 'unavailable')
|
|
75
88
|
return [
|
|
76
|
-
segment(0, part('✕
|
|
89
|
+
segment(0, part('✕ Routing unavailable', { color: 'red' })),
|
|
77
90
|
segment(
|
|
78
91
|
2,
|
|
79
92
|
part(view.error === GATEWAY_SETTINGS ? 'v0.8 gateway settings remain' : (view.error ?? 'unknown error'), {
|
|
@@ -87,16 +100,22 @@ export function bandSegments(config, view, usage, actions) {
|
|
|
87
100
|
segment(
|
|
88
101
|
0,
|
|
89
102
|
part('○ ', { dimColor: true }),
|
|
90
|
-
part('
|
|
91
|
-
part('off', { color:
|
|
92
|
-
part(` ·
|
|
103
|
+
part('Routing '),
|
|
104
|
+
part('off', { backgroundColor: COLOR.off, color: COLOR.muted }),
|
|
105
|
+
part(` · every turn uses ${modelName(view.nativeModel)}`),
|
|
93
106
|
view.reason === 'model selected manually' ? part(' (/model)', { dimColor: true }) : null,
|
|
94
107
|
),
|
|
95
|
-
|
|
96
|
-
|
|
108
|
+
view.reason === NOT_A_TIER_REASON
|
|
109
|
+
? segment(2, part(`${modelName(view.nativeModel)} is not a routing tier`, { dimColor: true }))
|
|
110
|
+
: null,
|
|
111
|
+
segment(
|
|
112
|
+
1,
|
|
113
|
+
button({ key: 'band-auto', label: 'Routing on', variant: 'primary', onPress: () => actions.mode('auto') }),
|
|
114
|
+
),
|
|
115
|
+
].filter(Boolean);
|
|
97
116
|
if (view.phase === 'choosing')
|
|
98
117
|
return [
|
|
99
|
-
segment(0,
|
|
118
|
+
segment(0, pendingMeter(), part(' choosing for this turn…', { dimColor: true })),
|
|
100
119
|
segment(
|
|
101
120
|
3,
|
|
102
121
|
part(`${classifierLabel(config)} · ${activeClassifier(config).timeoutMs / 1000} s deadline`, {
|
|
@@ -107,19 +126,21 @@ export function bandSegments(config, view, usage, actions) {
|
|
|
107
126
|
const pin = view.pendingPin
|
|
108
127
|
? segment(
|
|
109
128
|
0,
|
|
110
|
-
part('⏵ next turn: ', { color:
|
|
129
|
+
part('⏵ next turn: ', { color: COLOR.accent }),
|
|
111
130
|
part(view.pendingPin, { bold: true, color: TIER_COLOR[view.pendingPin] }),
|
|
112
131
|
part(' '),
|
|
113
132
|
button({ key: 'band-unpin', label: '✕', plain: true, onPress: actions.unpin }),
|
|
114
133
|
)
|
|
115
134
|
: null;
|
|
116
135
|
if (!view.tier && view.phase === 'ready' && !view.actualModel)
|
|
117
|
-
return [
|
|
136
|
+
return [
|
|
137
|
+
segment(0, meter(null, true), part(' Routing on · ready', { dimColor: true })),
|
|
138
|
+
segment(1, routingOffButton(actions, 'secondary')),
|
|
139
|
+
pin,
|
|
140
|
+
].filter(Boolean);
|
|
118
141
|
const main = segment(
|
|
119
142
|
0,
|
|
120
|
-
view.tier
|
|
121
|
-
? [...meter(view.tier), part(` ${view.tier} `, { bold: true, color: TIER_COLOR[view.tier] })]
|
|
122
|
-
: part('○ '),
|
|
143
|
+
view.tier ? [...meter(view.tier), pill(view.tier, TIER_COLOR[view.tier])] : part('○ '),
|
|
123
144
|
part(route(view)),
|
|
124
145
|
served(view) ? part(' fallback', { color: 'yellow' }) : null,
|
|
125
146
|
);
|
|
@@ -127,19 +148,20 @@ export function bandSegments(config, view, usage, actions) {
|
|
|
127
148
|
// and a long classifier label ("Clef Flash: no account ID") must not push the warning out.
|
|
128
149
|
if (classifierWarns(view.error))
|
|
129
150
|
return [
|
|
130
|
-
segment(0, part(`⚠ ${classifierStatus(config, view.error)}`, { color:
|
|
151
|
+
segment(0, part(`⚠ ${classifierStatus(config, view.error)}`, { color: COLOR.warn })),
|
|
131
152
|
view.error === 'missing-key' || view.error === 'missing-account'
|
|
132
|
-
? segment(0, button({ key: 'band-key', label: 'Set up', onPress: actions.key }))
|
|
153
|
+
? segment(0, button({ key: 'band-key', label: 'Set up', variant: 'primary', onPress: actions.key }))
|
|
133
154
|
: segment(2, button({ key: 'band-fix', label: 'Details', onPress: actions.open })),
|
|
134
155
|
{ ...main, priority: 1 },
|
|
135
156
|
pin,
|
|
136
|
-
segment(3, part('keeping model', { color:
|
|
157
|
+
segment(3, part('keeping model', { color: COLOR.warn })),
|
|
137
158
|
].filter(Boolean);
|
|
138
159
|
const metrics = usageMetrics(config, view, usage);
|
|
139
160
|
const reading = (bar) => part(bar.percent === null ? '?' : `${bar.percent}%`, { color: bar.color });
|
|
140
161
|
const support = supportText(config, view.estimate);
|
|
141
162
|
return [
|
|
142
163
|
main,
|
|
164
|
+
segment(1, routingOffButton(actions, 'secondary')),
|
|
143
165
|
pin,
|
|
144
166
|
segment(1, part(SHORT_REASONS[view.reason] ?? view.reason ?? '', { dimColor: true })),
|
|
145
167
|
support ? segment(4, part(support, { dimColor: true })) : null,
|
|
@@ -196,8 +218,8 @@ export function renderBand({ Box, Text, Button }, config, view, usage, { columns
|
|
|
196
218
|
: []),
|
|
197
219
|
Text({ children: routing ? ' ' : '' }),
|
|
198
220
|
routing
|
|
199
|
-
? Button({ key: 'band-manual', label: '
|
|
200
|
-
: Button({ key: 'band-auto-row', label: '
|
|
221
|
+
? Button({ key: 'band-manual', label: 'Routing off', onPress: () => actions.mode('manual') })
|
|
222
|
+
: Button({ key: 'band-auto-row', label: 'Routing on', onPress: () => actions.mode('auto') }),
|
|
201
223
|
Text({ children: ' ' }),
|
|
202
224
|
Button({
|
|
203
225
|
key: 'band-detail',
|
|
@@ -213,5 +235,5 @@ export function renderBand({ Box, Text, Button }, config, view, usage, { columns
|
|
|
213
235
|
export function switchToast(config, previous, next, estimate) {
|
|
214
236
|
const label = (decision) => routeLabel(decision.model, decision.effort);
|
|
215
237
|
const support = supportText(config, estimate);
|
|
216
|
-
return
|
|
238
|
+
return `Model changed: ${label(previous)} → ${label(next)} · ${SHORT_REASONS[next.reason]?.replace(/^\W+\s*/, '') ?? next.reason}${support ? ` (${support})` : ''}`;
|
|
217
239
|
}
|
package/lib/display.mjs
CHANGED
|
@@ -4,6 +4,9 @@ import { tierForModel } from './route.mjs';
|
|
|
4
4
|
// Cost order, cheapest first, so the colors read as a scale. Hex values: every surface draws them.
|
|
5
5
|
export const TIER_COLOR = { micro: '#5fd7af', low: '#5f9fe0', medium: '#d7af5f', high: '#e0708a' };
|
|
6
6
|
|
|
7
|
+
// Why routing starts off: the session's model is no tier's model. Set at session start, read by the band.
|
|
8
|
+
export const NOT_A_TIER_REASON = 'not a routing tier';
|
|
9
|
+
|
|
7
10
|
export function modelName(id) {
|
|
8
11
|
if (!id) return 'no response yet';
|
|
9
12
|
return id
|
package/lib/panel.mjs
CHANGED
|
@@ -118,26 +118,26 @@ function header(ui, config, view, tab, actions) {
|
|
|
118
118
|
color: 'green',
|
|
119
119
|
});
|
|
120
120
|
return [
|
|
121
|
-
ui.line(ui.head(`
|
|
121
|
+
ui.line(ui.head(`ROUTING · ${auto ? 'on' : 'off'}`), ' ', status),
|
|
122
122
|
view.phase === 'unavailable' && view.error ? ui.text(view.error, { color: 'yellow' }) : null,
|
|
123
123
|
...(view.error === GATEWAY_SETTINGS ? GATEWAY_CLEANUP.map((line) => ui.text(line, { color: 'yellow' })) : []),
|
|
124
124
|
ui.line(
|
|
125
125
|
ui.Button({
|
|
126
126
|
key: 'auto',
|
|
127
|
-
label: '
|
|
128
|
-
hotkey: '
|
|
127
|
+
label: 'Routing on',
|
|
128
|
+
hotkey: 'o',
|
|
129
129
|
variant: auto ? 'primary' : 'secondary',
|
|
130
130
|
onPress: () => actions.mode('auto'),
|
|
131
131
|
}),
|
|
132
132
|
' ',
|
|
133
133
|
ui.Button({
|
|
134
134
|
key: 'manual',
|
|
135
|
-
label: '
|
|
136
|
-
hotkey: '
|
|
135
|
+
label: 'Routing off',
|
|
136
|
+
hotkey: 'f',
|
|
137
137
|
variant: auto ? 'secondary' : 'primary',
|
|
138
138
|
onPress: () => actions.mode('manual'),
|
|
139
139
|
}),
|
|
140
|
-
ui.dim('
|
|
140
|
+
ui.dim(' Routing off keeps the /model choice'),
|
|
141
141
|
),
|
|
142
142
|
ui.line(
|
|
143
143
|
...TABS.flatMap(([id, hotkey, label]) => [
|
|
@@ -214,7 +214,9 @@ function nowTab(ui, config, view, usage, actions) {
|
|
|
214
214
|
),
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
|
-
out.push(
|
|
217
|
+
out.push(
|
|
218
|
+
ui.dim(auto ? ' Pins serve the next turn only.' : ' Pins need routing on. Routing off keeps the /model choice.'),
|
|
219
|
+
);
|
|
218
220
|
out.push(ui.text(' '), ...replies(ui, view));
|
|
219
221
|
out.push(
|
|
220
222
|
ui.text(' '),
|
|
@@ -233,7 +235,7 @@ function nowTab(ui, config, view, usage, actions) {
|
|
|
233
235
|
return out;
|
|
234
236
|
}
|
|
235
237
|
|
|
236
|
-
// One cell per reply, colored by the tier that served it; a dot where routing did not choose (
|
|
238
|
+
// One cell per reply, colored by the tier that served it; a dot where routing did not choose (routing off, fallback).
|
|
237
239
|
function replies(ui, view) {
|
|
238
240
|
const tiers = view.tiers ?? [];
|
|
239
241
|
if (!tiers.length) return [ui.head('REPLIES'), ui.dim(' no replies yet')];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexeiled/claude-router",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Native Claude Code Mod: model and effort routing for the main conversation, advised by Jev, Clef, Clef Flash, OpenAI or Ollama.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Alexei Ledenev",
|