Commit ce5c668
authored
fix(ai): the OpenRouter fallback was a premium paid model (#135)
OPENROUTER_DEFAULT_MODEL was `anthropic/claude-sonnet-5`. OpenRouter is the
FALLBACK here — it is reached when Groq's free tier is spent — so the failure
mode of 'the free tier ran out' was not a degraded answer or an honest refusal.
It was a bill, on a premium model, produced by the one code path nobody watches
because it only runs when something else has already broken.
A fallback is a reliability mechanism; paying is a business decision. Wiring the
second to the first lets an outage make the decision at the worst moment,
without anyone choosing it. It also broke the standing fleet rule that Anthropic
is never a primary or fallback provider.
Now `openai/gpt-oss-20b:free`, which reports pricing.prompt = 0 in OpenRouter's
own catalogue (checked 2026-08-16) and was probed live for tool support on
2026-08-15.
Guarded by a test, because this path is invisible in normal operation: the
default must end in `:free` and must never be an Anthropic id. The rule mirrors
`modelCost` in the shared ai-ration package — a routed id is free ONLY with the
`:free` suffix, which is the entire difference between free routing and a
per-call charge for identical weights.
The same mistake was found in three apps on the same day (also kivvi and evig).1 parent 1ac55b8 commit ce5c668
2 files changed
Lines changed: 39 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
59 | 70 | | |
60 | 71 | | |
61 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
0 commit comments