The cheapest model call is the one that never leaves the process. On a zero-budget stack, the real risk is not an invoice — it is burning a metered allowance on work that was already computed one restart ago.
This is a build-along for a single-founder setup: one app, one free host, one small model budget. The artifact is a content-addressed cache in stdlib Python plus SQLite, small enough to read in a sitting, durable enough to survive the container being recycled overnight.
Why an in-process dict dies on a free host
A dict cache is correct and useless here. Free hosts sleep, redeploy, and restart on their own schedule. Every cycle empties memory, and the next identical request is billed again.
The failure repeats in three places: a retry after a timeout, a double-submitted form, and a background job that re-runs on boot after a dirty shutdown.…