1 Commits
Author SHA1 Message Date
CatoandClaude 981ed229cf feat(models): Auto decides — a greeting never spends a frontier model (#1131)
With a person's own keys, "Auto" meant the first key's one model for every
turn: an Anthropic key put Fable 5.1 on "what time is it". George's rule:
never a frontier model for trivial work, and a cheap model may be as good
for the rest.

- lib/models/difficulty.ts (pure): message + history → light / standard /
  heavy with a reason. Explicit asks win ("think hard", "quick"); then code,
  a judgement call, a professional domain, writing, research, length and a
  numbered list count as signs (two make heavy, one standard); then the
  shapes a cheap model answers as well as any (greeting, capture, lookup,
  short question) are light.
- lib/models/auto-picks.ts (pure): from what the keys reach, three picks —
  economy (best value among cheap tool-capable), standard (best value at or
  above the median below frontier price), frontier (smartest). A hand pick
  wins and says "your choice". Stance thrifty / balanced / best maps a
  difficulty to a pick; a light turn goes to economy under every stance.
  chainFor: the pick, nearest tiers up before down, every key's default.
- lib/models/routing.ts: candidates per key (a router reaches the
  catalogue, a lab key its namespace, a host or endpoint only what was
  stored); routeTurn for one turn; routingFor for the screens; autoSummary.
  loki-core.ts#loadOwnModel walks the turn's links on Auto; provenance says
  "your key: X — light turn (a greeting)". A composer pick bypasses it; no
  catalogue yet falls back to the keys as stored.
- Migration 0089: user_preferences.model_stance; user_model_tiers for hand
  picks. /api/settings/model/routing GET/PUT.
- components/models/AutoRouting.tsx on /models (with keys) and in Settings
  → AI: stance, the three picks with reasons, a select per tier, "Loki
  decides". The composer's Auto row names the two ends.
- Tests: difficulty (5), auto-picks (5). Doc section "Auto decides".
  Changelog.


Claude-Session: https://claude.ai/code/session_01YKx4TPejLvFR9Uj4xrTf6Y

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-10 04:02:48 -07:00