@alexeiled/claude-router 1.9.0 → 1.10.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 +22 -0
- package/README.md +3 -3
- package/docs/activity-routing.md +35 -34
- package/docs/architecture.md +5 -7
- package/docs/configuration.md +25 -23
- package/docs/evaluation.md +8 -9
- package/docs/native-router.md +15 -16
- package/docs/router-band.svg +3 -21
- package/docs/router-pane-classifier.svg +82 -63
- package/docs/router-pane-now.svg +95 -109
- package/docs/router-pane-policy.svg +70 -0
- package/docs/router-pane-routes.svg +103 -0
- package/docs/router-pane-usage.svg +100 -127
- package/docs/user-guide.md +63 -49
- package/hooks/native-router.mjs +20 -50
- package/lib/activity-stats.mjs +21 -70
- package/lib/band.mjs +3 -6
- package/lib/config.mjs +11 -8
- package/lib/cost.mjs +3 -3
- package/lib/display.mjs +14 -41
- package/lib/panel.mjs +651 -477
- package/lib/route.mjs +4 -53
- package/lib/subagents.mjs +12 -17
- package/lib/view.mjs +3 -3
- package/package.json +1 -1
- package/types/index.d.ts +10 -36
- package/docs/router-pane-routing.svg +0 -150
package/lib/route.mjs
CHANGED
|
@@ -42,7 +42,6 @@ export function emptyLoop(config, model) {
|
|
|
42
42
|
return {
|
|
43
43
|
lastRoute: cell?.tier ?? config.baselineTier,
|
|
44
44
|
lastActivity: cell?.activity ?? null,
|
|
45
|
-
would: null,
|
|
46
45
|
state: initialState(),
|
|
47
46
|
models: {},
|
|
48
47
|
resolutions: {},
|
|
@@ -69,7 +68,6 @@ export function resetHistory(loop) {
|
|
|
69
68
|
resolutions: {},
|
|
70
69
|
historyMeasured: false,
|
|
71
70
|
state: freshState(loop.state),
|
|
72
|
-
would: loop.would ? { ...loop.would, state: freshState(loop.would.state) } : null,
|
|
73
71
|
// The active turn keeps its route, pin and fallback suspension; the next turn decides afresh.
|
|
74
72
|
ineligible: [],
|
|
75
73
|
yoursBy: {},
|
|
@@ -108,71 +106,24 @@ function economicConfig(config, loop) {
|
|
|
108
106
|
return { ...config, models };
|
|
109
107
|
}
|
|
110
108
|
|
|
111
|
-
// `activityRouting` decides which activity the
|
|
112
|
-
// decision a second time as `on` for `decision.wouldRoute` only, and the chosen one in `on`. Shadow keeps its own cell
|
|
113
|
-
// and policy state in `loop.would`, so each would-route continues from the previous one, as `on` would. Its limit: the
|
|
114
|
-
// would-route never runs, so its cache is never observed and an unobserved incumbent is priced as `inputBounds`
|
|
115
|
-
// prices any unknown cache.
|
|
109
|
+
// `activityRouting` decides which activity the route may use: none in `off`, the chosen one in `on`.
|
|
116
110
|
export function chooseRoute(config, loop, input) {
|
|
117
111
|
const { pin, facts } = input;
|
|
118
112
|
const applied = routeTurn(config, loop, input);
|
|
119
|
-
let wouldRoute = null;
|
|
120
|
-
let would = null;
|
|
121
|
-
if (config.activityRouting === 'shadow') {
|
|
122
|
-
const from = loop.would ?? {
|
|
123
|
-
lastRoute: loop.lastRoute,
|
|
124
|
-
lastActivity: loop.lastActivity ?? null,
|
|
125
|
-
state: loop.state,
|
|
126
|
-
};
|
|
127
|
-
const run = routeTurn(
|
|
128
|
-
{ ...config, activityRouting: 'on' },
|
|
129
|
-
{ ...loop, ...from },
|
|
130
|
-
{
|
|
131
|
-
...input,
|
|
132
|
-
facts: { ...facts, lastRoute: from.lastRoute },
|
|
133
|
-
},
|
|
134
|
-
);
|
|
135
|
-
const { activity, tier, model, effort, reason, lateral } = run;
|
|
136
|
-
// What the would-route's next request costs against the applied one's; a route priced against itself would
|
|
137
|
-
// still give a spread, so only a different request is priced.
|
|
138
|
-
const priced =
|
|
139
|
-
input.contextKnown &&
|
|
140
|
-
loop.lastRequest &&
|
|
141
|
-
run.tier &&
|
|
142
|
-
applied.tier &&
|
|
143
|
-
(run.model !== applied.model || run.effort !== applied.effort);
|
|
144
|
-
const difference = priced
|
|
145
|
-
? costs.nextTurnRange(
|
|
146
|
-
economicConfig(config, loop),
|
|
147
|
-
resolveRoute(config, run.tier, run.activity),
|
|
148
|
-
resolveRoute(config, applied.tier, applied.activity ?? null),
|
|
149
|
-
facts,
|
|
150
|
-
input.now,
|
|
151
|
-
)
|
|
152
|
-
: null;
|
|
153
|
-
wouldRoute = { activity, tier, model, effort, reason, lateral, difference };
|
|
154
|
-
const stays = pin || !run.tier;
|
|
155
|
-
would = {
|
|
156
|
-
lastRoute: stays ? from.lastRoute : run.tier,
|
|
157
|
-
lastActivity: stays ? from.lastActivity : run.activity,
|
|
158
|
-
state: run.state,
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
113
|
const kept = pin || !applied.tier;
|
|
162
114
|
return {
|
|
163
115
|
...loop,
|
|
164
116
|
state: applied.state,
|
|
165
117
|
lastRoute: kept ? loop.lastRoute : applied.tier,
|
|
166
118
|
lastActivity: kept ? activityOf(config, loop) : applied.activity,
|
|
167
|
-
would,
|
|
168
119
|
turnId: facts.turnKey,
|
|
169
|
-
decision:
|
|
120
|
+
decision: applied,
|
|
170
121
|
suspended: false,
|
|
171
122
|
};
|
|
172
123
|
}
|
|
173
124
|
|
|
174
125
|
// The activity of the route running now. Outside `on` there is none, even one a turn in `on` left in the loop before
|
|
175
|
-
// the mode changed: `off`
|
|
126
|
+
// the mode changed: `off` is the 1.5 decision.
|
|
176
127
|
const activityOf = (config, loop) => (config.activityRouting === 'on' ? (loop.lastActivity ?? null) : null);
|
|
177
128
|
|
|
178
129
|
// One decision (plan §5.2) for the cell `{ tier, activity }` it lands on. Outside `on` the activity is null throughout.
|
|
@@ -231,7 +182,7 @@ function routeTurn(config, loop, { facts, advice, pin, nativeModel, contextKnown
|
|
|
231
182
|
const candidate = pin ?? advice?.choice;
|
|
232
183
|
if (contextKnown && loop.lastRequest && TIERS.includes(candidate) && candidate !== loop.lastRoute) {
|
|
233
184
|
const [to, from] = [resolveRoute(config, candidate, activity), routeOf(last)];
|
|
234
|
-
const forecast = costs.
|
|
185
|
+
const forecast = costs.switchEconomics(projected, to, from, facts, now);
|
|
235
186
|
comparison = {
|
|
236
187
|
candidate,
|
|
237
188
|
incumbent: loop.lastRoute,
|
package/lib/subagents.mjs
CHANGED
|
@@ -117,12 +117,11 @@ export function coreModelOf(config, spawn, { envModel = null, force = false, def
|
|
|
117
117
|
|
|
118
118
|
// One spawn's record while its agent runs: what was decided and the priced replies since the last flush. `pass` is a
|
|
119
119
|
// PASS_REASONS entry or null. `choice` is the models key decided, or 'core' when the decision kept core's model.
|
|
120
|
-
// `actualUsd` prices each reply on the model it ran on; `otherUsd` the same tokens on
|
|
121
|
-
//
|
|
122
|
-
export function spawnRecord({ sessionId,
|
|
120
|
+
// `actualUsd` prices each reply on the model it ran on; `otherUsd` the same tokens on core's estimated model. Null for
|
|
121
|
+
// a pass-through.
|
|
122
|
+
export function spawnRecord({ sessionId, spawn, pass, choice, routedModel, coreModel, failed, respawn }) {
|
|
123
123
|
return {
|
|
124
124
|
sessionId,
|
|
125
|
-
mode,
|
|
126
125
|
type: spawn.subagentType,
|
|
127
126
|
pass,
|
|
128
127
|
choice,
|
|
@@ -151,7 +150,7 @@ export function addAgentReply(config, agent, usage, ttl) {
|
|
|
151
150
|
const next = { ...agent, requests: agent.requests + 1 };
|
|
152
151
|
const write = config.cache.writeMultiplier[ttl];
|
|
153
152
|
const actual = modelSpec(config, usage?.model);
|
|
154
|
-
const other = agent.pass ? null : modelSpec(config, agent.
|
|
153
|
+
const other = agent.pass ? null : modelSpec(config, agent.coreModel);
|
|
155
154
|
const priced = (spec) => spec && Number.isFinite(spec.output);
|
|
156
155
|
if (!Object.values(counts).every(isCount) || !Number.isFinite(write) || !priced(actual)) return next;
|
|
157
156
|
if (!agent.pass && !priced(other)) return next;
|
|
@@ -162,9 +161,10 @@ export function addAgentReply(config, agent, usage, ttl) {
|
|
|
162
161
|
}
|
|
163
162
|
|
|
164
163
|
// A record kept across sessions, one session's or their sum, since `since` (ms), the first agent after a reset.
|
|
165
|
-
// `routed[
|
|
164
|
+
// `routed.on[type]` counts the routed types; `passed[reason]` the pass-throughs, priced on the model they ran on. Records
|
|
165
|
+
// saved before 1.10.1 may also hold `routed.shadow`, which reads as dropped.
|
|
166
166
|
export function emptySubagentStore() {
|
|
167
|
-
return { version: 1, since: null, routed: {
|
|
167
|
+
return { version: 1, since: null, routed: { on: {} }, passed: {} };
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
const ROUTED_SUMS = ['agents', 'differs', 'requests', 'pricedRequests', 'coreUsd', 'routedUsd', 'respawns', 'failures'];
|
|
@@ -189,9 +189,8 @@ export function recordAgent(store, agent, now) {
|
|
|
189
189
|
next.passed[agent.pass] = counts;
|
|
190
190
|
return next;
|
|
191
191
|
}
|
|
192
|
-
const byType = { ...next.routed
|
|
192
|
+
const byType = { ...next.routed.on };
|
|
193
193
|
const counts = { ...(byType[agent.type] ?? emptyRouted()), choices: { ...byType[agent.type]?.choices } };
|
|
194
|
-
const shadow = agent.mode === 'shadow';
|
|
195
194
|
counts.agents += first;
|
|
196
195
|
counts.differs += first && agent.routedModel !== agent.coreModel ? 1 : 0;
|
|
197
196
|
counts.respawns += first && agent.respawn ? 1 : 0;
|
|
@@ -199,10 +198,10 @@ export function recordAgent(store, agent, now) {
|
|
|
199
198
|
if (first) counts.choices[agent.choice] = (counts.choices[agent.choice] ?? 0) + 1;
|
|
200
199
|
counts.requests += agent.requests;
|
|
201
200
|
counts.pricedRequests += agent.pricedRequests;
|
|
202
|
-
counts.coreUsd +=
|
|
203
|
-
counts.routedUsd +=
|
|
201
|
+
counts.coreUsd += agent.otherUsd;
|
|
202
|
+
counts.routedUsd += agent.actualUsd;
|
|
204
203
|
byType[agent.type] = counts;
|
|
205
|
-
next.routed
|
|
204
|
+
next.routed = { on: byType };
|
|
206
205
|
return next;
|
|
207
206
|
}
|
|
208
207
|
|
|
@@ -243,10 +242,7 @@ export function readSubagentStore(value) {
|
|
|
243
242
|
return {
|
|
244
243
|
version: 1,
|
|
245
244
|
since: value.since,
|
|
246
|
-
routed: {
|
|
247
|
-
shadow: readMap(value.routed?.shadow, ROUTED_SUMS, true),
|
|
248
|
-
on: readMap(value.routed?.on, ROUTED_SUMS, true),
|
|
249
|
-
},
|
|
245
|
+
routed: { on: readMap(value.routed?.on, ROUTED_SUMS, true) },
|
|
250
246
|
passed: readMap(value.passed, PASSED_SUMS, false),
|
|
251
247
|
};
|
|
252
248
|
}
|
|
@@ -272,7 +268,6 @@ export function mergeSubagentStores(values, resetAt = null) {
|
|
|
272
268
|
for (const one of values.map((value) => subagentsAfterReset(readSubagentStore(value), resetAt))) {
|
|
273
269
|
const since = [merged.since, one.since].filter(Number.isFinite);
|
|
274
270
|
merged.since = since.length ? Math.min(...since) : null;
|
|
275
|
-
addInto(merged.routed.shadow, one.routed.shadow, ROUTED_SUMS, true);
|
|
276
271
|
addInto(merged.routed.on, one.routed.on, ROUTED_SUMS, true);
|
|
277
272
|
addInto(merged.passed, one.passed, PASSED_SUMS, false);
|
|
278
273
|
}
|
package/lib/view.mjs
CHANGED
|
@@ -35,7 +35,6 @@ export function initialView(model) {
|
|
|
35
35
|
activity: null,
|
|
36
36
|
activityChoice: null,
|
|
37
37
|
activityProbabilities: null,
|
|
38
|
-
wouldRoute: null,
|
|
39
38
|
history: [],
|
|
40
39
|
tiers: [],
|
|
41
40
|
activities: [],
|
|
@@ -54,6 +53,8 @@ export function initialView(model) {
|
|
|
54
53
|
routeDraft: null,
|
|
55
54
|
lastWrite: null,
|
|
56
55
|
tab: 'now',
|
|
56
|
+
routeCell: null,
|
|
57
|
+
usageDetail: false,
|
|
57
58
|
help: false,
|
|
58
59
|
notice: null,
|
|
59
60
|
};
|
|
@@ -69,11 +70,10 @@ export const CLEARED_READINGS = {
|
|
|
69
70
|
estimate: null,
|
|
70
71
|
activityChoice: null,
|
|
71
72
|
activityProbabilities: null,
|
|
72
|
-
wouldRoute: null,
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
// The view patch for a tool continuation's route. In `on` the activity label is the route's, which a fallback to the
|
|
76
|
-
// native model drops
|
|
76
|
+
// native model drops.
|
|
77
77
|
export function continuationView(config, decision, context) {
|
|
78
78
|
return {
|
|
79
79
|
selectedModel: decision.model,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexeiled/claude-router",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.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",
|
package/types/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ declare module 'claude-code' {
|
|
|
4
4
|
// What kind of work a turn does (ACTIVITIES in lib/config.mjs); 'uncertain' only as a classifier answer.
|
|
5
5
|
type RouterActivity = 'code' | 'debug' | 'explore' | 'plan' | 'review' | 'ops' | 'docs';
|
|
6
6
|
type RouterActivityAnswer = RouterActivity | 'uncertain';
|
|
7
|
-
type RouterActivityMode = 'off' | '
|
|
7
|
+
type RouterActivityMode = 'off' | 'on';
|
|
8
8
|
// A finished turn's bucket, read from its tool calls.
|
|
9
9
|
type RouterObserved = 'code' | 'docs' | 'ops' | 'read' | 'talk';
|
|
10
10
|
// A route change inside the incumbent's tier: taken, refused (does not pay back, a hold, the cash gate), or none.
|
|
@@ -20,28 +20,6 @@ declare module 'claude-code' {
|
|
|
20
20
|
probabilities: Record<RouterActivityAnswer, number>;
|
|
21
21
|
} | null;
|
|
22
22
|
}
|
|
23
|
-
// A next-request cost difference in USD at configured list prices; negative is cheaper.
|
|
24
|
-
interface RouterUsdRange {
|
|
25
|
-
minUsd: number;
|
|
26
|
-
maxUsd: number;
|
|
27
|
-
}
|
|
28
|
-
// What `on` would do, computed in `shadow`. `model` is a model id, as `decision.model`. `difference` prices its next
|
|
29
|
-
// request against the applied route's; null when the routes match or there is no measured request yet.
|
|
30
|
-
interface RouterWouldRoute {
|
|
31
|
-
activity: RouterActivity | null;
|
|
32
|
-
tier: RouterTier | null;
|
|
33
|
-
model: string;
|
|
34
|
-
effort: string | number | null;
|
|
35
|
-
reason: string;
|
|
36
|
-
lateral: RouterLateral;
|
|
37
|
-
difference: RouterUsdRange | null;
|
|
38
|
-
}
|
|
39
|
-
// Shadow turns, those `on` would route differently, and of those the ones with a `difference`, summed.
|
|
40
|
-
interface RouterActivityShadow extends RouterUsdRange {
|
|
41
|
-
differs: number;
|
|
42
|
-
turns: number;
|
|
43
|
-
estimated: number;
|
|
44
|
-
}
|
|
45
23
|
interface RouterActivityCounts {
|
|
46
24
|
turns: number;
|
|
47
25
|
requests: number;
|
|
@@ -57,11 +35,9 @@ declare module 'claude-code' {
|
|
|
57
35
|
interface RouterActivitySession {
|
|
58
36
|
byActivity: Partial<Record<RouterActivity | 'none', RouterActivityCounts>>;
|
|
59
37
|
switches: { tier: number; activity: number };
|
|
60
|
-
// Lateral moves taken and refused (by economics, a hold or the cash gate)
|
|
61
|
-
// by 1.7.0.
|
|
38
|
+
// Lateral moves taken and refused (by economics, a hold or the cash gate); absent in views saved by 1.7.0.
|
|
62
39
|
lateral?: { taken: number; refused: number };
|
|
63
40
|
agreement: { matched: number; total: number };
|
|
64
|
-
shadow: RouterActivityShadow;
|
|
65
41
|
}
|
|
66
42
|
// Cross-session counts under store key 'activity:stats:v1'. `runs` buckets run lengths 1, 2, 3, 4, 5+.
|
|
67
43
|
interface RouterActivityStore {
|
|
@@ -69,8 +45,6 @@ declare module 'claude-code' {
|
|
|
69
45
|
confusion: Partial<Record<RouterActivityAnswer | 'none', Partial<Record<RouterObserved, number>>>>;
|
|
70
46
|
runs: Partial<Record<RouterActivity, [number, number, number, number, number]>>;
|
|
71
47
|
lateral: { taken: number; refused: number };
|
|
72
|
-
// A 1.6.0 store has `differs` and `turns` only; readStore fills the rest with zeros.
|
|
73
|
-
shadow: RouterActivityShadow;
|
|
74
48
|
}
|
|
75
49
|
// Cross-session readings under store key 'activity:metrics:v1'. Classifier wait per turn by classifier id, in
|
|
76
50
|
// LATENCY_BOUNDS buckets plus one above; at most 8 ids. Cheaper activity moves taken in 'on' and the escalations that
|
|
@@ -165,7 +139,7 @@ declare module 'claude-code' {
|
|
|
165
139
|
interface RouterSubagentStore {
|
|
166
140
|
version: 1;
|
|
167
141
|
since: number | null;
|
|
168
|
-
routed: {
|
|
142
|
+
routed: { on: Record<string, RouterSubagentCounts> };
|
|
169
143
|
passed: Partial<Record<'fork' | 'explicit' | 'teammate' | 'workflow' | 'unlisted', RouterSubagentPassed>>;
|
|
170
144
|
}
|
|
171
145
|
interface RouterView {
|
|
@@ -196,11 +170,10 @@ declare module 'claude-code' {
|
|
|
196
170
|
estimate?: RouterEstimate | null;
|
|
197
171
|
comparison?: RouterComparison | null;
|
|
198
172
|
probabilities?: Partial<Record<RouterTier | 'uncertain', number>> | null;
|
|
199
|
-
// The turn's activity
|
|
173
|
+
// The turn's activity, applied in 'on'.
|
|
200
174
|
activity?: RouterActivity | null;
|
|
201
175
|
activityChoice?: RouterActivityAnswer | null;
|
|
202
176
|
activityProbabilities?: Partial<Record<RouterActivityAnswer, number>> | null;
|
|
203
|
-
wouldRoute?: RouterWouldRoute | null;
|
|
204
177
|
history?: number[];
|
|
205
178
|
tiers?: (RouterTier | null)[];
|
|
206
179
|
// Aligned with `history` and `tiers`.
|
|
@@ -220,7 +193,11 @@ declare module 'claude-code' {
|
|
|
220
193
|
routeDraft?: (RouterRoutes & { base: RouterRoutes }) | null;
|
|
221
194
|
// The last pane write to router.json: each leaf it changed with the value the file had before, none if absent.
|
|
222
195
|
lastWrite?: { label: string; leaves: { path: string[]; value?: unknown }[] } | null;
|
|
223
|
-
tab?: 'now' | '
|
|
196
|
+
tab?: 'now' | 'routes' | 'policy' | 'classifier' | 'usage';
|
|
197
|
+
// The Routes grid cell whose editor is open: '<activity>.<tier>', or 'tier.<tier>' for a tier's own route.
|
|
198
|
+
routeCell?: string | null;
|
|
199
|
+
// Whether the Usage tab shows Claude's readings in detail, with the estimates.
|
|
200
|
+
usageDetail?: boolean;
|
|
224
201
|
help?: boolean;
|
|
225
202
|
bandDetail?: boolean;
|
|
226
203
|
notice?: string | null;
|
|
@@ -235,8 +212,6 @@ declare module 'claude-code' {
|
|
|
235
212
|
lastRoute: RouterTier;
|
|
236
213
|
// The activity of the route running now; absent in loops saved before 1.6.
|
|
237
214
|
lastActivity?: RouterActivity | null;
|
|
238
|
-
// Shadow mode only: the cell and policy state `on` would run with, so each would-route continues the last one.
|
|
239
|
-
would?: { lastRoute: RouterTier; lastActivity: RouterActivity | null; state: RouterPolicyState } | null;
|
|
240
215
|
state: RouterPolicyState;
|
|
241
216
|
models: Record<string, { lastAt: number; prefixTokens: number }>;
|
|
242
217
|
resolutions: Record<string, string>;
|
|
@@ -260,12 +235,11 @@ declare module 'claude-code' {
|
|
|
260
235
|
effort: string | number | null;
|
|
261
236
|
estimate?: RouterEstimate | null;
|
|
262
237
|
comparison?: RouterComparison | null;
|
|
263
|
-
// The applied activity
|
|
238
|
+
// The applied activity.
|
|
264
239
|
activity?: RouterActivity | null;
|
|
265
240
|
lateral?: RouterLateral;
|
|
266
241
|
// A failure asked for an escalation this turn, also one the cash gate held or context-fit replaced.
|
|
267
242
|
escalated?: boolean;
|
|
268
|
-
wouldRoute?: RouterWouldRoute | null;
|
|
269
243
|
pinned: boolean;
|
|
270
244
|
requestedPin: RouterTier | null;
|
|
271
245
|
} | null;
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 828 1104" role="img" aria-labelledby="title desc">
|
|
2
|
-
<title id="title">Router pane, Routing tab</title>
|
|
3
|
-
<desc id="desc">Model and effort per tier with prices and windows, the baseline tier, how the policy prices each step up, the activity matrix and overrides, the policy controls, and the unsaved router.json changes with Save and Discard.</desc>
|
|
4
|
-
<style>
|
|
5
|
-
text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13px; }
|
|
6
|
-
.cap { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 12px; fill: #9a988f; }
|
|
7
|
-
</style>
|
|
8
|
-
<rect width="828" height="1104" rx="8" fill="#1c1c1c"/>
|
|
9
|
-
<rect x="10" y="10" width="808" height="1084" rx="6" fill="none" stroke="#3f5f8f"/>
|
|
10
|
-
<text x="24.0" y="34" fill="#5fafd7" font-weight="700" xml:space="preserve">ROUTING</text>
|
|
11
|
-
<rect x="94.2" y="20" width="62.4" height="18" rx="4" fill="#87afff"/>
|
|
12
|
-
<text x="94.2" y="34" fill="#0d1016" font-weight="700" xml:space="preserve">[ ◉ on ]</text>
|
|
13
|
-
<rect x="164.4" y="20" width="70.2" height="18" rx="4" fill="#2e3340"/>
|
|
14
|
-
<text x="164.4" y="34" fill="#d0d0d0" xml:space="preserve">[ ○ off ]</text>
|
|
15
|
-
<text x="234.6" y="34" fill="#7c7c7c" xml:space="preserve"> off keeps the /model choice</text>
|
|
16
|
-
<text x="24.0" y="53" fill="#87d787" xml:space="preserve">Jev ready · 347 ms</text>
|
|
17
|
-
<rect x="24.0" y="58" width="54.6" height="18" rx="4" fill="#2e3340"/>
|
|
18
|
-
<text x="24.0" y="72" fill="#d0d0d0" xml:space="preserve">[ Now ]</text>
|
|
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"/>
|
|
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"/>
|
|
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"/>
|
|
26
|
-
<text x="390.6" y="72" fill="#d0d0d0" xml:space="preserve">[ ? ]</text>
|
|
27
|
-
<text x="24.0" y="110" fill="#5fafd7" font-weight="700" xml:space="preserve">ROUTES</text>
|
|
28
|
-
<text x="70.8" y="110" fill="#7c7c7c" xml:space="preserve"> · applies next turn · edit, then Save</text>
|
|
29
|
-
<text x="24.0" y="129" fill="#7c7c7c" xml:space="preserve">tier model effort $/M in · out window</text>
|
|
30
|
-
<text x="24.0" y="148" fill="#e0708a" font-weight="700" xml:space="preserve">high</text>
|
|
31
|
-
<text x="86.4" y="148" fill="#d0d0d0" xml:space="preserve">Opus 5.5 ▾</text>
|
|
32
|
-
<text x="195.6" y="148" fill="#d0d0d0" xml:space="preserve">xhigh ▾</text>
|
|
33
|
-
<text x="304.8" y="148" fill="#d0d0d0" xml:space="preserve">4 · 20</text>
|
|
34
|
-
<text x="414.0" y="148" fill="#d0d0d0" xml:space="preserve">1M</text>
|
|
35
|
-
<text x="24.0" y="167" fill="#d7af5f" font-weight="700" xml:space="preserve">medium</text>
|
|
36
|
-
<text x="86.4" y="167" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
|
|
37
|
-
<text x="195.6" y="167" fill="#d0d0d0" xml:space="preserve">xhigh ▾</text>
|
|
38
|
-
<text x="289.2" y="167" fill="#d7af5f" xml:space="preserve">●</text>
|
|
39
|
-
<text x="304.8" y="167" fill="#d0d0d0" xml:space="preserve">2 · 10</text>
|
|
40
|
-
<text x="414.0" y="167" fill="#d0d0d0" xml:space="preserve">1M</text>
|
|
41
|
-
<text x="24.0" y="186" fill="#5f9fe0" font-weight="700" xml:space="preserve">low</text>
|
|
42
|
-
<text x="86.4" y="186" fill="#d0d0d0" xml:space="preserve">Haiku 5.5 ▾</text>
|
|
43
|
-
<text x="195.6" y="186" fill="#d0d0d0" xml:space="preserve">high ▾</text>
|
|
44
|
-
<text x="304.8" y="186" fill="#d0d0d0" xml:space="preserve">0.1 · 0.5</text>
|
|
45
|
-
<text x="414.0" y="186" fill="#d0d0d0" xml:space="preserve">1M</text>
|
|
46
|
-
<text x="24.0" y="205" fill="#5fd7af" font-weight="700" xml:space="preserve">micro</text>
|
|
47
|
-
<text x="86.4" y="205" fill="#d0d0d0" xml:space="preserve">Haiku 5.5 ▾</text>
|
|
48
|
-
<text x="195.6" y="205" fill="#d0d0d0" xml:space="preserve">medium ▾</text>
|
|
49
|
-
<text x="304.8" y="205" fill="#d0d0d0" xml:space="preserve">0.1 · 0.5</text>
|
|
50
|
-
<text x="414.0" y="205" fill="#d0d0d0" xml:space="preserve">1M</text>
|
|
51
|
-
<text x="24.0" y="224" fill="#d0d0d0" xml:space="preserve">Baseline tier: low ▾</text>
|
|
52
|
-
<text x="304.8" y="224" fill="#7c7c7c" xml:space="preserve">start here, fall back here</text>
|
|
53
|
-
<text x="24.0" y="262" fill="#5fafd7" font-weight="700" xml:space="preserve">SWITCH COST · from these routes</text>
|
|
54
|
-
<text x="24.0" y="281" fill="#7c7c7c" xml:space="preserve">· </text>
|
|
55
|
-
<text x="39.6" y="281" fill="#d0d0d0" xml:space="preserve">medium → high </text>
|
|
56
|
-
<text x="164.4" y="281" fill="#d0d0d0" xml:space="preserve">model change: priced as a cold cache write</text>
|
|
57
|
-
<text x="24.0" y="300" fill="#7c7c7c" xml:space="preserve">· </text>
|
|
58
|
-
<text x="39.6" y="300" fill="#d0d0d0" xml:space="preserve">low → medium </text>
|
|
59
|
-
<text x="164.4" y="300" fill="#d0d0d0" xml:space="preserve">model change: priced as a cold cache write</text>
|
|
60
|
-
<text x="24.0" y="319" fill="#7c7c7c" xml:space="preserve">· </text>
|
|
61
|
-
<text x="39.6" y="319" fill="#d0d0d0" xml:space="preserve">micro → low </text>
|
|
62
|
-
<text x="164.4" y="319" fill="#d0d0d0" xml:space="preserve">same model, new effort: keeps its cache</text>
|
|
63
|
-
<rect x="24.0" y="324" width="218.4" height="18" rx="4" fill="#2e3340"/>
|
|
64
|
-
<text x="24.0" y="338" fill="#d0d0d0" xml:space="preserve">[ Reset routes to defaults ]</text>
|
|
65
|
-
<text x="24.0" y="357" fill="#7c7c7c" xml:space="preserve">A new model ID needs router.json → models: price, window, efforts.</text>
|
|
66
|
-
<text x="24.0" y="395" fill="#5fafd7" font-weight="700" xml:space="preserve">ACTIVITIES</text>
|
|
67
|
-
<text x="102.0" y="395" fill="#7c7c7c" xml:space="preserve"> · applies next turn · edit, then Save</text>
|
|
68
|
-
<text x="24.0" y="414" fill="#d0d0d0" xml:space="preserve">Activity routing: on ▾</text>
|
|
69
|
-
<text x="242.4" y="414" fill="#7c7c7c" xml:space="preserve">an override runs when the activity has one</text>
|
|
70
|
-
<text x="273.6" y="433" fill="#7c7c7c" xml:space="preserve">micro low medium high </text>
|
|
71
|
-
<text x="24.0" y="452" fill="#d0d0d0" xml:space="preserve"> base H·med H·high S·xh O·xh </text>
|
|
72
|
-
<text x="24.0" y="471" fill="#d0d0d0" xml:space="preserve"> code · S·high · O·max </text>
|
|
73
|
-
<text x="24.0" y="490" fill="#d0d0d0" xml:space="preserve"> debug plan review · S·high · · </text>
|
|
74
|
-
<text x="24.0" y="509" fill="#d0d0d0" xml:space="preserve"> explore docs · · · · </text>
|
|
75
|
-
<text x="24.0" y="528" fill="#d0d0d0" xml:space="preserve"> ops · · H·high · </text>
|
|
76
|
-
<text x="24.0" y="547" fill="#7c7c7c" xml:space="preserve"> 6 distinct routes · 3 caches</text>
|
|
77
|
-
<text x="24.0" y="585" fill="#5fafd7" font-weight="700" xml:space="preserve">OVERRIDES</text>
|
|
78
|
-
<text x="94.2" y="585" fill="#7c7c7c" xml:space="preserve"> · in use</text>
|
|
79
|
-
<text x="24.0" y="604" fill="#d0d0d0" xml:space="preserve">code</text>
|
|
80
|
-
<text x="102.0" y="604" fill="#5f9fe0" font-weight="700" xml:space="preserve">low</text>
|
|
81
|
-
<text x="164.4" y="604" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
|
|
82
|
-
<text x="273.6" y="604" fill="#d0d0d0" xml:space="preserve">high ▾</text>
|
|
83
|
-
<rect x="382.8" y="590" width="78.0" height="18" rx="4" fill="#2e3340"/>
|
|
84
|
-
<text x="382.8" y="604" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
|
|
85
|
-
<text x="24.0" y="623" fill="#d0d0d0" xml:space="preserve">code</text>
|
|
86
|
-
<text x="102.0" y="623" fill="#e0708a" font-weight="700" xml:space="preserve">high</text>
|
|
87
|
-
<text x="164.4" y="623" fill="#d0d0d0" xml:space="preserve">Opus 5.5 ▾</text>
|
|
88
|
-
<text x="273.6" y="623" fill="#d0d0d0" xml:space="preserve">max ▾</text>
|
|
89
|
-
<text x="367.2" y="623" fill="#d7af5f" xml:space="preserve">●</text>
|
|
90
|
-
<rect x="382.8" y="609" width="78.0" height="18" rx="4" fill="#2e3340"/>
|
|
91
|
-
<text x="382.8" y="623" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
|
|
92
|
-
<text x="24.0" y="642" fill="#d0d0d0" xml:space="preserve">debug</text>
|
|
93
|
-
<text x="102.0" y="642" fill="#5f9fe0" font-weight="700" xml:space="preserve">low</text>
|
|
94
|
-
<text x="164.4" y="642" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
|
|
95
|
-
<text x="273.6" y="642" fill="#d0d0d0" xml:space="preserve">high ▾</text>
|
|
96
|
-
<rect x="382.8" y="628" width="78.0" height="18" rx="4" fill="#2e3340"/>
|
|
97
|
-
<text x="382.8" y="642" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
|
|
98
|
-
<text x="24.0" y="661" fill="#d0d0d0" xml:space="preserve">plan</text>
|
|
99
|
-
<text x="102.0" y="661" fill="#5f9fe0" font-weight="700" xml:space="preserve">low</text>
|
|
100
|
-
<text x="164.4" y="661" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
|
|
101
|
-
<text x="273.6" y="661" fill="#d0d0d0" xml:space="preserve">high ▾</text>
|
|
102
|
-
<rect x="382.8" y="647" width="78.0" height="18" rx="4" fill="#2e3340"/>
|
|
103
|
-
<text x="382.8" y="661" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
|
|
104
|
-
<text x="24.0" y="680" fill="#d0d0d0" xml:space="preserve">review</text>
|
|
105
|
-
<text x="102.0" y="680" fill="#5f9fe0" font-weight="700" xml:space="preserve">low</text>
|
|
106
|
-
<text x="164.4" y="680" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
|
|
107
|
-
<text x="273.6" y="680" fill="#d0d0d0" xml:space="preserve">high ▾</text>
|
|
108
|
-
<rect x="382.8" y="666" width="78.0" height="18" rx="4" fill="#2e3340"/>
|
|
109
|
-
<text x="382.8" y="680" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
|
|
110
|
-
<text x="24.0" y="699" fill="#d0d0d0" xml:space="preserve">ops</text>
|
|
111
|
-
<text x="102.0" y="699" fill="#d7af5f" font-weight="700" xml:space="preserve">medium</text>
|
|
112
|
-
<text x="164.4" y="699" fill="#d0d0d0" xml:space="preserve">Haiku 5.5 ▾</text>
|
|
113
|
-
<text x="273.6" y="699" fill="#d0d0d0" xml:space="preserve">high ▾</text>
|
|
114
|
-
<rect x="382.8" y="685" width="78.0" height="18" rx="4" fill="#2e3340"/>
|
|
115
|
-
<text x="382.8" y="699" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
|
|
116
|
-
<text x="24.0" y="718" fill="#d0d0d0" xml:space="preserve">add an override… ▾</text>
|
|
117
|
-
<text x="24.0" y="756" fill="#5fafd7" font-weight="700" xml:space="preserve">POLICY</text>
|
|
118
|
-
<text x="70.8" y="756" fill="#7c7c7c" xml:space="preserve"> · applies next turn · edit, then Save</text>
|
|
119
|
-
<text x="24.0" y="775" fill="#d0d0d0" xml:space="preserve">Votes to go down</text>
|
|
120
|
-
<text x="180.0" y="775" fill="#d0d0d0" xml:space="preserve">2 ▾</text>
|
|
121
|
-
<text x="289.2" y="775" fill="#7c7c7c" xml:space="preserve">agreeing turns before cheaper</text>
|
|
122
|
-
<text x="24.0" y="794" fill="#d0d0d0" xml:space="preserve">Payback horizon</text>
|
|
123
|
-
<text x="180.0" y="794" fill="#d0d0d0" xml:space="preserve">5 turns ▾</text>
|
|
124
|
-
<text x="289.2" y="794" fill="#7c7c7c" xml:space="preserve">a switch repays its cache</text>
|
|
125
|
-
<text x="24.0" y="813" fill="#d0d0d0" xml:space="preserve">Credits cap</text>
|
|
126
|
-
<text x="180.0" y="813" fill="#d0d0d0" xml:space="preserve">$2.00 ▾</text>
|
|
127
|
-
<text x="289.2" y="813" fill="#7c7c7c" xml:space="preserve">max cold write on credits</text>
|
|
128
|
-
<text x="24.0" y="832" fill="#d0d0d0" xml:space="preserve">Activity threshold</text>
|
|
129
|
-
<text x="180.0" y="832" fill="#d0d0d0" xml:space="preserve">60% ▾</text>
|
|
130
|
-
<text x="289.2" y="832" fill="#7c7c7c" xml:space="preserve">a weaker reading keeps the running activity or uses the base route</text>
|
|
131
|
-
<rect x="24.0" y="837" width="218.4" height="18" rx="4" fill="#2e3340"/>
|
|
132
|
-
<text x="24.0" y="851" fill="#d0d0d0" xml:space="preserve">[ Reset policy to defaults ]</text>
|
|
133
|
-
<text x="24.0" y="889" fill="#5fafd7" font-weight="700" xml:space="preserve">CONFIG</text>
|
|
134
|
-
<text x="24.0" y="908" fill="#d0d0d0" xml:space="preserve">File ~/.claude/router.json </text>
|
|
135
|
-
<rect x="273.6" y="894" width="62.4" height="18" rx="4" fill="#2e3340"/>
|
|
136
|
-
<text x="273.6" y="908" fill="#d0d0d0" xml:space="preserve">[ copy ]</text>
|
|
137
|
-
<text x="24.0" y="927" fill="#7c7c7c" xml:space="preserve">Subagents: on. Agents that pin no model get one at spawn, kept for every step.</text>
|
|
138
|
-
<text x="24.0" y="965" fill="#7c7c7c" xml:space="preserve">router.json changes:</text>
|
|
139
|
-
<text x="24.0" y="984" fill="#e06c6c" xml:space="preserve">- routes.medium Opus 5.5 · medium</text>
|
|
140
|
-
<text x="24.0" y="1003" fill="#87d787" xml:space="preserve">+ routes.medium Sonnet 5.5 · xhigh</text>
|
|
141
|
-
<text x="24.0" y="1022" fill="#e06c6c" xml:space="preserve">- activities.code.high no override</text>
|
|
142
|
-
<text x="24.0" y="1041" fill="#87d787" xml:space="preserve">+ activities.code.high Opus 5.5 · max</text>
|
|
143
|
-
<text x="24.0" y="1060" fill="#d7af5f" xml:space="preserve">● 2 unsaved routing changes </text>
|
|
144
|
-
<rect x="250.2" y="1046" width="62.4" height="18" rx="4" fill="#87afff"/>
|
|
145
|
-
<text x="250.2" y="1060" fill="#0d1016" font-weight="700" xml:space="preserve">[ Save ]</text>
|
|
146
|
-
<rect x="320.4" y="1046" width="85.8" height="18" rx="4" fill="#2e3340"/>
|
|
147
|
-
<text x="320.4" y="1060" fill="#d0d0d0" xml:space="preserve">[ Discard ]</text>
|
|
148
|
-
<rect x="24.0" y="1065" width="70.2" height="18" rx="4" fill="#2e3340"/>
|
|
149
|
-
<text x="24.0" y="1079" fill="#d0d0d0" xml:space="preserve">[ Close ]</text>
|
|
150
|
-
</svg>
|