Skip to content

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.

14 min read0/4 questions

"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:

The three tiers
  1. Most capablehardest reasoning, long agent runs; priciest, slowest
  2. Balancedstrong at most work, including everyday coding
  3. Small, fast, cheapsimple, high-volume tasks at a tiny price

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.

1/4

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.

ModelIDTierContextInput per 1MOutput per 1M
Claude Fable 5.1claude-fable-5-1Most capable1M$10$50
Claude Opus 5.5claude-opus-5-5Very capable1M$4$20
Claude Sonnet 5.5claude-sonnet-5-5Balanced1M$2$10
Claude Haiku 5.5claude-haiku-5-5Small, fast1M$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.

Predict the outputPython

What does this print?

tokens = 2_000_000
price_per_million = 4
print(tokens / 1_000_000 * price_per_million)
Need a nudge? Hints walk you through it.

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:

TaskTypical tierWhy
Classifying, tagging, routing messagesSmallSimple decisions, huge volume, speed matters
Extracting fields from documentsSmall or balancedDepends on how messy the input is
Summarising, rewriting, draftingBalancedGood writing without top-tier cost
Everyday coding help, explaining codeBalancedStrong at code, quick to answer
Long coding agent tasks across many filesMost capableMistakes compound over many steps
Hard debugging, architecture, tricky mathsMost capableNeeds deep reasoning
Subagents doing focused search or checksSmall or balancedNarrow 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 the pairs0/4 matched

Match each task to a sensible starting tier.

Choose an item, then its match on the other side.

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.

Two dials for every task
Your task: what needs doingYour taskwhat needs doingModel tier: small to most capableModel tiersmall to most capableEffort: low to maxEffortlow to maxYour test set: real examplesYour test setreal examplesChoice: good enough, cheapestChoicegood enough, cheapestpickpickrunrunmeasure

Model tier sets the ceiling: how capable the model can be at all, and its price per token.

1/4
Quick check
Your coding agent on the most capable model gets everything right but is slow and costly, mostly on easy steps like renaming variables. What should you try FIRST?
Need a nudge? A hint rules out a wrong answer.

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:

  1. Collect 20 to 200 real examples of the task, with the answer you consider correct.
  2. Run each candidate model (and effort level) on all of them.
  3. Score correctness, and record latency and token usage.
  4. 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.

Python
# Results from running 200 real support tickets through each model# (made-up numbers for this exercise). Prices are per million tokens.results = { # model correct avg sec in $ out $ "Fable 5.1": (194, 9.0, 10.00, 50.00), "Opus 5.5": (192, 5.5, 4.00, 20.00), "Sonnet 5.5": (189, 3.0, 2.00, 10.00), "Haiku 5.5": (171, 0.8, 0.10, 0.50),}TICKETS = 200IN_TOK, OUT_TOK = 1_200, 150 # per ticketDAILY = 50_000 # tickets per day in productionTARGET = 0.94 # the accuracy we need print(f"{'model':<11} {'accuracy':>8} {'latency':>8} {'per day':>9}")passing = []for name, (correct, secs, p_in, p_out) in results.items(): acc = correct / TICKETS per_ticket = IN_TOK / 1e6 * p_in + OUT_TOK / 1e6 * p_out daily = per_ticket * DAILY mark = "ok" if acc >= TARGET else "--" print(f"{name:<11} {acc:>8.1%} {secs:>7.1f}s ${daily:>8,.2f} {mark}") if acc >= TARGET: passing.append((daily, name)) cost, best = min(passing)print(f"\nCheapest model that meets {TARGET:.0%}: {best} (${cost:,.2f} a day)")
Output
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 it in order5 steps

Put the model selection process in order.

  1. Tap the steps below in the right order.
Need a nudge? A hint shows where it starts.
Key terms
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.