01Chapter 1: Small and large models: what differsRouting starts from one observation: language models in the same product line trade capability against cost and speed, and the trade is uneven. This chapter describes what actually differs between a small and a large model, so that later chapters can build routers on solid ground. It does not cover 8 min read
02Chapter 2: The cost, latency, and quality trade-offThis chapter assumes you can write basic Python, have called a hosted language model through an API, and know that tokens are the unit of billing. It builds the cost and latency model that every later routing decision depends on.9 min read
03Chapter 3: What a router can look atThis chapter assumes you can write basic Python, have called a hosted language model through an API, and know that models differ in cost, speed, and capability. It also assumes you know what tokens are and how per-token pricing works. The previous chapter covered the cost, latency, and quality trade8 min read
04Chapter 4: Rule-based routingThis chapter assumes you can read and write basic Python, including functions, tuples, and regular expressions. It also assumes you have called a hosted language model through an API, and that you know tokens are billed per unit and that larger models cost more and respond more slowly. The earlier c9 min read
05Chapter 5: Estimating how confident the small model isA cascade needs one number per request: how likely is it that the small model's answer is good enough to ship? This chapter covers where that number comes from, how to compute it, and how to check that it means what you think it means.8 min read
06Chapter 6: Cascades: try small first, escalate when neededA router decides which model to use before any model runs. A cascade makes the decision after the small model has answered. This chapter covers how a cascade works, what it costs, where it fails, and how to build one that behaves well in production.8 min read
07Chapter 7: Routing with a learned classifierThis chapter assumes you have read the chapter on rule-based routing. You should be comfortable with basic Python and have seen scikit-learn's fit and predict interface. You should also know what accuracy, precision and recall mean on a labeled dataset.7 min read
08Chapter 8: Evaluating a routing policy and choosing a thresholdThis chapter assumes you can read basic Python and know how a cascade works: the small model answers first, and the request escalates to the large model when the small model's confidence is below a threshold. It also assumes you understand per-token pricing, so that "cost per request" is a number yo7 min read
09Chapter 9: Timeouts, errors, and fallbacksYou know basic Python and have called a hosted language model through an API. You have seen a rule-based router and a confidence cascade from earlier chapters, so you know that a router picks one model and a cascade tries the small model first. This chapter covers what happens when a call in either 9 min read
10Chapter 10: Monitoring a routed system over timeThis chapter assumes you have read the earlier chapters on rule-based routing, cascades, and evaluating a threshold. You should be comfortable with basic Python and with the idea that a routing policy has a threshold, an escalation rate, and an expected cost per request. Here the policy is already d7 min read
11Chapter 11: Common pitfallsThis chapter lists the mistakes that most often make a routed system cost more, answer worse, or fail more often than a single model would. It assumes you have read the earlier chapters. You should know how rule-based routers, confidence-based cascades, threshold sweeps, and fallbacks work, and be c9 min read