@alexeiled/claude-router 1.2.0 → 1.3.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 +21 -0
- package/README.md +2 -2
- package/docs/architecture.md +2 -2
- package/docs/configuration.md +6 -6
- package/docs/native-router.md +5 -5
- package/docs/router-pane-classifier.svg +45 -0
- package/docs/router-pane-now.svg +7 -6
- package/docs/router-pane-routing.svg +81 -0
- package/docs/user-guide.md +30 -21
- package/hooks/native-router.mjs +149 -46
- package/lib/config.mjs +19 -11
- package/lib/native-panel.mjs +118 -106
- package/package.json +1 -1
- package/types/index.d.ts +3 -3
- package/docs/router-pane-tiers.svg +0 -62
- package/docs/router-pane-tuning.svg +0 -58
package/lib/native-panel.mjs
CHANGED
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
|
|
17
17
|
export const TABS = [
|
|
18
18
|
['now', '1', 'Now'],
|
|
19
|
-
['
|
|
20
|
-
['
|
|
19
|
+
['routing', '2', 'Routing'],
|
|
20
|
+
['classifier', '3', 'Classifier'],
|
|
21
21
|
['usage', '4', 'Usage'],
|
|
22
22
|
];
|
|
23
23
|
export const TUNING_CHOICES = {
|
|
@@ -44,7 +44,7 @@ export function routeName(config, route) {
|
|
|
44
44
|
return `${modelName(model.id)}${model.efforts.length ? ` · ${route.effort ?? SESSION_EFFORT}` : ''}`;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
// The draft the
|
|
47
|
+
// The route draft the Routing tab edits: the saved routes until the person changes one.
|
|
48
48
|
export function routeDraftOf(config, view) {
|
|
49
49
|
if (view.routeDraft) return view.routeDraft;
|
|
50
50
|
const base = structuredClone({ routes: config.routes, baselineTier: config.baselineTier });
|
|
@@ -97,20 +97,20 @@ export function renderPanel(
|
|
|
97
97
|
) {
|
|
98
98
|
const ui = kit(elements);
|
|
99
99
|
const tab = TABS.some(([id]) => id === view.tab) ? view.tab : 'now';
|
|
100
|
-
const body = { now: nowTab,
|
|
100
|
+
const body = { now: nowTab, routing: routingTab, classifier: classifierTab, usage: usageTab }[tab];
|
|
101
101
|
return ui.Box({
|
|
102
102
|
flexDirection: 'column',
|
|
103
103
|
children: [
|
|
104
|
-
...header(ui, config, view, actions),
|
|
104
|
+
...header(ui, config, view, tab, actions),
|
|
105
105
|
...body(ui, config, view, usage, actions, modelOptions),
|
|
106
106
|
...(view.help ? helpLines(ui) : []),
|
|
107
|
-
|
|
107
|
+
...statusBar(ui, config, view, actions),
|
|
108
108
|
ui.Button({ key: 'close', label: 'Close', hotkey: 'q', role: 'dismiss', onPress: actions.close }),
|
|
109
109
|
],
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
function header(ui, config, view, actions) {
|
|
113
|
+
function header(ui, config, view, tab, actions) {
|
|
114
114
|
const auto = view.mode === 'auto';
|
|
115
115
|
const label = classifierLabel(config);
|
|
116
116
|
const error = view.error ?? missingCredentials(view, config.classifier);
|
|
@@ -137,19 +137,20 @@ function header(ui, config, view, actions) {
|
|
|
137
137
|
' ',
|
|
138
138
|
ui.Button({
|
|
139
139
|
key: 'manual',
|
|
140
|
-
label: 'Manual
|
|
140
|
+
label: 'Manual',
|
|
141
141
|
hotkey: 'm',
|
|
142
142
|
variant: auto ? 'secondary' : 'primary',
|
|
143
143
|
onPress: () => actions.mode('manual'),
|
|
144
144
|
}),
|
|
145
|
+
ui.dim(' Manual keeps the /model choice'),
|
|
145
146
|
),
|
|
146
147
|
ui.line(
|
|
147
148
|
...TABS.flatMap(([id, hotkey, label]) => [
|
|
148
149
|
ui.Button({
|
|
149
150
|
key: `tab-${id}`,
|
|
150
|
-
label,
|
|
151
|
+
label: id === 'routing' && routingChanges(config, view).count ? `${label} ●` : label,
|
|
151
152
|
hotkey,
|
|
152
|
-
variant:
|
|
153
|
+
variant: tab === id ? 'primary' : 'secondary',
|
|
153
154
|
onPress: () => actions.tab(id),
|
|
154
155
|
}),
|
|
155
156
|
' ',
|
|
@@ -207,12 +208,7 @@ function nowTab(ui, config, view, usage, actions) {
|
|
|
207
208
|
routeName(config, config.routes[tier]).padEnd(22),
|
|
208
209
|
meter ? ui.text(meter.text, { color: TIER_COLOR[tier] }) : ui.dim('—'.padEnd(10)),
|
|
209
210
|
meter ? ` ${percent(support).padStart(4)} ` : ' ',
|
|
210
|
-
ui.Button({
|
|
211
|
-
key: `pin-${tier}`,
|
|
212
|
-
label: 'pin',
|
|
213
|
-
dimColor: !auto,
|
|
214
|
-
onPress: () => actions.pin(tier),
|
|
215
|
-
}),
|
|
211
|
+
auto ? ui.Button({ key: `pin-${tier}`, label: 'pin', onPress: () => actions.pin(tier) }) : null,
|
|
216
212
|
),
|
|
217
213
|
);
|
|
218
214
|
}
|
|
@@ -263,16 +259,40 @@ function replies(ui, view) {
|
|
|
263
259
|
];
|
|
264
260
|
}
|
|
265
261
|
|
|
266
|
-
|
|
262
|
+
const POLICY_ROWS = [
|
|
263
|
+
['downgradeVotes', 'Votes to go down', String, 'agreeing turns before cheaper', 'policy.downgradeVotes'],
|
|
264
|
+
['horizon', 'Payback horizon', (v) => `${v} turns`, 'a switch repays its cache', 'policy.downgradeHorizonTurns'],
|
|
265
|
+
['cashCapUsd', 'Credits cap', (v) => `$${v.toFixed(2)}`, 'max cold write on credits', 'policy.cashCapUsd'],
|
|
266
|
+
];
|
|
267
|
+
|
|
268
|
+
// What the Routing tab changed and has not saved: tiers and baseline against the saved routes, policy values against
|
|
269
|
+
// the values the draft started from.
|
|
270
|
+
export function routingChanges(config, view) {
|
|
267
271
|
const draft = effectiveRoutes(routeDraftOf(config, view), config);
|
|
272
|
+
const saved = tuningOf(config);
|
|
273
|
+
const base = view.tuningBase ?? saved;
|
|
274
|
+
const tuning = { ...saved, ...view.tuning };
|
|
275
|
+
const tiers = TIERS.filter((tier) => !sameRoute(draft.routes[tier], config.routes[tier]));
|
|
276
|
+
const baseline = draft.baselineTier !== config.baselineTier;
|
|
277
|
+
const policy = POLICY_ROWS.map(([key]) => key).filter(
|
|
278
|
+
(key) => Object.hasOwn(view.tuning ?? {}, key) && view.tuning[key] !== base[key],
|
|
279
|
+
);
|
|
280
|
+
return { draft, saved, tuning, tiers, baseline, policy, count: tiers.length + Number(baseline) + policy.length };
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const marker = (ui, changed) => ui.cell(2, changed ? ui.text('●', { color: 'yellow' }) : '');
|
|
284
|
+
|
|
285
|
+
// Routes and policy are edited as one set: the switch-cost lines read the whole ladder, so nothing here is written
|
|
286
|
+
// until Save in the status bar.
|
|
287
|
+
function routingTab(ui, config, view, _usage, actions, modelOptions) {
|
|
288
|
+
const { draft, tuning, tiers, baseline, policy } = routingChanges(config, view);
|
|
268
289
|
const out = [
|
|
269
|
-
ui.head('ROUTES ·
|
|
270
|
-
ui.dim(`${'tier'.padEnd(8)}${'model'.padEnd(14)}${'effort'.padEnd(
|
|
290
|
+
ui.line(ui.head('ROUTES'), ui.dim(' · applies next turn · edit, then Save')),
|
|
291
|
+
ui.dim(`${'tier'.padEnd(8)}${'model'.padEnd(14)}${'effort'.padEnd(14)}${'$/M in · out'.padEnd(14)}window`),
|
|
271
292
|
];
|
|
272
293
|
for (const tier of LADDER) {
|
|
273
294
|
const route = draft.routes[tier];
|
|
274
295
|
const model = config.models[route.model];
|
|
275
|
-
const changed = !sameRoute(route, config.routes[tier]);
|
|
276
296
|
const aliases = modelOptions.includes(route.model) ? modelOptions : [route.model, ...modelOptions];
|
|
277
297
|
out.push(
|
|
278
298
|
ui.line(
|
|
@@ -301,24 +321,28 @@ function tiersTab(ui, config, view, _usage, actions, modelOptions) {
|
|
|
301
321
|
})
|
|
302
322
|
: (route.effort ?? SESSION_EFFORT),
|
|
303
323
|
),
|
|
324
|
+
marker(ui, tiers.includes(tier)),
|
|
304
325
|
ui.cell(14, `${model.input} · ${model.output ?? '?'}`),
|
|
305
326
|
windowSize(model.contextWindow),
|
|
306
|
-
changed ? ui.text(' ●', { color: 'yellow' }) : null,
|
|
307
327
|
),
|
|
308
328
|
);
|
|
309
329
|
}
|
|
310
330
|
out.push(
|
|
311
331
|
ui.line(
|
|
312
|
-
ui.
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
332
|
+
ui.cell(
|
|
333
|
+
34,
|
|
334
|
+
ui.Select
|
|
335
|
+
? ui.Select({
|
|
336
|
+
key: 'baseline',
|
|
337
|
+
label: 'Baseline tier',
|
|
338
|
+
value: draft.baselineTier,
|
|
339
|
+
options: TIERS.map((tier) => ({ value: tier, label: tier })),
|
|
340
|
+
onSelect: (tier) => actions.baseline(tier),
|
|
341
|
+
})
|
|
342
|
+
: `Baseline tier: ${draft.baselineTier}`,
|
|
343
|
+
),
|
|
344
|
+
marker(ui, baseline),
|
|
345
|
+
ui.dim('start here, fall back here'),
|
|
322
346
|
),
|
|
323
347
|
ui.text(' '),
|
|
324
348
|
ui.head('SWITCH COST · from these routes'),
|
|
@@ -333,78 +357,23 @@ function tiersTab(ui, config, view, _usage, actions, modelOptions) {
|
|
|
333
357
|
out.push(ui.line(ui.dim('· '), pair, 'same model, new effort: priced as a new cache'));
|
|
334
358
|
else out.push(ui.line(ui.dim('· '), pair, 'model change: priced as a cold cache write'));
|
|
335
359
|
}
|
|
336
|
-
const changes = TIERS.filter((tier) => !sameRoute(draft.routes[tier], config.routes[tier]));
|
|
337
|
-
const baselineChanged = draft.baselineTier !== config.baselineTier;
|
|
338
|
-
const dirty = changes.length > 0 || baselineChanged;
|
|
339
|
-
out.push(ui.text(' '));
|
|
340
|
-
if (dirty) {
|
|
341
|
-
out.push(ui.dim('router.json changes:'));
|
|
342
|
-
for (const tier of changes) {
|
|
343
|
-
out.push(ui.text(`- routes.${tier.padEnd(7)} ${routeName(config, config.routes[tier])}`, { color: 'red' }));
|
|
344
|
-
out.push(ui.text(`+ routes.${tier.padEnd(7)} ${routeName(config, draft.routes[tier])}`, { color: 'green' }));
|
|
345
|
-
}
|
|
346
|
-
if (baselineChanged) {
|
|
347
|
-
out.push(ui.text(`- baselineTier ${config.baselineTier}`, { color: 'red' }));
|
|
348
|
-
out.push(ui.text(`+ baselineTier ${draft.baselineTier}`, { color: 'green' }));
|
|
349
|
-
}
|
|
350
|
-
} else out.push(ui.dim('No changes. Pick a model or an effort above.'));
|
|
351
360
|
out.push(
|
|
352
|
-
ui.
|
|
353
|
-
ui.Button({
|
|
354
|
-
key: 'save-routes',
|
|
355
|
-
label: 'Save routes',
|
|
356
|
-
hotkey: 's',
|
|
357
|
-
variant: dirty ? 'primary' : 'secondary',
|
|
358
|
-
dimColor: !dirty,
|
|
359
|
-
onPress: actions.saveRoutes,
|
|
360
|
-
}),
|
|
361
|
-
' ',
|
|
362
|
-
ui.Button({ key: 'discard-routes', label: 'Discard', dimColor: !dirty, onPress: actions.discardRoutes }),
|
|
363
|
-
' ',
|
|
364
|
-
ui.Button({ key: 'reset-routes', label: 'Reset to defaults', hotkey: 'r', onPress: actions.resetRoutes }),
|
|
365
|
-
),
|
|
361
|
+
ui.Button({ key: 'reset-routes', label: 'Reset routes to defaults', hotkey: 'r', onPress: actions.resetRoutes }),
|
|
366
362
|
ui.dim('A new model ID needs router.json → models: price, window, efforts.'),
|
|
367
|
-
);
|
|
368
|
-
return out;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
function tuningTab(ui, config, view, _usage, actions) {
|
|
372
|
-
const saved = tuningOf(config);
|
|
373
|
-
const draft = { ...saved, ...view.tuning };
|
|
374
|
-
const base = view.tuningBase ?? saved;
|
|
375
|
-
const edited = (key) => Object.hasOwn(view.tuning ?? {}, key) && view.tuning[key] !== base[key];
|
|
376
|
-
const rows = [
|
|
377
|
-
['downgradeVotes', 'Votes to go down', String, 'agreeing turns before cheaper'],
|
|
378
|
-
['horizon', 'Payback horizon', (v) => `${v} turns`, 'a switch repays its cache'],
|
|
379
|
-
['cashCapUsd', 'Credits cap', (v) => `$${v.toFixed(2)}`, 'max cold write on credits'],
|
|
380
|
-
];
|
|
381
|
-
const dirty = rows.some(([key]) => edited(key));
|
|
382
|
-
return [
|
|
383
|
-
...classifierSection(ui, config, view, actions),
|
|
384
363
|
ui.text(' '),
|
|
385
|
-
ui.head('POLICY ·
|
|
386
|
-
...
|
|
364
|
+
ui.line(ui.head('POLICY'), ui.dim(' · applies next turn · edit, then Save')),
|
|
365
|
+
...POLICY_ROWS.map(([key, label, format, hint]) =>
|
|
387
366
|
ui.line(
|
|
388
367
|
ui.cell(20, label),
|
|
389
368
|
ui.cell(
|
|
390
369
|
12,
|
|
391
|
-
choice(ui, key,
|
|
370
|
+
choice(ui, key, tuning[key], format, (value) => actions.tune(key, value)),
|
|
392
371
|
),
|
|
393
|
-
ui
|
|
372
|
+
marker(ui, policy.includes(key)),
|
|
394
373
|
ui.dim(hint),
|
|
395
374
|
),
|
|
396
375
|
),
|
|
397
|
-
ui.
|
|
398
|
-
ui.Button({
|
|
399
|
-
key: 'save-tuning',
|
|
400
|
-
label: 'Save tuning',
|
|
401
|
-
variant: dirty ? 'primary' : 'secondary',
|
|
402
|
-
dimColor: !dirty,
|
|
403
|
-
onPress: actions.saveTuning,
|
|
404
|
-
}),
|
|
405
|
-
' ',
|
|
406
|
-
ui.Button({ key: 'reset-tuning', label: 'Discard', dimColor: !dirty, onPress: actions.resetTuning }),
|
|
407
|
-
),
|
|
376
|
+
ui.Button({ key: 'reset-policy', label: 'Reset policy to defaults', onPress: actions.resetPolicy }),
|
|
408
377
|
ui.text(' '),
|
|
409
378
|
ui.head('CONFIG'),
|
|
410
379
|
ui.line(
|
|
@@ -412,7 +381,8 @@ function tuningTab(ui, config, view, _usage, actions) {
|
|
|
412
381
|
view.configPath ? ui.Button({ key: 'copy-path', label: 'copy', onPress: actions.copyPath }) : null,
|
|
413
382
|
),
|
|
414
383
|
ui.dim('Main conversation only. Subagents keep their own model.'),
|
|
415
|
-
|
|
384
|
+
);
|
|
385
|
+
return out;
|
|
416
386
|
}
|
|
417
387
|
|
|
418
388
|
// A Select over TUNING_CHOICES[key], with a saved value outside them kept as the first option.
|
|
@@ -427,12 +397,11 @@ function choice(ui, key, value, format, pick) {
|
|
|
427
397
|
});
|
|
428
398
|
}
|
|
429
399
|
|
|
430
|
-
// One row per configured classifier
|
|
431
|
-
//
|
|
432
|
-
function
|
|
400
|
+
// One row per configured classifier. A row press and the deadline are single values with nothing to review as a set,
|
|
401
|
+
// so each writes router.json at once; Undo in the status bar puts it back.
|
|
402
|
+
function classifierTab(ui, config, view, _usage, actions) {
|
|
433
403
|
const active = activeClassifier(config);
|
|
434
404
|
const health = view.health ?? { failures: 0, pausedUntil: 0 };
|
|
435
|
-
const undo = view.classifierUndo;
|
|
436
405
|
const rows = Object.entries(config.classifiers).map(([id, entry]) => {
|
|
437
406
|
const isActive = id === config.classifier;
|
|
438
407
|
const missing = missingCredentials(view, id);
|
|
@@ -456,16 +425,9 @@ function classifierSection(ui, config, view, actions) {
|
|
|
456
425
|
);
|
|
457
426
|
});
|
|
458
427
|
return [
|
|
459
|
-
ui.head('CLASSIFIER ·
|
|
428
|
+
ui.line(ui.head('CLASSIFIER'), ui.dim(' · applies next turn · saves at once')),
|
|
429
|
+
ui.dim('Asked once per new turn.'),
|
|
460
430
|
...rows,
|
|
461
|
-
undo && undo !== config.classifier && Object.hasOwn(config.classifiers, undo)
|
|
462
|
-
? ui.line(
|
|
463
|
-
ui.text(`Switched from ${config.classifiers[undo].label}: ${active.label} from the next turn `, {
|
|
464
|
-
color: 'yellow',
|
|
465
|
-
}),
|
|
466
|
-
ui.Button({ key: 'undo-classifier', label: 'Undo', onPress: actions.undoClassifier }),
|
|
467
|
-
)
|
|
468
|
-
: null,
|
|
469
431
|
ui.line(
|
|
470
432
|
ui.cell(9, 'Deadline'),
|
|
471
433
|
ui.cell(
|
|
@@ -487,6 +449,56 @@ function classifierSection(ui, config, view, actions) {
|
|
|
487
449
|
];
|
|
488
450
|
}
|
|
489
451
|
|
|
452
|
+
// Green for a write or its undo, red for a refused write, yellow for everything else that needs a look.
|
|
453
|
+
const noticeColor = (notice) =>
|
|
454
|
+
/^Not saved/.test(notice) ? 'red' : /^(Saved|Undid|Path copied)/.test(notice) ? 'green' : 'yellow';
|
|
455
|
+
|
|
456
|
+
// The one place for commit state on every tab: the unsaved routing diff with Save and Discard, the last notice, and
|
|
457
|
+
// Undo for the last write to router.json.
|
|
458
|
+
function statusBar(ui, config, view, actions) {
|
|
459
|
+
const changes = routingChanges(config, view);
|
|
460
|
+
const out = [];
|
|
461
|
+
if (changes.count) {
|
|
462
|
+
const diff = (key, before, after) => [
|
|
463
|
+
ui.text(`- ${key.padEnd(30)} ${before}`, { color: 'red' }),
|
|
464
|
+
ui.text(`+ ${key.padEnd(30)} ${after}`, { color: 'green' }),
|
|
465
|
+
];
|
|
466
|
+
out.push(ui.text(' '), ui.dim('router.json changes:'));
|
|
467
|
+
for (const tier of changes.tiers)
|
|
468
|
+
out.push(
|
|
469
|
+
...diff(
|
|
470
|
+
`routes.${tier}`,
|
|
471
|
+
routeName(config, config.routes[tier]),
|
|
472
|
+
routeName(config, changes.draft.routes[tier]),
|
|
473
|
+
),
|
|
474
|
+
);
|
|
475
|
+
if (changes.baseline) out.push(...diff('baselineTier', config.baselineTier, changes.draft.baselineTier));
|
|
476
|
+
for (const [key, , format, , field] of POLICY_ROWS.filter(([key]) => changes.policy.includes(key)))
|
|
477
|
+
out.push(...diff(field, format(changes.saved[key]), format(changes.tuning[key])));
|
|
478
|
+
out.push(
|
|
479
|
+
ui.line(
|
|
480
|
+
ui.text(`● ${changes.count} unsaved routing change${changes.count === 1 ? '' : 's'} `, { color: 'yellow' }),
|
|
481
|
+
ui.Button({
|
|
482
|
+
key: 'save-routing',
|
|
483
|
+
label: 'Save',
|
|
484
|
+
hotkey: 's',
|
|
485
|
+
variant: 'primary',
|
|
486
|
+
onPress: actions.saveRouting,
|
|
487
|
+
}),
|
|
488
|
+
' ',
|
|
489
|
+
ui.Button({ key: 'discard-routing', label: 'Discard', hotkey: 'd', onPress: actions.discardRouting }),
|
|
490
|
+
),
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
const undo = view.lastWrite ? ui.Button({ key: 'undo', label: 'Undo', hotkey: 'u', onPress: actions.undo }) : null;
|
|
494
|
+
const confirmsWrite = Boolean(undo && view.notice?.startsWith('Saved'));
|
|
495
|
+
if (view.notice || undo) out.push(ui.text(' '));
|
|
496
|
+
if (view.notice)
|
|
497
|
+
out.push(ui.line(ui.text(`${view.notice} `, { color: noticeColor(view.notice) }), confirmsWrite ? undo : null));
|
|
498
|
+
if (undo && !confirmsWrite) out.push(ui.line(ui.dim(`Last change: ${view.lastWrite.label} `), undo));
|
|
499
|
+
return out;
|
|
500
|
+
}
|
|
501
|
+
|
|
490
502
|
function usageTab(ui, config, view, usage) {
|
|
491
503
|
const metrics = usageMetrics(config, view, usage);
|
|
492
504
|
const history = view.history ?? [];
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -60,9 +60,9 @@ declare module 'claude-code' {
|
|
|
60
60
|
tuning?: Partial<RouterTuning> | null;
|
|
61
61
|
tuningBase?: RouterTuning | null;
|
|
62
62
|
routeDraft?: (RouterRoutes & { base: RouterRoutes }) | null;
|
|
63
|
-
// The
|
|
64
|
-
|
|
65
|
-
tab?: 'now' | '
|
|
63
|
+
// The last pane write to router.json: each leaf it changed with the value the file had before, none if absent.
|
|
64
|
+
lastWrite?: { label: string; leaves: { path: string[]; value?: unknown }[] } | null;
|
|
65
|
+
tab?: 'now' | 'routing' | 'classifier' | 'usage';
|
|
66
66
|
help?: boolean;
|
|
67
67
|
bandDetail?: boolean;
|
|
68
68
|
notice?: string | null;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 594 477" role="img" aria-labelledby="title desc">
|
|
2
|
-
<title id="title">Router pane, Tiers 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, and the router.json change Save routes will write.</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="594" height="477" rx="8" fill="#1c1c1c"/>
|
|
9
|
-
<rect x="10" y="10" width="574" height="457" rx="6" fill="none" stroke="#3f5f8f"/>
|
|
10
|
-
<text x="24.0" y="34" fill="#5fafd7" font-weight="700" xml:space="preserve">ROUTER · Auto</text>
|
|
11
|
-
<text x="148.8" y="34" fill="#87d787" xml:space="preserve">Jev ready · 347 ms</text>
|
|
12
|
-
<text x="24.0" y="53" fill="#87afff" font-weight="700" xml:space="preserve">[ Auto ]</text>
|
|
13
|
-
<text x="94.2" y="53" fill="#d0d0d0" xml:space="preserve">[ Manual: keep /model ]</text>
|
|
14
|
-
<text x="24.0" y="72" fill="#d0d0d0" xml:space="preserve">[ Now ]</text>
|
|
15
|
-
<text x="86.4" y="72" fill="#87afff" font-weight="700" xml:space="preserve">[ Tiers ]</text>
|
|
16
|
-
<text x="164.4" y="72" fill="#d0d0d0" xml:space="preserve">[ Tuning ]</text>
|
|
17
|
-
<text x="250.2" y="72" fill="#d0d0d0" xml:space="preserve">[ Usage ]</text>
|
|
18
|
-
<text x="328.2" y="72" fill="#d0d0d0" xml:space="preserve">[ ? ]</text>
|
|
19
|
-
<text x="24.0" y="110" fill="#5fafd7" font-weight="700" xml:space="preserve">ROUTES · future turns</text>
|
|
20
|
-
<text x="24.0" y="129" fill="#7c7c7c" xml:space="preserve">tier model effort $/M in · out window</text>
|
|
21
|
-
<text x="24.0" y="148" fill="#e0708a" font-weight="700" xml:space="preserve">high</text>
|
|
22
|
-
<text x="86.4" y="148" fill="#d0d0d0" xml:space="preserve">Opus 5.5 ▾</text>
|
|
23
|
-
<text x="195.6" y="148" fill="#d0d0d0" xml:space="preserve">xhigh ▾</text>
|
|
24
|
-
<text x="289.2" y="148" fill="#d0d0d0" xml:space="preserve">4 · 20</text>
|
|
25
|
-
<text x="398.4" y="148" fill="#d0d0d0" xml:space="preserve">1M</text>
|
|
26
|
-
<text x="24.0" y="167" fill="#d7af5f" font-weight="700" xml:space="preserve">medium</text>
|
|
27
|
-
<text x="86.4" y="167" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
|
|
28
|
-
<text x="195.6" y="167" fill="#d0d0d0" xml:space="preserve">xhigh ▾</text>
|
|
29
|
-
<text x="289.2" y="167" fill="#d0d0d0" xml:space="preserve">2 · 10</text>
|
|
30
|
-
<text x="398.4" y="167" fill="#d0d0d0" xml:space="preserve">1M</text>
|
|
31
|
-
<text x="414.0" y="167" fill="#d7af5f" xml:space="preserve"> ●</text>
|
|
32
|
-
<text x="24.0" y="186" fill="#5f9fe0" font-weight="700" xml:space="preserve">low</text>
|
|
33
|
-
<text x="86.4" y="186" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
|
|
34
|
-
<text x="195.6" y="186" fill="#d0d0d0" xml:space="preserve">session ▾</text>
|
|
35
|
-
<text x="289.2" y="186" fill="#d0d0d0" xml:space="preserve">2 · 10</text>
|
|
36
|
-
<text x="398.4" y="186" fill="#d0d0d0" xml:space="preserve">1M</text>
|
|
37
|
-
<text x="24.0" y="205" fill="#5fd7af" font-weight="700" xml:space="preserve">micro</text>
|
|
38
|
-
<text x="86.4" y="205" fill="#d0d0d0" xml:space="preserve">Haiku 4.5 ▾</text>
|
|
39
|
-
<text x="195.6" y="205" fill="#7c7c7c" xml:space="preserve">none</text>
|
|
40
|
-
<text x="289.2" y="205" fill="#d0d0d0" xml:space="preserve">1 · 5</text>
|
|
41
|
-
<text x="398.4" y="205" fill="#d0d0d0" xml:space="preserve">200K</text>
|
|
42
|
-
<text x="24.0" y="224" fill="#d0d0d0" xml:space="preserve">Baseline tier: low ▾</text>
|
|
43
|
-
<text x="180.0" y="224" fill="#7c7c7c" xml:space="preserve"> start here, fall back here</text>
|
|
44
|
-
<text x="24.0" y="262" fill="#5fafd7" font-weight="700" xml:space="preserve">SWITCH COST · from these routes</text>
|
|
45
|
-
<text x="24.0" y="281" fill="#7c7c7c" xml:space="preserve">· </text>
|
|
46
|
-
<text x="39.6" y="281" fill="#d0d0d0" xml:space="preserve">medium → high </text>
|
|
47
|
-
<text x="164.4" y="281" fill="#d0d0d0" xml:space="preserve">model change: priced as a cold cache write</text>
|
|
48
|
-
<text x="24.0" y="300" fill="#7c7c7c" xml:space="preserve">· </text>
|
|
49
|
-
<text x="39.6" y="300" fill="#d0d0d0" xml:space="preserve">low → medium </text>
|
|
50
|
-
<text x="164.4" y="300" fill="#d0d0d0" xml:space="preserve">same model, new effort: priced as a new cache</text>
|
|
51
|
-
<text x="24.0" y="319" fill="#7c7c7c" xml:space="preserve">· </text>
|
|
52
|
-
<text x="39.6" y="319" fill="#d0d0d0" xml:space="preserve">micro → low </text>
|
|
53
|
-
<text x="164.4" y="319" fill="#d0d0d0" xml:space="preserve">model change: priced as a cold cache write</text>
|
|
54
|
-
<text x="24.0" y="357" fill="#7c7c7c" xml:space="preserve">router.json changes:</text>
|
|
55
|
-
<text x="24.0" y="376" fill="#e06c6c" xml:space="preserve">- routes.medium Opus 5.5 · medium</text>
|
|
56
|
-
<text x="24.0" y="395" fill="#87d787" xml:space="preserve">+ routes.medium Sonnet 5.5 · xhigh</text>
|
|
57
|
-
<text x="24.0" y="414" fill="#87afff" font-weight="700" xml:space="preserve">[ Save routes ]</text>
|
|
58
|
-
<text x="148.8" y="414" fill="#d0d0d0" xml:space="preserve">[ Discard ]</text>
|
|
59
|
-
<text x="242.4" y="414" fill="#d0d0d0" xml:space="preserve">[ Reset to defaults ]</text>
|
|
60
|
-
<text x="24.0" y="433" fill="#7c7c7c" xml:space="preserve">A new model ID needs router.json → models: price, window, efforts.</text>
|
|
61
|
-
<text x="24.0" y="452" fill="#d0d0d0" xml:space="preserve">[ Close ]</text>
|
|
62
|
-
</svg>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 594 515" role="img" aria-labelledby="title desc">
|
|
2
|
-
<title id="title">Router pane, Tuning tab</title>
|
|
3
|
-
<desc id="desc">The classifier rows with the active one marked, a missing Jev API key with Set up, Undo after a switch, the deadline, health, the receiving host and the credentials each classifier needs, then the policy controls.</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="594" height="515" rx="8" fill="#1c1c1c"/>
|
|
9
|
-
<rect x="10" y="10" width="574" height="495" rx="6" fill="none" stroke="#3f5f8f"/>
|
|
10
|
-
<text x="24.0" y="34" fill="#5fafd7" font-weight="700" xml:space="preserve">ROUTER · Auto</text>
|
|
11
|
-
<text x="148.8" y="34" fill="#87d787" xml:space="preserve">Clef Flash ready</text>
|
|
12
|
-
<text x="24.0" y="53" fill="#87afff" font-weight="700" xml:space="preserve">[ Auto ]</text>
|
|
13
|
-
<text x="94.2" y="53" fill="#d0d0d0" xml:space="preserve">[ Manual: keep /model ]</text>
|
|
14
|
-
<text x="24.0" y="72" fill="#d0d0d0" xml:space="preserve">[ Now ]</text>
|
|
15
|
-
<text x="86.4" y="72" fill="#d0d0d0" xml:space="preserve">[ Tiers ]</text>
|
|
16
|
-
<text x="164.4" y="72" fill="#87afff" font-weight="700" xml:space="preserve">[ Tuning ]</text>
|
|
17
|
-
<text x="250.2" y="72" fill="#d0d0d0" xml:space="preserve">[ Usage ]</text>
|
|
18
|
-
<text x="328.2" y="72" fill="#d0d0d0" xml:space="preserve">[ ? ]</text>
|
|
19
|
-
<text x="24.0" y="110" fill="#5fafd7" font-weight="700" xml:space="preserve">CLASSIFIER · asked once per new turn</text>
|
|
20
|
-
<text x="24.0" y="129" fill="#d0d0d0" xml:space="preserve">[ ○ Jev ]</text>
|
|
21
|
-
<text x="164.4" y="129" fill="#7c7c7c" xml:space="preserve">api.typesafe.ai</text>
|
|
22
|
-
<text x="320.4" y="129" fill="#d7af5f" xml:space="preserve">○ no API key </text>
|
|
23
|
-
<text x="429.6" y="129" fill="#d0d0d0" xml:space="preserve">[ Set up ]</text>
|
|
24
|
-
<text x="24.0" y="148" fill="#d0d0d0" xml:space="preserve">[ ○ Clef ]</text>
|
|
25
|
-
<text x="164.4" y="148" fill="#7c7c7c" xml:space="preserve">api.cloudflare.com</text>
|
|
26
|
-
<text x="320.4" y="148" fill="#87d787" xml:space="preserve">● ready</text>
|
|
27
|
-
<text x="24.0" y="167" fill="#87afff" font-weight="700" xml:space="preserve">[ ◉ Clef Flash ]</text>
|
|
28
|
-
<text x="164.4" y="167" fill="#7c7c7c" xml:space="preserve">api.cloudflare.com</text>
|
|
29
|
-
<text x="320.4" y="167" fill="#87d787" xml:space="preserve">● ready</text>
|
|
30
|
-
<text x="24.0" y="186" fill="#d7af5f" xml:space="preserve">Switched from Clef: Clef Flash from the next turn </text>
|
|
31
|
-
<text x="421.8" y="186" fill="#d0d0d0" xml:space="preserve">[ Undo ]</text>
|
|
32
|
-
<text x="24.0" y="205" fill="#d0d0d0" xml:space="preserve">Deadline</text>
|
|
33
|
-
<text x="94.2" y="205" fill="#d0d0d0" xml:space="preserve">3000 ms ▾</text>
|
|
34
|
-
<text x="187.8" y="205" fill="#7c7c7c" xml:space="preserve">then keep the model</text>
|
|
35
|
-
<text x="24.0" y="224" fill="#d0d0d0" xml:space="preserve">Health active · 0 recent failures</text>
|
|
36
|
-
<text x="24.0" y="243" fill="#7c7c7c" xml:space="preserve">Sends prompt + 6 recent turns → api.cloudflare.com</text>
|
|
37
|
-
<text x="24.0" y="262" fill="#d0d0d0" xml:space="preserve">Credentials </text>
|
|
38
|
-
<text x="125.4" y="262" fill="#d0d0d0" xml:space="preserve">[ Edit ]</text>
|
|
39
|
-
<text x="187.8" y="262" fill="#7c7c7c" xml:space="preserve"> opens /plugin configure</text>
|
|
40
|
-
<text x="24.0" y="281" fill="#7c7c7c" xml:space="preserve"> Jev: API key · Clef, Clef Flash: API token, account ID</text>
|
|
41
|
-
<text x="24.0" y="319" fill="#5fafd7" font-weight="700" xml:space="preserve">POLICY · future turns</text>
|
|
42
|
-
<text x="24.0" y="338" fill="#d0d0d0" xml:space="preserve">Votes to go down</text>
|
|
43
|
-
<text x="180.0" y="338" fill="#d0d0d0" xml:space="preserve">2 ▾</text>
|
|
44
|
-
<text x="289.2" y="338" fill="#7c7c7c" xml:space="preserve">agreeing turns before cheaper</text>
|
|
45
|
-
<text x="24.0" y="357" fill="#d0d0d0" xml:space="preserve">Payback horizon</text>
|
|
46
|
-
<text x="180.0" y="357" fill="#d0d0d0" xml:space="preserve">5 turns ▾</text>
|
|
47
|
-
<text x="289.2" y="357" fill="#7c7c7c" xml:space="preserve">a switch repays its cache</text>
|
|
48
|
-
<text x="24.0" y="376" fill="#d0d0d0" xml:space="preserve">Credits cap</text>
|
|
49
|
-
<text x="180.0" y="376" fill="#d0d0d0" xml:space="preserve">$2.00 ▾</text>
|
|
50
|
-
<text x="289.2" y="376" fill="#7c7c7c" xml:space="preserve">max cold write on credits</text>
|
|
51
|
-
<text x="24.0" y="395" fill="#7c7c7c" xml:space="preserve">[ Save tuning ]</text>
|
|
52
|
-
<text x="148.8" y="395" fill="#7c7c7c" xml:space="preserve">[ Discard ]</text>
|
|
53
|
-
<text x="24.0" y="433" fill="#5fafd7" font-weight="700" xml:space="preserve">CONFIG</text>
|
|
54
|
-
<text x="24.0" y="452" fill="#d0d0d0" xml:space="preserve">File ~/.claude/router.json </text>
|
|
55
|
-
<text x="273.6" y="452" fill="#d0d0d0" xml:space="preserve">[ copy ]</text>
|
|
56
|
-
<text x="24.0" y="471" fill="#7c7c7c" xml:space="preserve">Main conversation only. Subagents keep their own model.</text>
|
|
57
|
-
<text x="24.0" y="490" fill="#d0d0d0" xml:space="preserve">[ Close ]</text>
|
|
58
|
-
</svg>
|