Choosing a Model

Weigh quality, speed, cost, context size and privacy for your task, and pick the cheapest model that passes your own tests instead of the most famous one.

15 minLesson 6 of 7
On this page
  1. There is no best model, only a best fit
  2. Let your own tests decide
  3. Mixing models
  4. Try it yourself
  5. Common mistakes
  6. Check yourself
  7. What to practise next

A team builds a feature that sorts incoming support tickets into five categories. They pick the most capable model their provider offers, because it is "the best". It works well. Then the first monthly bill arrives, and users complain that the ticket form hangs for five seconds after they press Send.

They try a smaller model on fifty old tickets. It labels them almost as well, answers in about a second, and costs a fraction as much per ticket. Meanwhile, the team next door used a small, fast model to review contracts and kept missing unusual clauses. Both teams made the same mistake in opposite directions: they chose a model before they knew what the task needed.

There is no best model, only a best fit

Every model choice trades a few things against each other. Bigger, more capable models tend to follow long instructions better, handle subtle cases and reason through harder problems. They are also slower and cost more per token. Smaller models are fast and cheap and often perfectly good at narrow, well-defined tasks.

FactorWhat it meansMatters most when
QualityHow often the output is right and useful for your taskMistakes are costly or hard to spot
SpeedHow long until the reply starts, and until it finishesA person is waiting, as in chat or autocomplete
CostPrice per token, times tokens per request, times requestsVolume is high, or each request is very long
Context sizeHow much text fits in one requestYou must process long documents or big codebases at once
Privacy and hostingWhere the model runs and what happens to your dataData is sensitive, regulated or must stay on your machines

Some models also offer a mode where they "think" longer before answering (see Give the Model Room to Think). That moves the same trade-off along a dial: better answers on hard problems, at the price of more time and more tokens. For easy tasks it often adds cost without improving anything.

Cost is easy to underestimate because it multiplies. A model that costs five times more per request barely matters for ten requests a day. For a feature that runs on every one of 30,000 tickets a month, the same factor of five is the difference between a rounding error and a budget line someone will ask about.

Let your own tests decide

Public rankings measure models on someone else's tasks. Your tickets, your documents and your users are different. The reliable way to choose is to build a small test set from real examples with known right answers, run each candidate on it, and compare. Evals covers how to build a good one; fifty labelled examples is a reasonable start for a simple task.

For the ticket team, the bar was: at least 90% labelled correctly, and a reply in at most 2 seconds. Here is the choice as code.

Pick the cheapest model that clears the bar
// Results from running each candidate on your own 50 test tickets.
const candidates = [
  { name: "large", accuracy: 0.96, seconds: 4.8, cost: 20 },
  { name: "small", accuracy: 0.84, seconds: 0.6, cost: 1 },
  { name: "medium", accuracy: 0.92, seconds: 1.4, cost: 4 },
];
 
function chooseModel(candidates, minAccuracy, maxSeconds) {
  const byCost = [...candidates].sort((a, b) => a.cost - b.cost);
  for (const model of byCost) {
    if (model.accuracy >= minAccuracy && model.seconds <= maxSeconds) {
      return model.name; // cheapest one that clears every bar
    }
  }
  return null; // nothing is good enough: rethink the task or the bar
}
 
chooseModel(candidates, 0.9, 2); // "medium"
# Results from running each candidate on your own 50 test tickets.
candidates = [
    {"name": "large", "accuracy": 0.96, "seconds": 4.8, "cost": 20},
    {"name": "small", "accuracy": 0.84, "seconds": 0.6, "cost": 1},
    {"name": "medium", "accuracy": 0.92, "seconds": 1.4, "cost": 4},
]
 
def choose_model(candidates, min_accuracy, max_seconds):
    for model in sorted(candidates, key=lambda m: m["cost"]):
        if model["accuracy"] >= min_accuracy and model["seconds"] <= max_seconds:
            return model["name"]  # cheapest one that clears every bar
    return None  # nothing is good enough: rethink the task or the bar
 
choose_model(candidates, 0.9, 2)  # "medium"

