Lesson 4 of 40How AI works
Choosing a Model
Pick the right model and effort level for a task by weighing quality, speed and cost, and prove the choice by measuring on your own work.
"Which model should I use?" is one of the most common questions in AI engineering, and "the best one" is rarely the full answer. The most capable model can be dozens of times more expensive and several times slower than a small one, and for many jobs the small one is just as good. Picking well is a real engineering skill: it decides whether a feature costs ten dollars a day or a thousand, and whether a user waits one second or ten. This lesson gives you a way to choose, and a way to check your choice with evidence instead of vibes.
Families and tiers
AI companies release models in families: a set of models built around the same time, sharing a generation number, in several sizes. Within a family, the sizes form tiers, and every provider has roughly the same three:
Small models answer in a fraction of the time at a tiny price. They handle simple decisions well and struggle with long, multi-step reasoning.
Here is the Claude lineup as a dated snapshot. Model names, prices and limits change often, so always check the official docs for the current table.
| Model | ID | Tier | Context | Input per 1M | Output per 1M |
|---|---|---|---|---|---|
| Claude Fable 5.1 | claude-fable-5-1 | Most capable | 1M | $10 | $50 |
| Claude Opus 5.5 | claude-opus-5-5 | Very capable | 1M | $4 | $20 |
| Claude Sonnet 5.5 | claude-sonnet-5-5 | Balanced | 1M | $2 | $10 |
| Claude Haiku 5.5 | claude-haiku-5-5 | Small, fast | 1M | $0.10 | $0.50 |
Look at the spread. Haiku's input price is 100 times cheaper than Fable's. For a job that runs a million times, that gap is the whole budget. Other providers have their own families with the same shape, and tools like GitHub Copilot let you pick from several providers' models in one menu.
What does this print?
tokens = 2_000_000 price_per_million = 4 print(tokens / 1_000_000 * price_per_million)
The three-way trade-off
Every model choice trades three things against each other:
- Quality: does it get the answer right, follow instructions, write code that works?
- Latency: how long until the user sees the answer? Bigger models and more thinking both take longer.
- Cost: price per token times the number of tokens, times how often it runs.
You can rarely max all three. A chat autocomplete needs low latency more than peak quality. A nightly job that reviews every pull request can be slow but must be good. A classifier tagging ten million support tickets must be cheap. The right question is not "which model is best?" but "which is the cheapest, fastest model that is good enough for this task?"
What to use where
Some patterns hold across most projects:
| Task | Typical tier | Why |
|---|---|---|
| Classifying, tagging, routing messages | Small | Simple decisions, huge volume, speed matters |
| Extracting fields from documents | Small or balanced | Depends on how messy the input is |
| Summarising, rewriting, drafting | Balanced | Good writing without top-tier cost |
| Everyday coding help, explaining code | Balanced | Strong at code, quick to answer |
| Long coding agent tasks across many files | Most capable | Mistakes compound over many steps |
| Hard debugging, architecture, tricky maths | Most capable | Needs deep reasoning |
| Subagents doing focused search or checks | Small or balanced | Narrow task, many parallel calls |
The agent row deserves a note. When a model takes 40 steps on its own, a 2% chance of a wrong step per step adds up quickly, and each mistake can send the rest of the run down the wrong path. That is why agent work favours the most capable models, while the subagents an agent sends off for narrow jobs (searching files, running checks) can often use a cheaper tier. You will set this up in the Subagents and Orchestrators lesson.
Match each task to a sensible starting tier.
Effort: a dial, not just a model swap
Choosing a model is one dial. On current Claude models there is a second: effort, which controls how much the model thinks and how many tokens it spends. Thinking is adaptive, meaning the model decides how much reasoning each request needs, and effort shifts that budget up or down. Lower effort gives fewer tokens and faster answers; higher effort helps hard coding and agent work. In the API it looks like this:
response = client.messages.create(
model="claude-opus-5-5",
max_tokens=16000,
output_config={"effort": "low"}, # "low" | "medium" | "high" | "xhigh" | "max"
messages=[{"role": "user", "content": "Classify this ticket: ..."}],
)In Claude Code, /model switches the model and /effort changes the effort level for the session. A capable model at low effort is sometimes the sweet spot: its judgment, without paying for long thinking on easy steps. A cheaper model at high effort can sometimes match a bigger one on a narrow task. The only way to know is to try both on your work.
Model tier sets the ceiling: how capable the model can be at all, and its price per token.
Measure on your own tasks
Public benchmarks tell you how models do on someone else's problems. Your problems are different: your codebase, your users' writing style, your edge cases. The reliable method is small and boring:
- Collect 20 to 200 real examples of the task, with the answer you consider correct.
- Run each candidate model (and effort level) on all of them.
- Score correctness, and record latency and token usage.
- Pick the cheapest option that clears your quality bar.
This runnable compares four models on a made-up support ticket classifier. The accuracy numbers are invented for the exercise, but the prices are the snapshot table above. Try changing TARGET to 0.95, or DAILY to 500.
Press Run (⌘ Enter) to see what happens.Notice what the numbers say. The most capable model is best, but only by a few points, at five times Sonnet's price. Haiku is 20 times cheaper than Sonnet but misses the bar. In a real project you would now look at Haiku's 29 failures: if they share a pattern, a better prompt or a couple of examples might lift it over the line and save most of the bill. The Evals lesson turns this into a proper harness.
Start high, then step down
When you start a new task, a widely recommended default is: start with the most capable model to learn what good looks like, then step down to cheaper models or lower effort wherever quality holds. Starting small has a hidden cost. If the small model fails, you cannot tell whether the task is impossible, your prompt is bad, or the model is too weak. Starting at the top removes the model from the list of suspects.
Once it works, step down in order: lower effort first, then a cheaper tier, re-running your examples each time. Stop when quality drops below your bar. Revisit the choice when new models come out; a new small model often matches an old large one.
Put the model selection process in order.
- Tap the steps below in the right order.
- model family
- A set of models released together in several sizes, sharing a generation.
- model tier
- A model's position in its family: small and fast, balanced, or most capable.
- effort
- A setting that controls how much a model thinks and how many tokens it spends.
- latency
- How long a request takes before the answer arrives.
- quality bar
- The minimum accuracy or standard a task needs, decided before comparing models.
- step down
- Moving to lower effort or a cheaper model once the task works, while quality holds.