01Chapter 1: Small and large models: what differsThis chapter assumes you can read basic Python and have called a hosted language model through an API. You should know that models differ in cost, speed, and capability. You should also know what a token is and that providers charge per token. Nothing else is required.4 min read
02Chapter 2: The cost, latency, and quality trade-offThis chapter assumes you know basic Python, have called a hosted language model through an API, and understand tokens and per-token pricing. It builds on the previous chapter, which described small and large model tiers. Here you will put numbers on what each tier costs and decide when a cheaper tie4 min read
03Chapter 3: What a router can look atThis chapter assumes you can write basic Python and have called a hosted language model through an API. It also assumes you know that models differ in cost, speed, and capability, and that pricing is per token. The previous chapters covered the trade-off between small and large models. This chapter 3 min read
04Chapter 4: Rule-based routingRule-based routing sends each request to a small or large model using fixed checks written by you. This chapter assumes you know basic Python, have called a hosted model through an API, and understand per-token pricing. It builds on the idea that a router can only act on signals it can see before ca3 min read
05Chapter 5: Estimating how confident the small model isThis chapter assumes you can call a hosted model from Python, know what tokens are, and have read the previous chapters on rule-based routing. A cascade needs one number per answer, a confidence score. The threshold check confidence >= threshold is only as good as that number.3 min read
06Chapter 6: Cascades: try small first, escalate when neededThis chapter assumes you know basic Python, have called a hosted language model through an API, and understand per-token pricing. It also assumes you have seen a rule-based router, which picks a model before any model runs.4 min read
07Chapter 7: Routing with a learned classifierThis chapter assumes you know basic Python, have called a hosted language model through an API, and understand per-token pricing. You should also have seen the rule-based router and the cascade from earlier chapters.3 min read
08Chapter 8: Evaluating a routing policy and choosing a thresholdThis chapter assumes you can write basic Python and call a hosted model through an API. It also assumes you know what per-token pricing is and how a cascade escalates from a small model to a large one. Here you will measure a routing policy on labeled data and pick a confidence threshold with eviden4 min read
09Chapter 9: Timeouts, errors, and fallbacksThis chapter assumes you can write basic Python and have called a hosted language model through an API. It also assumes you know how routers and cascades work from earlier chapters. Here you will make a routed system survive failures, so that a slow or broken model call does not become an error show3 min read
10Chapter 10: Monitoring a routed system over timeThis chapter assumes you know how rule-based routers and cascades work, how to compute expected cost per request, and how to pick a threshold on a labeled sample. Those choices were made on data from one moment. Production traffic changes, models are updated, and prices move. Monitoring tells you wh3 min read
11Chapter 11: Common pitfallsThis chapter assumes you have read the earlier chapters. You should know how a rule-based router and a confidence cascade work, how to compute expected cost, and how to sweep a threshold on a labeled sample. Most routing failures come from a few predictable mistakes. Each one below comes with a way 4 min read