@alexeiled/claude-router 1.23.1 → 1.25.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 +1 -1
- package/CHANGELOG.md +62 -1
- package/README.md +39 -7
- package/docs/architecture.md +27 -4
- package/docs/auto-engine.md +152 -0
- package/docs/configuration.md +47 -3
- package/docs/evaluation.md +222 -3
- package/docs/native-router.md +11 -3
- package/docs/providers.md +28 -0
- package/docs/router-band.svg +124 -133
- package/docs/router-pane-classifier.svg +24 -23
- package/docs/router-pane-now.svg +9 -7
- package/docs/router-pane-policy.svg +4 -4
- package/docs/router-pane-routes.svg +8 -8
- package/docs/router-pane-usage-whatif.svg +14 -14
- package/docs/router-pane-usage.svg +20 -20
- package/docs/routing-modes.md +13 -4
- package/docs/user-guide.md +79 -19
- package/hooks/native-router.mjs +1194 -215
- package/lib/activity-stats.mjs +23 -4
- package/lib/activity.mjs +7 -5
- package/lib/auto-engine.mjs +414 -0
- package/lib/auto-route.mjs +253 -0
- package/lib/band.mjs +35 -440
- package/lib/classifier-client.mjs +12 -8
- package/lib/config-file.mjs +7 -2
- package/lib/config.mjs +64 -15
- package/lib/cost.mjs +5 -1
- package/lib/costs.mjs +4 -2
- package/lib/decisions.mjs +80 -5
- package/lib/display.mjs +69 -20
- package/lib/facts.mjs +30 -0
- package/lib/modes.mjs +8 -4
- package/lib/panel.mjs +75 -2163
- package/lib/policy.mjs +7 -6
- package/lib/providers.mjs +7 -0
- package/lib/replay-trace.mjs +550 -0
- package/lib/replay.mjs +718 -0
- package/lib/route-line.mjs +46 -0
- package/lib/route.mjs +35 -21
- package/lib/savings.mjs +14 -3
- package/lib/subagents.mjs +41 -11
- package/lib/subcommands.mjs +60 -0
- package/lib/ui/fallback.mjs +22 -0
- package/lib/ui/graphical/band.mjs +256 -0
- package/lib/ui/graphical/charts.mjs +163 -0
- package/lib/ui/graphical/classifier.mjs +153 -0
- package/lib/ui/graphical/frame.mjs +227 -0
- package/lib/ui/graphical/kit.mjs +156 -0
- package/lib/ui/graphical/meter.mjs +25 -0
- package/lib/ui/graphical/now.mjs +353 -0
- package/lib/ui/graphical/policy.mjs +56 -0
- package/lib/ui/graphical/routes.mjs +264 -0
- package/lib/ui/graphical/squares.mjs +29 -0
- package/lib/ui/graphical/usage.mjs +376 -0
- package/lib/ui/model/band.mjs +439 -0
- package/lib/ui/model/classifier.mjs +308 -0
- package/lib/ui/model/draft.mjs +62 -0
- package/lib/ui/model/format.mjs +41 -0
- package/lib/ui/model/frame.mjs +359 -0
- package/lib/ui/model/now.mjs +390 -0
- package/lib/ui/model/policy.mjs +194 -0
- package/lib/ui/model/routes.mjs +392 -0
- package/lib/ui/model/usage-agents.mjs +311 -0
- package/lib/ui/model/usage-breakdown.mjs +237 -0
- package/lib/ui/model/usage-shared.mjs +58 -0
- package/lib/ui/model/usage.mjs +330 -0
- package/lib/ui/terminal/band.mjs +220 -0
- package/lib/ui/terminal/classifier.mjs +142 -0
- package/lib/ui/terminal/frame.mjs +169 -0
- package/lib/ui/terminal/kit.mjs +133 -0
- package/lib/ui/terminal/now.mjs +300 -0
- package/lib/ui/terminal/policy.mjs +52 -0
- package/lib/ui/terminal/routes.mjs +167 -0
- package/lib/ui/terminal/usage.mjs +363 -0
- package/lib/ui/terminal/wrap.mjs +37 -0
- package/lib/ui/tokens.mjs +106 -0
- package/lib/usage.mjs +5 -5
- package/lib/view.mjs +5 -2
- package/package.json +3 -2
- package/types/index.d.ts +15 -0
|
@@ -40,28 +40,28 @@
|
|
|
40
40
|
<text x="453.0" y="91" fill="#7c7c7c" xml:space="preserve"> p next</text>
|
|
41
41
|
<text x="24.0" y="110" fill="#7c7c7c" xml:space="preserve">this session · your model </text>
|
|
42
42
|
<text x="226.8" y="110" fill="#e0708a" font-weight="700" xml:space="preserve">Opus 5.5 · xhigh</text>
|
|
43
|
-
<text x="24.0" y="148" fill="#
|
|
43
|
+
<text x="24.0" y="148" fill="#87d787" font-weight="700" xml:space="preserve">−$4.09 (−31%)</text>
|
|
44
44
|
<text x="125.4" y="148" fill="#d0d0d0" xml:space="preserve"> vs unrouted</text>
|
|
45
45
|
<text x="226.8" y="186" fill="#7c7c7c" xml:space="preserve"> cost</text>
|
|
46
46
|
<text x="289.2" y="186" fill="#7c7c7c" xml:space="preserve"> vs unrouted</text>
|
|
47
47
|
<text x="406.2" y="186" fill="#7c7c7c" xml:space="preserve"> unrouted</text>
|
|
48
48
|
<text x="24.0" y="205" fill="#d0d0d0" xml:space="preserve">main · 86 replies</text>
|
|
49
49
|
<text x="226.8" y="205" fill="#d0d0d0" xml:space="preserve"> ≈$6.45</text>
|
|
50
|
-
<text x="289.2" y="205" fill="#
|
|
50
|
+
<text x="289.2" y="205" fill="#87d787" xml:space="preserve"> −$4.17</text>
|
|
51
51
|
<text x="406.2" y="205" fill="#7c7c7c" xml:space="preserve"> ≈$10.62</text>
|
|
52
52
|
<text x="24.0" y="224" fill="#7c7c7c" xml:space="preserve"> cheaper models</text>
|
|
53
|
-
<text x="289.2" y="224" fill="#
|
|
53
|
+
<text x="289.2" y="224" fill="#87d787" xml:space="preserve"> −$4.36</text>
|
|
54
54
|
<text x="24.0" y="243" fill="#7c7c7c" xml:space="preserve"> cache rebuilds</text>
|
|
55
|
-
<text x="289.2" y="243" fill="#
|
|
55
|
+
<text x="289.2" y="243" fill="#d7af5f" xml:space="preserve"> +$0.19</text>
|
|
56
56
|
<text x="406.2" y="243" fill="#7c7c7c" xml:space="preserve"> 4% of the saving</text>
|
|
57
57
|
<text x="24.0" y="262" fill="#d0d0d0" xml:space="preserve">agents · 6</text>
|
|
58
58
|
<text x="226.8" y="262" fill="#d0d0d0" xml:space="preserve"> ≈$2.52</text>
|
|
59
|
-
<text x="289.2" y="262" fill="#
|
|
59
|
+
<text x="289.2" y="262" fill="#d7af5f" xml:space="preserve"> +$0.08</text>
|
|
60
60
|
<text x="406.2" y="262" fill="#7c7c7c" xml:space="preserve"> ≈$2.44</text>
|
|
61
61
|
<text x="24.0" y="281" fill="#7c7c7c" xml:space="preserve">─────────────────────────────────────────────────────────────</text>
|
|
62
62
|
<text x="24.0" y="300" fill="#d0d0d0" font-weight="700" xml:space="preserve">session · API estimate</text>
|
|
63
63
|
<text x="226.8" y="300" fill="#d0d0d0" font-weight="700" xml:space="preserve"> ≈$8.97</text>
|
|
64
|
-
<text x="289.2" y="300" fill="#
|
|
64
|
+
<text x="289.2" y="300" fill="#87d787" font-weight="700" xml:space="preserve"> −$4.09</text>
|
|
65
65
|
<text x="406.2" y="300" fill="#7c7c7c" xml:space="preserve"> ≈$13.06</text>
|
|
66
66
|
<text x="24.0" y="338" fill="#7c7c7c" xml:space="preserve"> 86 replies · 86 turns · input 5.93M · cache hit 90% · output 77.4K</text>
|
|
67
67
|
<text x="24.0" y="376" fill="#5fafd7" font-weight="700" xml:space="preserve">BY </text>
|
|
@@ -76,12 +76,12 @@
|
|
|
76
76
|
<text x="39.6" y="414" fill="#d0d0d0" xml:space="preserve">▸</text>
|
|
77
77
|
<text x="55.2" y="414" fill="#5f9fe0" xml:space="preserve">▂▄</text>
|
|
78
78
|
<text x="211.2" y="414" fill="#d0d0d0" xml:space="preserve"> 41 ≈$1.20</text>
|
|
79
|
-
<text x="351.6" y="414" fill="#
|
|
79
|
+
<text x="351.6" y="414" fill="#87d787" xml:space="preserve"> −$3.57</text>
|
|
80
80
|
<text x="468.6" y="414" fill="#7c7c7c" xml:space="preserve"> Haiku 5.5 · high</text>
|
|
81
81
|
<text x="39.6" y="433" fill="#d0d0d0" xml:space="preserve">▸</text>
|
|
82
82
|
<text x="55.2" y="433" fill="#d7af5f" xml:space="preserve">▂▄▆</text>
|
|
83
83
|
<text x="211.2" y="433" fill="#d0d0d0" xml:space="preserve"> 12 ≈$0.96</text>
|
|
84
|
-
<text x="351.6" y="433" fill="#
|
|
84
|
+
<text x="351.6" y="433" fill="#87d787" xml:space="preserve"> −$0.60</text>
|
|
85
85
|
<text x="468.6" y="433" fill="#7c7c7c" xml:space="preserve"> Sonnet 5.5 · high</text>
|
|
86
86
|
<text x="39.6" y="452" fill="#d0d0d0" xml:space="preserve">▸</text>
|
|
87
87
|
<text x="55.2" y="452" fill="#e0708a" xml:space="preserve">▂▄▆█</text>
|
|
@@ -95,11 +95,11 @@
|
|
|
95
95
|
<text x="39.6" y="509" fill="#d0d0d0" xml:space="preserve">Haiku 5.5</text>
|
|
96
96
|
<text x="211.2" y="509" fill="#7c7c7c" xml:space="preserve">████</text>
|
|
97
97
|
<text x="382.8" y="509" fill="#d0d0d0" xml:space="preserve"> ≈$2.12</text>
|
|
98
|
-
<text x="453.0" y="509" fill="#
|
|
98
|
+
<text x="453.0" y="509" fill="#87d787" xml:space="preserve"> −$8.50</text>
|
|
99
99
|
<text x="39.6" y="528" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5</text>
|
|
100
100
|
<text x="211.2" y="528" fill="#7c7c7c" xml:space="preserve">█████████████</text>
|
|
101
101
|
<text x="382.8" y="528" fill="#d0d0d0" xml:space="preserve"> ≈$6.37</text>
|
|
102
|
-
<text x="453.0" y="528" fill="#
|
|
102
|
+
<text x="453.0" y="528" fill="#87d787" xml:space="preserve"> −$4.25</text>
|
|
103
103
|
<text x="39.6" y="547" fill="#d0d0d0" font-weight="700" xml:space="preserve">Routed</text>
|
|
104
104
|
<text x="211.2" y="547" fill="#5fafd7" xml:space="preserve">█████████████</text>
|
|
105
105
|
<text x="382.8" y="547" fill="#d0d0d0" xml:space="preserve"> ≈$6.45</text>
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
<text x="24.0" y="585" fill="#7c7c7c" xml:space="preserve"> same tokens and output on each model alone · answer quality not measured</text>
|
|
111
111
|
<text x="24.0" y="623" fill="#5fafd7" font-weight="700" xml:space="preserve">WORTH A LOOK</text>
|
|
112
112
|
<text x="117.6" y="623" fill="#7c7c7c" xml:space="preserve"> · from the numbers; answer quality is not measured</text>
|
|
113
|
-
<text x="39.6" y="642" fill="#
|
|
113
|
+
<text x="39.6" y="642" fill="#d77757" font-style="italic" xml:space="preserve">code</text>
|
|
114
114
|
<text x="70.8" y="642" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
115
115
|
<text x="94.2" y="642" fill="#e0708a" xml:space="preserve">▂▄▆█</text>
|
|
116
116
|
<text x="125.4" y="642" fill="#d0d0d0" xml:space="preserve"> carried 67% of the cost</text>
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
<text x="125.4" y="718" fill="#d0d0d0" xml:space="preserve">■ 3 moved by the router</text>
|
|
131
131
|
<text x="304.8" y="718" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
132
132
|
<text x="328.2" y="718" fill="#d0d0d0" xml:space="preserve">□ 3 on Claude Code’s pick</text>
|
|
133
|
-
<text x="39.6" y="737" fill="#
|
|
133
|
+
<text x="39.6" y="737" fill="#d7af5f" font-weight="700" xml:space="preserve">routing +$0.08 (+7%)</text>
|
|
134
134
|
<text x="195.6" y="737" fill="#d0d0d0" xml:space="preserve"> vs Claude Code’s picks</text>
|
|
135
135
|
<text x="375.0" y="737" fill="#7c7c7c" xml:space="preserve"> on 3 routed agents</text>
|
|
136
136
|
<text x="24.0" y="775" fill="#d0d0d0" font-weight="700" xml:space="preserve"> ROUTED</text>
|
|
@@ -141,13 +141,13 @@
|
|
|
141
141
|
<text x="203.4" y="813" fill="#c3e88d" xml:space="preserve">■■</text>
|
|
142
142
|
<text x="297.0" y="813" fill="#d0d0d0" xml:space="preserve"> 2</text>
|
|
143
143
|
<text x="320.4" y="813" fill="#d0d0d0" xml:space="preserve"> ≈$0.08</text>
|
|
144
|
-
<text x="390.6" y="813" fill="#
|
|
144
|
+
<text x="390.6" y="813" fill="#87d787" xml:space="preserve"> −$0.33 ▼</text>
|
|
145
145
|
<text x="39.6" y="832" fill="#d0d0d0" xml:space="preserve">▸</text>
|
|
146
146
|
<text x="55.2" y="832" fill="#d0d0d0" xml:space="preserve">dev-flow:reviewer</text>
|
|
147
147
|
<text x="203.4" y="832" fill="#c792ea" xml:space="preserve">■</text>
|
|
148
148
|
<text x="297.0" y="832" fill="#d0d0d0" xml:space="preserve"> 1</text>
|
|
149
149
|
<text x="320.4" y="832" fill="#d0d0d0" xml:space="preserve"> ≈$1.12</text>
|
|
150
|
-
<text x="390.6" y="832" fill="#
|
|
150
|
+
<text x="390.6" y="832" fill="#d7af5f" xml:space="preserve"> +$0.41 ▲</text>
|
|
151
151
|
<text x="24.0" y="870" fill="#d0d0d0" font-weight="700" xml:space="preserve"> NOT ROUTED</text>
|
|
152
152
|
<text x="117.6" y="870" fill="#7c7c7c" xml:space="preserve"> · Claude Code picked the model</text>
|
|
153
153
|
<text x="39.6" y="889" fill="#d0d0d0" xml:space="preserve">▸</text>
|
|
@@ -39,28 +39,28 @@
|
|
|
39
39
|
<text x="390.6" y="91" fill="#d0d0d0" xml:space="preserve">[ All ]</text>
|
|
40
40
|
<text x="453.0" y="91" fill="#7c7c7c" xml:space="preserve"> p next</text>
|
|
41
41
|
<text x="24.0" y="110" fill="#7c7c7c" xml:space="preserve">all projects · Oct 7 – Oct 13 · each session vs its own model</text>
|
|
42
|
-
<text x="24.0" y="148" fill="#
|
|
42
|
+
<text x="24.0" y="148" fill="#87d787" font-weight="700" xml:space="preserve">−$12.29 (−37%)</text>
|
|
43
43
|
<text x="133.2" y="148" fill="#d0d0d0" xml:space="preserve"> vs unrouted</text>
|
|
44
44
|
<text x="226.8" y="186" fill="#7c7c7c" xml:space="preserve"> cost</text>
|
|
45
45
|
<text x="289.2" y="186" fill="#7c7c7c" xml:space="preserve"> vs unrouted</text>
|
|
46
46
|
<text x="406.2" y="186" fill="#7c7c7c" xml:space="preserve"> unrouted</text>
|
|
47
47
|
<text x="24.0" y="205" fill="#d0d0d0" xml:space="preserve">main · 221 replies</text>
|
|
48
48
|
<text x="226.8" y="205" fill="#d0d0d0" xml:space="preserve"> ≈$15.33</text>
|
|
49
|
-
<text x="289.2" y="205" fill="#
|
|
49
|
+
<text x="289.2" y="205" fill="#87d787" xml:space="preserve"> −$11.78</text>
|
|
50
50
|
<text x="406.2" y="205" fill="#7c7c7c" xml:space="preserve"> ≈$27.11</text>
|
|
51
51
|
<text x="24.0" y="224" fill="#7c7c7c" xml:space="preserve"> cheaper models</text>
|
|
52
|
-
<text x="289.2" y="224" fill="#
|
|
52
|
+
<text x="289.2" y="224" fill="#87d787" xml:space="preserve"> −$12.29</text>
|
|
53
53
|
<text x="24.0" y="243" fill="#7c7c7c" xml:space="preserve"> cache rebuilds</text>
|
|
54
|
-
<text x="289.2" y="243" fill="#
|
|
54
|
+
<text x="289.2" y="243" fill="#d7af5f" xml:space="preserve"> +$0.51</text>
|
|
55
55
|
<text x="406.2" y="243" fill="#7c7c7c" xml:space="preserve"> 4% of the saving</text>
|
|
56
56
|
<text x="24.0" y="262" fill="#d0d0d0" xml:space="preserve">agents · 15</text>
|
|
57
57
|
<text x="226.8" y="262" fill="#d0d0d0" xml:space="preserve"> ≈$5.60</text>
|
|
58
|
-
<text x="289.2" y="262" fill="#
|
|
58
|
+
<text x="289.2" y="262" fill="#87d787" xml:space="preserve"> −$0.51</text>
|
|
59
59
|
<text x="406.2" y="262" fill="#7c7c7c" xml:space="preserve"> ≈$6.11</text>
|
|
60
60
|
<text x="24.0" y="281" fill="#7c7c7c" xml:space="preserve">─────────────────────────────────────────────────────────────</text>
|
|
61
61
|
<text x="24.0" y="300" fill="#d0d0d0" font-weight="700" xml:space="preserve">7 days · API estimate</text>
|
|
62
62
|
<text x="226.8" y="300" fill="#d0d0d0" font-weight="700" xml:space="preserve"> ≈$20.93</text>
|
|
63
|
-
<text x="289.2" y="300" fill="#
|
|
63
|
+
<text x="289.2" y="300" fill="#87d787" font-weight="700" xml:space="preserve"> −$12.29</text>
|
|
64
64
|
<text x="406.2" y="300" fill="#7c7c7c" xml:space="preserve"> ≈$33.22</text>
|
|
65
65
|
<text x="24.0" y="338" fill="#7c7c7c" xml:space="preserve"> 221 replies · 131 turns · input 15.25M · cache hit 90% · output 198.9K</text>
|
|
66
66
|
<text x="24.0" y="376" fill="#5fafd7" font-weight="700" xml:space="preserve">BY </text>
|
|
@@ -73,31 +73,31 @@
|
|
|
73
73
|
<text x="304.8" y="376" fill="#7c7c7c" xml:space="preserve"> g next</text>
|
|
74
74
|
<text x="24.0" y="395" fill="#7c7c7c" xml:space="preserve"> replies cost vs unrouted mostly on</text>
|
|
75
75
|
<text x="39.6" y="414" fill="#d0d0d0" xml:space="preserve">▾</text>
|
|
76
|
-
<text x="55.2" y="414" fill="#
|
|
76
|
+
<text x="55.2" y="414" fill="#d77757" font-style="italic" xml:space="preserve">code</text>
|
|
77
77
|
<text x="211.2" y="414" fill="#d0d0d0" xml:space="preserve"> 125 ≈$12.70</text>
|
|
78
|
-
<text x="351.6" y="414" fill="#
|
|
78
|
+
<text x="351.6" y="414" fill="#87d787" xml:space="preserve"> −$3.55</text>
|
|
79
79
|
<text x="468.6" y="414" fill="#7c7c7c" xml:space="preserve"> Sonnet 5.5 · high</text>
|
|
80
80
|
<text x="70.8" y="433" fill="#d0d0d0" xml:space="preserve">Opus 5.5 · xhigh</text>
|
|
81
81
|
<text x="211.2" y="433" fill="#d0d0d0" xml:space="preserve"> 54 ≈$7.02</text>
|
|
82
82
|
<text x="351.6" y="433" fill="#d0d0d0" xml:space="preserve"> $0.00</text>
|
|
83
83
|
<text x="70.8" y="452" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 · high</text>
|
|
84
84
|
<text x="211.2" y="452" fill="#d0d0d0" xml:space="preserve"> 71 ≈$5.68</text>
|
|
85
|
-
<text x="351.6" y="452" fill="#
|
|
85
|
+
<text x="351.6" y="452" fill="#87d787" xml:space="preserve"> −$3.55</text>
|
|
86
86
|
<text x="24.0" y="471" fill="#7c7c7c" xml:space="preserve"> cheaper −$3.69 · stronger $0.00 · cache rebuilds +$0.14 · input 8.63M · output 112.5K</text>
|
|
87
87
|
<text x="39.6" y="490" fill="#d0d0d0" xml:space="preserve">▸</text>
|
|
88
|
-
<text x="55.2" y="490" fill="#
|
|
88
|
+
<text x="55.2" y="490" fill="#d77757" font-style="italic" xml:space="preserve">ops</text>
|
|
89
89
|
<text x="211.2" y="490" fill="#d0d0d0" xml:space="preserve"> 50 ≈$1.50</text>
|
|
90
|
-
<text x="351.6" y="490" fill="#
|
|
90
|
+
<text x="351.6" y="490" fill="#87d787" xml:space="preserve"> −$4.50</text>
|
|
91
91
|
<text x="468.6" y="490" fill="#7c7c7c" xml:space="preserve"> Haiku 5.5 · high</text>
|
|
92
92
|
<text x="39.6" y="509" fill="#d0d0d0" xml:space="preserve">▸</text>
|
|
93
|
-
<text x="55.2" y="509" fill="#
|
|
93
|
+
<text x="55.2" y="509" fill="#d77757" font-style="italic" xml:space="preserve">explore</text>
|
|
94
94
|
<text x="211.2" y="509" fill="#d0d0d0" xml:space="preserve"> 36 ≈$1.01</text>
|
|
95
|
-
<text x="351.6" y="509" fill="#
|
|
95
|
+
<text x="351.6" y="509" fill="#87d787" xml:space="preserve"> −$2.95</text>
|
|
96
96
|
<text x="468.6" y="509" fill="#7c7c7c" xml:space="preserve"> Haiku 5.5 · high</text>
|
|
97
97
|
<text x="39.6" y="528" fill="#d0d0d0" xml:space="preserve">▸</text>
|
|
98
|
-
<text x="55.2" y="528" fill="#
|
|
98
|
+
<text x="55.2" y="528" fill="#d77757" font-style="italic" xml:space="preserve">plan</text>
|
|
99
99
|
<text x="211.2" y="528" fill="#d0d0d0" xml:space="preserve"> 10 ≈$0.12</text>
|
|
100
|
-
<text x="351.6" y="528" fill="#
|
|
100
|
+
<text x="351.6" y="528" fill="#87d787" xml:space="preserve"> −$0.78</text>
|
|
101
101
|
<text x="468.6" y="528" fill="#7c7c7c" xml:space="preserve"> Haiku 5.5 · low</text>
|
|
102
102
|
<text x="24.0" y="566" fill="#5fafd7" font-weight="700" xml:space="preserve">COST BY DAY </text>
|
|
103
103
|
<text x="117.6" y="566" fill="#5fafd7" xml:space="preserve">▂▃▁·▂▃█</text>
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
<text x="297.0" y="566" fill="#d0d0d0" xml:space="preserve">[ What if ]</text>
|
|
107
107
|
<text x="24.0" y="604" fill="#5fafd7" font-weight="700" xml:space="preserve">WORTH A LOOK</text>
|
|
108
108
|
<text x="117.6" y="604" fill="#7c7c7c" xml:space="preserve"> · from the numbers; answer quality is not measured</text>
|
|
109
|
-
<text x="39.6" y="623" fill="#
|
|
109
|
+
<text x="39.6" y="623" fill="#d77757" font-style="italic" xml:space="preserve">code</text>
|
|
110
110
|
<text x="70.8" y="623" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
111
111
|
<text x="94.2" y="623" fill="#e0708a" xml:space="preserve">▂▄▆█</text>
|
|
112
112
|
<text x="125.4" y="623" fill="#d0d0d0" xml:space="preserve"> carried 46% of the cost</text>
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
<text x="133.2" y="699" fill="#d0d0d0" xml:space="preserve">■ 8 moved by the router</text>
|
|
131
131
|
<text x="312.6" y="699" fill="#7c7c7c" xml:space="preserve"> · </text>
|
|
132
132
|
<text x="336.0" y="699" fill="#d0d0d0" xml:space="preserve">□ 7 on Claude Code’s pick</text>
|
|
133
|
-
<text x="39.6" y="718" fill="#
|
|
133
|
+
<text x="39.6" y="718" fill="#87d787" font-weight="700" xml:space="preserve">routing −$0.51 (−14%)</text>
|
|
134
134
|
<text x="203.4" y="718" fill="#d0d0d0" xml:space="preserve"> vs Claude Code’s picks</text>
|
|
135
135
|
<text x="382.8" y="718" fill="#7c7c7c" xml:space="preserve"> on 9 routed agents</text>
|
|
136
136
|
<text x="24.0" y="737" fill="#d0d0d0" xml:space="preserve"> per day </text>
|
|
@@ -144,21 +144,21 @@
|
|
|
144
144
|
<text x="203.4" y="813" fill="#c3e88d" xml:space="preserve">■■■■</text>
|
|
145
145
|
<text x="297.0" y="813" fill="#d0d0d0" xml:space="preserve"> 4</text>
|
|
146
146
|
<text x="320.4" y="813" fill="#d0d0d0" xml:space="preserve"> ≈$0.18</text>
|
|
147
|
-
<text x="390.6" y="813" fill="#
|
|
147
|
+
<text x="390.6" y="813" fill="#87d787" xml:space="preserve"> −$0.72 ▼</text>
|
|
148
148
|
<text x="39.6" y="832" fill="#d0d0d0" xml:space="preserve">▸</text>
|
|
149
149
|
<text x="55.2" y="832" fill="#d0d0d0" xml:space="preserve">dev-flow:reviewer</text>
|
|
150
150
|
<text x="203.4" y="832" fill="#f78c6c" xml:space="preserve">□</text>
|
|
151
151
|
<text x="211.2" y="832" fill="#c792ea" xml:space="preserve">■■</text>
|
|
152
152
|
<text x="297.0" y="832" fill="#d0d0d0" xml:space="preserve"> 3</text>
|
|
153
153
|
<text x="320.4" y="832" fill="#d0d0d0" xml:space="preserve"> ≈$2.50</text>
|
|
154
|
-
<text x="390.6" y="832" fill="#
|
|
154
|
+
<text x="390.6" y="832" fill="#d7af5f" xml:space="preserve"> +$0.77 ▲</text>
|
|
155
155
|
<text x="39.6" y="851" fill="#d0d0d0" xml:space="preserve">▸</text>
|
|
156
156
|
<text x="55.2" y="851" fill="#d0d0d0" xml:space="preserve">general-purpose</text>
|
|
157
157
|
<text x="203.4" y="851" fill="#c3e88d" xml:space="preserve">■</text>
|
|
158
158
|
<text x="211.2" y="851" fill="#f78c6c" xml:space="preserve">■</text>
|
|
159
159
|
<text x="297.0" y="851" fill="#d0d0d0" xml:space="preserve"> 2</text>
|
|
160
160
|
<text x="320.4" y="851" fill="#d0d0d0" xml:space="preserve"> ≈$0.47</text>
|
|
161
|
-
<text x="390.6" y="851" fill="#
|
|
161
|
+
<text x="390.6" y="851" fill="#87d787" xml:space="preserve"> −$0.56 ▼</text>
|
|
162
162
|
<text x="24.0" y="889" fill="#d0d0d0" font-weight="700" xml:space="preserve"> NOT ROUTED</text>
|
|
163
163
|
<text x="117.6" y="889" fill="#7c7c7c" xml:space="preserve"> · Claude Code picked the model</text>
|
|
164
164
|
<text x="39.6" y="908" fill="#d0d0d0" xml:space="preserve">▸</text>
|
package/docs/routing-modes.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# Routing modes
|
|
2
2
|
|
|
3
|
-
One
|
|
4
|
-
your routes stay as they are. The mode moves the route each tier runs by one fixed step.
|
|
3
|
+
One routing mode trades cost against answer quality: `cost`, `balanced` (the default) or `quality`. With `table`, the mode moves each tier route by one fixed step. `shadow` keeps those table routes for requests; its automatic proposal uses the mode only as a capability margin. `auto` also uses only the capability margin. Neither automatic engine applies `modes.*.policy` patches.
|
|
5
4
|
|
|
6
5
|
| Mode | What changes |
|
|
7
6
|
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -9,9 +8,9 @@ your routes stay as they are. The mode moves the route each tier runs by one fix
|
|
|
9
8
|
| `balanced` | Nothing: every tier runs its route as configured. |
|
|
10
9
|
| `quality` | One effort level more on the same model, else the route of the tier above. Haiku 5.5 automatically prefers High, except medium bounded ops may use Xhigh. Explicit higher efforts stay supported. |
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
For requests selected by `table` and `shadow`, these route-table rules apply:
|
|
13
12
|
|
|
14
|
-
- `micro` turns keep the `micro` route. Only the classifier makes a turn `micro`; `cost` never does.
|
|
13
|
+
- `micro` turns keep the configured `micro` route. Only the classifier makes a turn `micro`; `cost` never does.
|
|
15
14
|
- A pin (`/router pin <tier>`) runs that tier's configured route. With routing off (`/router off`, `/model`),
|
|
16
15
|
Claude's model runs, as before.
|
|
17
16
|
- A route never loses its effort: an effort level moves only within what the model lists in `models.<alias>.efforts`,
|
|
@@ -19,6 +18,14 @@ In every mode:
|
|
|
19
18
|
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
19
|
- [MiniMax, MiMo and Kimi tables](providers.md#new-provider-modes) show every new preset's mode/activity combination.
|
|
21
20
|
|
|
21
|
+
For `auto`, `micro` is classifier demand 0, not a pinned table row. A tier pin sets exact demand for one turn,
|
|
22
|
+
without a mode margin; eligible model-effort candidates still obey hard constraints.
|
|
23
|
+
|
|
24
|
+
[Routing engines](configuration.md#routing-engine) are selected separately in the profile file. `auto` is opt-in;
|
|
25
|
+
`shadow` records proposals while `table` routes. Auto uses the mode only as a capability margin: `cost` subtracts 0.5
|
|
26
|
+
from demand, `balanced` adds nothing and `quality` adds 0.5, clamped to 0–3. Tier pins use exact demand without a
|
|
27
|
+
margin. Evaluation and default cutover are pending.
|
|
28
|
+
|
|
22
29
|
## Choose a mode
|
|
23
30
|
|
|
24
31
|
The mode comes from the first of these that sets one:
|
|
@@ -44,6 +51,8 @@ then the band says why the route stays. Pin a tier to run its configured route n
|
|
|
44
51
|
|
|
45
52
|
## Policy per mode
|
|
46
53
|
|
|
54
|
+
The policy patches in this section apply to `table` and `shadow`, not opt-in `auto`.
|
|
55
|
+
|
|
47
56
|
Each mode except `balanced` replaces some `policy` fields while it is active. The built-in values started as
|
|
48
57
|
codex-router's and are **not tuned** on outcomes. Since 1.16, `cost` upgrades on balanced's bar (2 votes from 0.75):
|
|
49
58
|
with 3 votes from 0.85, the cache write of a cold stronger model raised the bar to about 0.92 from 60k tokens and 0.97
|
package/docs/user-guide.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Start a session
|
|
4
4
|
|
|
5
|
-
Install the plugin from its marketplace, or load a checkout with `--plugin-dir /path/to/claude-router`:
|
|
5
|
+
The router needs Claude Code 2.1.321 or newer. Install the plugin from its marketplace, or load a checkout with `--plugin-dir /path/to/claude-router`:
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
8
|
claude plugin marketplace add alexei-led/claude-router
|
|
@@ -27,18 +27,33 @@ In Claude Code:
|
|
|
27
27
|
- **OpenAI**: an OpenAI API key. The prompt text goes to OpenAI.
|
|
28
28
|
- **Ollama**: no credential. Run `ollama serve` and pull the model; the prompt text stays on this machine.
|
|
29
29
|
3. To use another classifier, open the pane's **Classifier** tab and select its row. See [Choose the classifier](#choose-the-classifier).
|
|
30
|
-
4. Check the band above the prompt: `Routing on · ready`.
|
|
30
|
+
4. Check the band above the prompt: `Routing on · ready`. With `table` or `shadow`, a model not used by any tier or enabled activity override starts with routing off; the band says why. With `auto`, any model in the selected profile's catalog can start with routing on. `/router auto` turns routing on for the current engine if it is off. In `table`, classifier votes and cache economics gate tier changes; in `auto`, the capability target, routed demand and move gates govern changes. See [routing engine settings](configuration.md#routing-engine).
|
|
31
31
|
|
|
32
|
-
Keys are stored as sensitive plugin options. Do not paste them into a model conversation. The [configuration guide](configuration.md) covers settings and migrations.
|
|
32
|
+
The desktop app, VS Code and mobile cannot open the `/plugin configure` dialog, so their **Set up** and **Credentials → Edit** show a card with a line to run in a terminal: it asks for the key without showing it or keeping it in your shell history and saves it with `claude plugin configure <id> --values-stdin`; **Copy command** copies it, then run `/reload-plugins`. Keys are stored as sensitive plugin options. Do not paste them into a model conversation. The [configuration guide](configuration.md) covers settings and migrations.
|
|
33
33
|
|
|
34
34
|
In this guide, `router.json` means the selected router file. For example, with `CLAUDE_ROUTER_PROVIDER=zai`, edits go to `zai-router.json`.
|
|
35
35
|
The pane shows its provider and file path.
|
|
36
36
|
|
|
37
37
|
## Read the status band
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
### In the desktop app, VS Code and mobile
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
<!-- TODO: capture desktop screenshots: band, Now, Routes, Policy, Classifier, Usage, key card (dark and light) -->
|
|
42
|
+
|
|
43
|
+
The band above the prompt is drawn natively as one fixed row. Nothing appears on hover: every control is on the row itself. Colours come from the app's theme, so the band reads in light and dark.
|
|
44
|
+
|
|
45
|
+
- **Left**: a small tier meter icon, then the route (the model and effort for this turn), the activity, the reason, the classifier's support and the switch cost, in the words of the [terminal band](#in-the-terminal). When the window narrows, the left side gives way first.
|
|
46
|
+
- **Right**: the context and cache readings, a **Pin next turn** dropdown and the **Router** button, which opens the pane. The dropdown lists one entry per tier. With `table` or `shadow` each entry names the route that tier runs, whatever the routing mode; with `auto` it names the tier (`Low tier`), because Auto picks the cheapest capable model when the turn runs. A pin forces that tier for the next turn only. On mobile a pending pin also keeps its own `⏵ next` text and **✕** beside the dropdown, since an app may not draw the dropdown.
|
|
47
|
+
- **One control per state**: **Turn on** when routing is off, **Set up** when the active classifier lacks credentials, **Fix** when routing is unavailable. While routing is on, turn it off from the pane's header (**On** / **Off**) or with `/router off`.
|
|
48
|
+
- **Session row**: the second row (plan windows and the session's cost against no routing) is no longer a band button. Turn it on with **Show session row in band** on the pane's Now tab; Router remembers the choice across sessions.
|
|
49
|
+
|
|
50
|
+
While subagents run, a row of buttons under the band lists them, one per agent with the model, type and task (`agents 2 ▸ ■ Haiku 5.5 Explore · retry usages ●`). Press one to open that agent's transcript in the main view. The row lists three agents and then `+N`, and keeps the first agent and the count when the window narrows. It shows only while an agent runs, and never a teammate. In an agent's transcript the band has a **Back** button (`◂ main` in the terminal, **← Main** on these surfaces) that returns to the main conversation. The agent's model and who picked it are described under the terminal band.
|
|
51
|
+
|
|
52
|
+
### In the terminal
|
|
53
|
+
|
|
54
|
+
The terminal band is one line above the prompt. Its text, secondary text, accents, success, warning and error colours are your Claude Code theme's own, so a light theme reads as well as a dark one; tiers, models and activities keep their own colours. The line ends with a **Router** button that opens the pane. When the band is narrow, the less important parts drop first: classifier figures and the switch cost, then context and cache, then the activity, then the reason. The meter and the model always stay, except behind a classifier warning: the warning and its **Set up** button come first, and the route gives way to them.
|
|
55
|
+
|
|
56
|
+

|
|
42
57
|
|
|
43
58
|
Read the first line from left to right:
|
|
44
59
|
|
|
@@ -64,9 +79,9 @@ Read the first line from left to right:
|
|
|
64
79
|
|
|
65
80
|
**Turn on** and **Fix** sit next to the model and stay at any width.
|
|
66
81
|
|
|
67
|
-
|
|
82
|
+
#### The hover controls and two rows
|
|
68
83
|
|
|
69
|
-
While routing is on, hover over the band
|
|
84
|
+
While routing is on, hover over the band and its controls appear on the same row, in the room it has free, over its readings or after **Router**, and in both when one stretch is too small: a pin per tier, low to high, each named by what it runs (`▂▄ Haiku·high`); **Turn off**; and **2 rows** or **1 row**. Nothing moves: the meter and model, any **Set up**, **Details** or ✕ on the band, and **Router** stay where they are. A pin forces that tier for the next turn only. On a narrow band the pins lose their model names first. With one row, **2 rows** goes next, then the pins, and **Turn off** stays longest. With two rows, the pins go, then **Turn off**, and **1 row** stays longest. A band with no room for even one control shows none on hover; the pane's Now tab always has **band: 1 row** or **band: 2 rows** on its SESSION line, which does the same as the band's button. The hover controls need a pointer: from the keyboard, run `/router off`, or open the pane and press `f`; the SESSION line's toggle also takes a press.
|
|
70
85
|
|
|
71
86
|
**2 rows** adds the session under the route, in the same numbers as the pane's SESSION block. On a Claude plan it leads with the plan windows Claude Code reports:
|
|
72
87
|
|
|
@@ -85,13 +100,35 @@ When the row is short, the reset time, the counts and the words drop first; the
|
|
|
85
100
|
|
|
86
101
|
The band steps aside while a survey needs the space.
|
|
87
102
|
|
|
88
|
-
Inside a turn the router checks the route again as the work changes; see [Changes during a task](#changes-during-a-task). A subagent gets at most one model, when it starts, and keeps it for every step: For the Anthropic profile, these are Haiku for exploration, Opus for clearly hard tasks, and Sonnet for the rest. Other profiles have [their own defaults](providers.md#activity-overrides). An agent that pins a model in its definition keeps it, unless it sets `modelRouting: auto`. The Usage tab's **SUBAGENTS** section shows what each agent type ran on and cost, and the Now tab adds this session's agents to its total. See [Subagent routing](configuration.md#subagent-routing).
|
|
103
|
+
Inside a turn the router checks the route again as the work changes; see [Changes during a task](#changes-during-a-task). A subagent gets at most one model, when it starts, and keeps it for every step: For the Anthropic profile, these are Haiku for exploration, Opus for clearly hard tasks, and Sonnet for the rest. Other profiles have [their own defaults](providers.md#activity-overrides). An agent that pins a model in its definition keeps it, unless it sets `modelRouting: auto`. An agent started by a workflow script is routed like any other, unless it sets its own model or you set `workflow-subagent` to `null` under `subagents.types`, as in [Subagent routing](configuration.md#subagent-routing). A resumed agent keeps the model of its first start. The Usage tab's **SUBAGENTS** section shows what each agent type ran on and cost, and the Now tab adds this session's agents to its total. See [Subagent routing](configuration.md#subagent-routing).
|
|
89
104
|
|
|
90
105
|
In a subagent's transcript the band names the model the agent runs on and who picked it. `agent ■ Haiku 5.5 ↓ from Opus 5.5 (Claude Code’s pick)` means the router chose a cheaper model than Claude Code would have; `↑` means a higher declared strength rank. When ranks are unknown, a model change has no strength direction. A hollow `□` means the agent ran on Claude Code's pick, because the router agreed or did not route it, and says why: `agent □ Opus 5.5 = Claude Code’s pick: the workflow sets it`. A narrow band drops the comparison first. The band falls back to `agent · model chosen at spawn` when the router has no record of the agent, such as after a plugin reload, and to `agent · keeps its own model (subagent routing off)`.
|
|
91
106
|
|
|
92
107
|
## Open the router pane
|
|
93
108
|
|
|
94
|
-
Run `/router` or select **Router** above the prompt. Without a UI surface, as in `claude -p`, `/router` prints a short status instead. The pane has five tabs. Select a tab or press its digit while the pane has focus.
|
|
109
|
+
Run `/router` or select **Router** above the prompt. Without a UI surface, as in `claude -p`, `/router` prints a short status instead. The pane has five tabs. Select a tab or press its digit (1 to 5) while the pane has focus.
|
|
110
|
+
|
|
111
|
+
### The pane in the desktop app, VS Code and mobile
|
|
112
|
+
|
|
113
|
+
The pane is drawn natively. From the top it has:
|
|
114
|
+
|
|
115
|
+
- a **header**: `Router`, the classifier's status, and an **On** / **Off** switch for routing;
|
|
116
|
+
- the **tabs**: Now, Routes, Policy, Classifier and Usage, without digits in their labels (the hotkeys 1 to 5 still work);
|
|
117
|
+
- one **warnings** slot under the tabs, shown on every tab: an ignored project config, a native fallback, or missing classifier credentials;
|
|
118
|
+
- the tab's content, then the **save bar** last.
|
|
119
|
+
|
|
120
|
+
What each tab shows:
|
|
121
|
+
|
|
122
|
+
- **Now**: cards for Next turn (the route, the reason, a pin button per tier, named by route or, with `auto`, by tier), Plan usage (on a Claude plan), Context, This session and, once the session has any, Recent decisions. The Next turn and This session cards carry the same facts as the terminal blocks below. The tab also holds the **Show session row in band** setting.
|
|
123
|
+
- **Routes**: a grid of tiers by activities, with an edit card under it for the selected cell.
|
|
124
|
+
- **Policy**: form cards for Routing mode, Switching down, Switching up, Activities and Credits, and a Settings file card with the `router.json` path.
|
|
125
|
+
- **Classifier**: a full card for the active classifier (deadline, wait, health, credentials) and compact rows for the others under **Other classifiers**, then **Across sessions**.
|
|
126
|
+
- **Usage**: period buttons, then Summary, Trend, Breakdown, Worth a look, Subagents, About these numbers and **Delete history**.
|
|
127
|
+
|
|
128
|
+
Unsaved Routes and Policy changes sit in an **Unsaved changes** card at the bottom, a table of each setting before and after with **Discard** and **Save**; the last save and **Undo** follow it. **?** opens an **About the router** card. When the classifier needs attention, the header says so and the warning under the tabs says what to do. Saving, undoing and the numbers behind each card follow the terminal descriptions below.
|
|
129
|
+
|
|
130
|
+
### The pane in the terminal
|
|
131
|
+
|
|
95
132
|
|
|
96
133
|
| Tab | What it answers |
|
|
97
134
|
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -101,20 +138,22 @@ Run `/router` or select **Router** above the prompt. Without a UI surface, as in
|
|
|
101
138
|
| 4 Classifier | Which classifier to ask: one row per classifier to compare, the active one's deadline, wait, health and credentials, and the counts kept across sessions. |
|
|
102
139
|
| 5 Usage | What routing cost against no routing this session, today, over 7 or 30 days, this month or in all: by activity, model or tier, and what is worth a look. |
|
|
103
140
|
|
|
104
|
-
|
|
141
|
+
Under the tab row, one slot shows the warnings on every tab: a project config that was ignored, a native fallback, and missing classifier credentials. They no longer sit inside the Now tab's NEXT TURN block.
|
|
142
|
+
|
|
143
|
+
The top line of every tab, `ROUTER [ ◉ on ] [ ○ off ] Jev ready · 347 ms`, shows the routing mode, switches it, and says whether the classifier is ready. Press `o` or `f` while the pane has focus. The tabs under it carry their digits, `[ 1 Now ] [ 2 Routes ] …`, and **?** shows what the numbers mean above the tab. In a pane too narrow for them, the tabs drop the digits (the keys still work), and then **?** moves to the end of the top line. While the warnings under the tabs name missing classifier credentials, the top line says `see below` instead of repeating them. When routing is unavailable, the top line reads `ROUTER unavailable Claude’s model is kept` with the reason under it, and offers no on or off: see [Troubleshooting](#troubleshooting).
|
|
105
144
|
|
|
106
145
|

|
|
107
146
|
|
|
108
147
|
The **Now** tab has four blocks, each with its name in capitals.
|
|
109
148
|
|
|
110
|
-
**NEXT TURN** answers "what runs next turn, and why". The first line is the tier meter, the model and effort, and the classifier's activity with its share, such as `code 84% debug 8%`. When an activity override runs, a line under it names the tier's own route. **why** gives the reason in the band's words and, beside it, the classifier's support against the bar the policy set and the switch cost: `↑ clearly stronger Jev 88% ≥ 82% · switch ≈ $0.48`. **pin** has one button per tier, low to high, each named by what it runs, such as `▂▄ Haiku·high 3%`, with the support the classifier gave it on the last turn; `▶` marks the tier that runs now. A press forces that tier for the next turn only
|
|
149
|
+
**NEXT TURN** answers "what runs next turn, and why". The first line is the tier meter, the model and effort, and the classifier's activity with its share, such as `code 84% debug 8%`. When an activity override runs, a line under it names the tier's own route. **why** gives the reason in the band's words and, beside it, the classifier's support against the bar the policy set and the switch cost: `↑ clearly stronger Jev 88% ≥ 82% · switch ≈ $0.48`. **pin** has one button per tier, low to high, each named by what it runs, such as `▂▄ Haiku·high 3%`, with the support the classifier gave it on the last turn; `▶` marks the tier that runs now. A press forces that tier for the next turn only; the pinned button stays highlighted until the pin applies, and pressing it again unpins. With routing off, the block names Claude's model, `routing off · /model choice`, and the pins say they need routing on; nothing from an earlier routed turn stays.
|
|
111
150
|
|
|
112
151
|
**PLAN** appears on a Claude plan: Claude Code's 5-hour and 7-day windows as gauges, with when each resets. They turn yellow at 75% and red at 90%.
|
|
113
152
|
|
|
114
153
|
**SESSION** sums this session, the main thread and its subagents: `since 14:18 · 86 replies · 6 agents · 9 switches`, and `● 1 running` while a subagent is in the middle of a turn (an agent that waits on its own background command is not counted until it resumes). The counts include the replies of the turn still running.
|
|
115
154
|
|
|
116
155
|
```text
|
|
117
|
-
SESSION since 14:18 · 86 replies · 6 agents · 9 switches ● 1 running
|
|
156
|
+
SESSION since 14:18 · 86 replies · 6 agents · 9 switches ● 1 running [ band: 2 rows ]
|
|
118
157
|
≈$8.97 API estimate · plan quota, not a charge [ Usage ]
|
|
119
158
|
−$4.09 (−31%) vs unrouted ≈$13.06
|
|
120
159
|
main ≈$6.45 ████████████████ −$4.17 vs Opus 5.5 · xhigh
|
|
@@ -283,6 +322,12 @@ and unpriced causes, not semantic success or task acceptance. A caller must eval
|
|
|
283
322
|
|
|
284
323
|
### Changes during a task
|
|
285
324
|
|
|
325
|
+
The route-table behavior below applies to the default `table` engine and to `shadow`. With opt-in `auto`, each
|
|
326
|
+
continuation reassesses context, images, availability and the cash cap; classifier reviews update demand, and observed
|
|
327
|
+
code or docs can end a bounded-execute discount. It does not use activity route-table moves. A tier pin retains its
|
|
328
|
+
demand for the turn but can be refitted when constraints change. If nothing fits, the native request runs with
|
|
329
|
+
`no-route-native`. See [automatic routing](configuration.md#routing-engine). Quality evaluation and cutover are pending.
|
|
330
|
+
|
|
286
331
|
The classifier labels a turn from its prompt, and the work can change after that: a brief that reads as `ops` may turn into an hour of coding, and a hard fix may end in routine commands. The router therefore checks the route again while a task runs, for the tier and the activity, in both directions.
|
|
287
332
|
|
|
288
333
|
- **On every later step of a turn** it reads the turn's tool calls. A turn labelled `ops` or `explore` that edits a code file moves at once to the tier's `code` route (`docs` when it edits only Markdown or `docs/` files). The tools are the evidence, so this needs no classifier support, and the cache cost does not hold it back; only the cash cap on a credits-billed model can. This move only goes up. The toast and the band show it as `↗ coding`.
|
|
@@ -304,7 +349,7 @@ On the running task:
|
|
|
304
349
|
|
|
305
350
|
These thresholds are starting values. They are not tuned on data yet.
|
|
306
351
|
|
|
307
|
-
On Claude Code 2.1.322 an effort that the router changed inside a turn was not sent in the 6 cases found, while a changed model was, so the band and the decision record can name an effort that did not run. See [What we do not know yet](activity-routing.md#what-we-do-not-know-yet).
|
|
352
|
+
On Claude Code 2.1.322 an effort that the router changed inside a turn was not sent in the 6 cases found, while a changed model was, so the band and the decision record can name an effort that did not run. Claude Code sends an effort change on a tool-result step only when `CLAUDE_CODE_MODEL_CAPABILITIES=per_turn_effort` is set in its environment; the router does not set it. See [What we do not know yet](activity-routing.md#what-we-do-not-know-yet).
|
|
308
353
|
|
|
309
354
|
### Read the activity on the pane
|
|
310
355
|
|
|
@@ -322,25 +367,38 @@ On the **Classifier** tab, **ACROSS SESSIONS · since the last reset** shows the
|
|
|
322
367
|
| Command or action | Result |
|
|
323
368
|
| ---------------------------------------- | --------------------------------------------------------------------------------------------------------- |
|
|
324
369
|
| `/router` | Open the pane. |
|
|
325
|
-
| `/router auto` |
|
|
370
|
+
| `/router auto` | Turn routing on for this session using the engine selected in the profile. It does not change the engine. |
|
|
326
371
|
| `/router off` | Turn routing off and keep Claude's selected model. |
|
|
327
372
|
| `/router pin <micro\|low\|medium\|high>` | Pin the next turn and its tool continuations. Routing on must already be enabled. |
|
|
328
373
|
| `/router activities <off\|on>` | Set the [activity routing](#route-by-activity) mode. Saved to `router.json` at once; **Undo** reverts it. |
|
|
329
374
|
| `/router mode <cost\|balanced\|quality>` | Set this session's [routing mode](routing-modes.md) from the next turn. A resume keeps it. |
|
|
330
375
|
| `/router mode default` | Clear the session's mode: the project's or the profile's applies again. |
|
|
331
376
|
| `/router decisions [n]` | Print this session's last `n` routing decisions, 20 by default. See [Routing decisions](#routing-decisions). |
|
|
377
|
+
| `/router line <off\|moves\|all>` | Choose when a turn leaves a [route line](#the-route-line) in the transcript. `moves` is the default. Kept across sessions. |
|
|
332
378
|
| `/model <name>` | Select a model and turn routing off. Use `/router auto` to turn it back on. |
|
|
333
379
|
| **Turn on** / **Turn off** on the band | The same as `/router auto` and `/router off`. |
|
|
334
380
|
| **on** / **off** on the pane (`o` / `f`) | The same as `/router auto` and `/router off`. |
|
|
335
381
|
| **pin** on the Now tab | Pin that tier for the next turn. Routing on must already be enabled. |
|
|
336
382
|
|
|
337
|
-
|
|
383
|
+
Type `/router` and a space, then a letter, and the prompt offers the words that start with it (`auto`, `off`, `pin <tier>`, `mode <mode>`, `activities <off|on>`, `line <off|moves|all>`, `decisions [n]`, `trace export`). After `pin `, `mode `, `activities ` or `line ` it offers the values; `pin` names the model each tier runs. The rows come after Claude Code's own. They are drawn by the surface's prompt box, so a surface that does not raise the typeahead shows none.
|
|
384
|
+
|
|
385
|
+
With `table` or `shadow`, a routing mode moves each tier's route one step toward cost or quality; pins and `micro` turns are not moved. With opt-in `auto`, the mode changes the demand margin instead, and a tier pin uses exact demand without a margin. The band and the Now tab show the mode and where it comes from, such as `cost (session)`. When the mode kept the cell's model and changed only its effort, as `cost` does for Opus at `high`, the band adds `effort only`: the cost estimates price the same tokens on both routes, so that change shows no difference there, though real output length can differ. A change applies from the next turn, and the route in use moves only through the usual checks, so on a running task a cheaper route can wait a few requests and for a checkpoint. **Mode** on the Policy tab sets the profile's mode. See [Routing modes](routing-modes.md).
|
|
386
|
+
|
|
387
|
+
### The route line
|
|
388
|
+
|
|
389
|
+
After a routed turn, Router can add one dim row at the end of the transcript that says which model and effort ran and why, in the band's words: `▂▄▆█ Sonnet 5.5 · high ↓ cheaper fits code`. A narrow window drops the classifier's support, then the activity, then the reason; the route stays.
|
|
390
|
+
|
|
391
|
+
- `/router line moves` (the default) adds the row only when the turn ran another model or effort than the last routed turn, and on a session's first routed turn.
|
|
392
|
+
- `/router line all` adds it after every routed turn, and `/router line off` never.
|
|
393
|
+
|
|
394
|
+
No row is added for an interrupted turn, a subagent's turn, or a turn while routing is off. The row is for you: the model never reads it, `claude --resume` does not bring earlier rows back, and a compaction ends the rows above it. The setting has no control in the pane; it is kept in the plugin's store across sessions, not in `router.json`.
|
|
338
395
|
|
|
339
396
|
### Routing decisions
|
|
340
397
|
|
|
341
398
|
Each routed turn adds rows to the session's decision record in `$.store` (`decisions:v1:<session id>`): one when the turn starts, one per classifier review or tool-based move inside it, and one when it ends. A row holds the prompt's origin (`composer`, `task-notification`, …, or `unknown`), the classifier's tier and activity with their shares, whether it counted as the running task, the tier, activity, route and reason chosen, and at the end the turn's tool bucket and how many replies were priced. It holds no prompt, tool or file text. The route is the one chosen, which is not always the one sent; see [Changes during a task](#changes-during-a-task). `/router decisions [n]` prints them. For a tier move or an activity move up, taken or held, the row also holds the probability mass the policy compared and the bar it compared it with, printed after the reason: `(upgrade-pending 52% vs bar 79%)`. A held move can show a mass above its bar: it then waits for a second vote or for a checkpoint. On `downgrade-pending` the mass is the support for the classifier's own choice; a tier between it and the running one can be closer to its bar. A `jump`, a move on the turn's own tool calls and a context or availability override show neither number. Each session keeps its newest 60 rows; records of the 20 most recent other sessions stay, for at most 30 days. **Delete history** deletes them all.
|
|
342
399
|
|
|
343
|
-
|
|
400
|
+
For `auto`, decision rows also show demand, target, outcome, move reason and a conditional next-turn cost estimate,
|
|
401
|
+
not measured savings. A tier pin does not change the next turn after the pinned turn finishes. With `table` or `shadow`, a fresh session starts with routing on for a model a tier routes to, or, with activity routing `on`, a model an activity override uses (Sonnet 5.5 on the defaults). With `auto`, any model in the configured catalog starts with routing on, even if no table route names it. 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.
|
|
344
402
|
|
|
345
403
|
## Edit routes and policy
|
|
346
404
|
|
|
@@ -398,7 +456,7 @@ The three Clef models take the same request and the same Cloudflare credentials,
|
|
|
398
456
|
|
|
399
457
|

|
|
400
458
|
|
|
401
|
-
You can save credentials for all of them; only the active one is asked. The **Classifier** tab has one row per classifier, as columns to compare: `◉` marks the active one; then where the prompt goes (`this machine` for Ollama); its last checked-in [activity probe](evaluation.md#activity-probe-set), the test prompts with a known activity it answered right, such as `70/70`, and their p95 wait; and whether its credentials are complete. A row that lacks one names it, such as `○ no API token`, and has its own **Set up** button. The probe columns read `—` when you configured a model other than the probed one.
|
|
459
|
+
You can save credentials for all of them; only the active one is asked. The **Classifier** tab has one row per classifier, as columns to compare: `◉` marks the active one; then where the prompt goes (`this machine` for Ollama); its last checked-in [activity probe](evaluation.md#activity-probe-set), the test prompts with a known activity it answered right, such as `70/70`, and their p95 wait; and whether its credentials are complete. A row that lacks one names it, such as `○ no API token`, and has its own **Set up** button. In a pane too narrow for the widest row, about 80 columns, each classifier takes two lines instead: its name, status and **Set up**, then where the prompt goes and its probe result, such as `api.cloudflare.com · 69/70 · p95 883 ms`. The probe columns read `—` when you configured a model other than the probed one.
|
|
402
460
|
|
|
403
461
|
Select a row to switch. The choice is written to `router.json` at once and applies from the next turn. **Undo** in the status bar returns to the previous classifier. A turn that is already being classified finishes with the classifier it started with. The new classifier starts with a clean failure count.
|
|
404
462
|
|
|
@@ -406,7 +464,7 @@ Under the rows, a block for the active classifier:
|
|
|
406
464
|
|
|
407
465
|
- **Deadline:** 500, 1,000, 1,500, 3,000, or 5,000 ms for the active classifier's total advice attempt, including any retry. Each classifier keeps its own deadline, saved at once, with **Undo**. Beside it is the classifier's p95 wait: across sessions, such as `p95 ≤ 400 ms over 15 turns`, or from its probe before any turn. It turns yellow when the wait is slower than the deadline. Past the deadline the turn keeps its model.
|
|
408
466
|
- **Sends** names the service that receives prompt text. **Health** shows a pause, recent failures, and the last wait.
|
|
409
|
-
- **Credentials**: **Edit** opens Claude Code's secure plugin configuration, where you enter them.
|
|
467
|
+
- **Credentials**: **Edit** opens Claude Code's secure plugin configuration, where you enter them. On the desktop app, VS Code and mobile it shows the card with the command to run in a terminal instead.
|
|
410
468
|
|
|
411
469
|
With activity routing `on`, the activity question goes in the same request as the tier question (Ollama makes a second call), with the same text and nothing more. **Sends** names the service that receives the prompt and recent dialogue. With Clef, Clef Flash or Clef Omni that is Cloudflare, not typesafe.ai; with OpenAI it is OpenAI; with Ollama it stays on this machine. Give the Cloudflare token Workers AI permissions only.
|
|
412
470
|
|
|
@@ -458,8 +516,10 @@ To stop routing for a session, run `/router off`. To keep tier routing but stop
|
|
|
458
516
|
| `⚠ Ollama timed out` | The model is loading after an idle period, or the machine is slow. | Wait for one more turn. If it recurs, raise `classifiers.ollama.timeoutMs` in `router.json`. |
|
|
459
517
|
| `⚠ Ollama request failed` | The tag in `model` is not pulled, or Ollama rejected a request setting. | Run `ollama pull <model>` for the tag in `model`, or choose another model. |
|
|
460
518
|
| Band reads `v0.8 gateway settings remain` | The `jev-router[1m]` model or the `127.0.0.1:43170` base URL is still set. | Run `/router`: it lists the keys. Remove them as in the [migration checklist](configuration.md#convert-a-v08-configuration) and restart. |
|
|
461
|
-
| Router controls are unavailable | Claude Code is older than 2.1.
|
|
519
|
+
| Router controls are unavailable | Claude Code is older than 2.1.321. | Update Claude Code. |
|
|
462
520
|
| Pane reads `ROUTER unavailable` | Old gateway settings, an old Claude Code, or an invalid `router.json`. The line under it names which. | Fix the cause it names and restart. Until then every turn keeps Claude's model, and `/router auto`, `off`, `pin`, and `activities` reply with the reason and change nothing. |
|
|
463
521
|
| Context reads as unknown | The router lacks a reliable local estimate or current-history measurement. | Keep using the current model, or start a new history with a supported context estimate. |
|
|
464
522
|
|
|
523
|
+
When a session starts with the router unavailable, a toast says why (`Routing off: requires Claude Code 2.1.321 or newer. Claude’s model is kept.`). It shows once a day for each cause (old Claude Code, v0.8 gateway settings, a `router.json` that does not load) and never under `claude -p`. The band and the pane keep saying it.
|
|
524
|
+
|
|
465
525
|
For the internal event flow and network deadline behavior, see [Architecture](architecture.md). For what the test traces do and do not show, see [Evaluation](evaluation.md).
|