01Chapter 1: Start from the task, not the modelChoosing a model is easier when you first write down what your application needs. This chapter shows how to turn a vague idea ("we need a good LLM") into a short list of concrete criteria. Later chapters measure candidates against those criteria.4 min read
02Chapter 2: Hosted APIs: what you get and what you give upThis chapter assumes you have called an HTTP API or SDK before, can read basic Python, and know what a prompt, a token, and a context window are. It covers the first of the two main ways to get a model: calling one that someone else runs.5 min read
03Chapter 3: Open-weight models: weights you can download and runThis chapter covers what open-weight models are, what you receive when you download one, and what running one involves. It assumes you have called a hosted LLM API before, can read basic Python, and know the terms prompt, token, and context. Parameter counts, memory sizing, and licenses get their ow5 min read
04Chapter 4: Open-weight is not always open-source: reading licensesThis chapter assumes you know what a model's weights are and have used a hosted API or downloaded a model before. It covers what a model license can restrict and how to check one before you build on a model. It is not legal advice. For a commercial product, have counsel read the actual license text.6 min read
05Chapter 5: What model size means for quality and costThis chapter covers what "model size" means, how it relates to quality, speed, and cost, and how to reason about it when choosing a model. It assumes you have called a model through an HTTP API or SDK, can read basic Python, and know the terms prompt, token, and context. Memory estimates, quantizati6 min read
06Chapter 6: Context window limits and why they matterThis chapter assumes you can call a chat-style LLM API in Python, know what a token is, and have read the earlier chapters on hosted APIs, open-weight models, and model size. It covers what a context window is, how to check whether your inputs fit, and how the window affects cost and model choice.5 min read
07Chapter 7: Estimating cost from token pricesThis chapter assumes you have called an LLM API before, can read short Python programs, and know what a token and a context window are. It covers how hosted APIs charge, how to turn token counts into a monthly estimate, and where estimates usually go wrong.6 min read
08Chapter 8: Estimating the memory a model needsThis chapter assumes you can read basic Python and know what parameters, tokens, and a context window are. Memory is usually the first hard limit you hit when you self-host an open-weight model. If the model does not fit in your GPU or system memory, nothing else about it matters. A quick estimate, 5 min read
09Chapter 9: Quantization: trading precision for memoryQuantization stores a model's weights with fewer bits each. This chapter covers how it works, what it does to memory, speed, and quality, and when to use it. It assumes you know what a parameter is and have read the earlier chapters on model sizes and on estimating memory. You should be able to read6 min read
10Chapter 10: Latency versus throughputThis chapter assumes you can call an LLM API, read short Python programs, and know what a token and a context window are. It covers the two speed measures you will compare when choosing between hosted APIs and self-hosted models, and how model size affects each.6 min read
11Chapter 11: Running open-weight models locally and on serversThis chapter covers how to run an open-weight model yourself, on a laptop or on a server. It assumes you can read basic Python, have called an HTTP API or SDK before, and know the terms prompt, token, and context. It also assumes you have seen the idea of parameter count and precision from earlier c6 min read
12Chapter 12: Data privacy and compliance constraintsPrivacy and compliance rules can remove options before cost or quality comes into play. This chapter shows how to turn those rules into concrete requirements for choosing between a hosted API and a self-hosted open-weight model. It assumes you have read the earlier chapters on hosted APIs and open-w6 min read
13Chapter 13: Hosted or self-hosted: weighing the trade-offsThis chapter assumes you have read the earlier chapters on hosted APIs, open-weight models, token pricing, memory estimates, latency, and privacy. It combines them into one decision. You should be comfortable reading short Python programs and the basic terms prompt, token, and context.6 min read
14Chapter 14: Compare candidates on your own examplesThis chapter assumes you can call a model through an SDK or HTTP API, read basic Python, and know what a prompt, a token, and a context window are. It also assumes you have read the earlier chapters on hosted APIs, open-weight models, and model sizes, since those produce your list of candidates.5 min read
15Chapter 15: Design so the model can be swappedThis chapter assumes you can call an HTTP API or SDK, read basic Python, and know what a prompt, token, and context window are. It also assumes you have read the earlier chapters on hosted APIs, open-weight models, and evaluation. Here you will design an application so that changing the model is a c6 min read
16Chapter 16: Routing requests between small and large modelsThis chapter assumes you have read the chapters on model sizes, token pricing, and evaluation. You should be comfortable calling a chat API from Python and reading short functions. Routing builds on a simple observation: most traffic in a real application is easy, and a small model can handle easy r6 min read
17Chapter 17: A checklist for making and revisiting the choiceThis chapter pulls the earlier material into one repeatable process. It assumes you can call an HTTP API or SDK, read basic Python, and already know the terms prompt, token, and context. It also assumes you have seen the ideas covered earlier in the tutorial: hosted APIs, open-weight models, paramet7 min read