The names are placeholders for whatever your provider offers, and cost is in relative units: "small" costs 1 per ticket, "large" costs 20. Step through the decision.

Choosing a model for ticket labellingUse the arrows or ← → keys
sort candidates by cost, cheapest firstfor each model:  if accuracy >= 0.90 and seconds <= 2:    return modelreturn none
  1. candidates
    accuracysecondscost
    small42/50 = 0.840.61
    medium46/50 = 0.921.44
    large48/50 = 0.964.820
    min accuracy
    0.9
    max seconds
    2

    1Three candidates, each run on the same 50 labelled tickets. Sort them cheapest first, so the first one that passes is the cheapest that passes.

  2. candidates
    accuracysecondscost
    small42/50 = 0.840.61
    medium46/50 = 0.921.44
    large48/50 = 0.964.820
    min accuracy
    0.9
    max seconds
    2
    checking
    small

    2Small: fast and cheap, but 0.84 is below 0.90. It got 8 of 50 tickets wrong, and that bar came from what the support team can live with. Rejected.

  3. candidates
    accuracysecondscost
    small42/50 = 0.840.61
    medium46/50 = 0.921.44
    large48/50 = 0.964.820
    min accuracy
    0.9
    max seconds
    2
    checking
    medium

    3Medium: 0.92 ≥ 0.90 and 1.4 ≤ 2 seconds. Both bars cleared.

  4. candidates
    accuracysecondscost
    small42/50 = 0.840.61
    medium46/50 = 0.921.44
    large48/50 = 0.964.820
    chosen
    medium

    4Return medium. Every cheaper model has already been checked and failed, so the loop stops here and never looks at large.

  5. candidates
    accuracysecondscost
    small42/50 = 0.840.61
    medium46/50 = 0.921.44
    large48/50 = 0.964.820
    chosen
    medium
    cost vs large
    1/5

    5Large would have got 2 more tickets right out of 50, but at 5 times the cost, and its 4.8 seconds fails the speed bar anyway. The "best" model was the wrong choice for this task.

1 / 5

If nothing passes, do not just lower the bar. Ask whether the task can be made easier: clearer instructions, a few examples in the prompt, or splitting one hard request into two simple ones. A better prompt often moves a cheaper model over the line.

Mixing models

You do not have to pick one model for everything. A common pattern is routing: a small model handles the easy, high-volume cases, and anything it marks as unsure goes to a bigger one. Another is to use a capable model to write a plan and a cheaper one to carry out the simple steps. Each split adds moving parts, so do it when cost or speed really demands it.

Try it yourself

Try it: Name the trade-offs

For each feature, say which two factors matter most and what kind of model you would try first. Give the reason.

  1. Suggested replies that appear while a user types in a chat app.
  2. A nightly job that summarises 2,000 long legal documents for a law firm's archive.
  3. A tool at a hospital that drafts discharge notes from patient records.
Show a sample answer
  1. Speed and cost. The user is waiting, and it runs on every few keystrokes for every user, so volume is huge. A suggestion that is slightly worse costs little: the user just ignores it. Try a small, fast model first.
  2. Context size and quality. Each document is long, and nobody is waiting, so speed barely matters. Errors in a legal archive are costly. Try a capable model that can take a whole document at once, or a cheaper one with a good chunking plan (see Chunking and Retrieval), and compare them on a sample with known good summaries.
  3. Privacy and quality. Patient data may have to stay inside the hospital's own systems, which can rule out some hosted options before quality is even tested. Then quality matters a great deal, and every draft needs a clinician's review. Start from what the hospital is allowed to use, then test within that.

Notice that "which model is smartest" was never the first question. The task decided the factors, and the factors narrowed the choice.

Common mistakes

Check yourself

Quick check

With a bar of 0.90 accuracy and 2 seconds, chooseModel returned "medium". What does it return if the accuracy bar is raised to 0.95?

Why sort the candidates by cost before checking them?

A feature works with the most capable model but is too slow. What should you try first?

What to practise next

Pick one task you use AI for regularly and write its bar in numbers: how often it must be right, how fast it must be, and what data it touches. Then read Common Mistakes, which pulls together the habits from this whole module.