Level 5: AI / LLM systems · L5.4 LLM gateways, caching & cost control
Routing, fallbacks and budgets
Design model cascades, provider fallback and per-tenant token budgets.
12 min · Pro
What you take away
- A cascade only saves money while the escalation rate stays low, and every escalated request pays both calls in latency as well as cost.
And 3 more inside the class, in Pro.
How the class is laid out
- The problem
- Junior clerk, second number, department budget
- Cascades: cheap first, but count the escalations
- Fallback: an untested path that only runs on your worst day
- Budgets: tokens, reserved and reconciled
- The whole module on one invoice
- The gateway
- Prompt caching
- Semantic caching
- Routing and fallback
- Budgets
- Check your understanding