Choosing a model
Pick the cheapest model that clears your quality bar on your own evals, within latency, cost and compliance limits. Prove value with the best model, then route or distill down behind a swappable abstraction.
Analogy: Hiring: résumés and certifications (benchmarks) build the shortlist, but the work-sample test on your actual job (your evals) decides. And you don't pay a senior's salary for work an intern does well.
How it works
- Build a golden set from real traffic; public benchmarks are contaminated and saturated, so they only shortlist.
- With 200 cases at ~90% accuracy, the 95% interval is ±~4 points: smaller gaps are noise.
- Judge latency at your p95, not the demo, and cost by your real token mix, retries included.
- If the frontier model fails, a small one will too; success gives you a quality ceiling and labels.
- Stay portable: call models through a gateway, keep evals per model and pin versions, since aliases move.
Check yourself
Answer to mark it learned; your answers aren't scored.
To keep the prototype cheap, your team built a contract-review feature on the smallest nano tier. It scores 70% on your golden set and nobody can tell whether the task is feasible. Best next step?
Go deeper
Full explanation
Choosing a model means picking the cheapest model that clears your quality bar on your task, within latency, compliance and ops constraints, while keeping the freedom to switch.
Criteria, roughly in the order they decide
- Quality on your evals: a golden set built from real traffic. Public benchmarks only build the shortlist: they're contaminated, saturated and rarely your task.
- Latency: time-to-first-token and tokens/s at your p95, not in the demo.
- Cost per task: $/M input and output tokens × your real token mix, including hidden reasoning tokens and retries.
- Capabilities: context length, modalities, tool calling, structured outputs, fine-tuning.
- Constraints: license terms, data residency, retention and zero-data-retention, on-prem needs.
- Open weights vs API: control and per-token cost at scale vs zero ops and frontier quality (API vs self-hosting).
The strategy
- Prove value with the best model. If the frontier model can't do it, a small one won't; if it can, you get a quality ceiling and labeled outputs.
- Then go down-market: try smaller tiers on the same evals, send easy traffic through Model routing & cascades, or Knowledge distillation from the big model's outputs.
- Stay portable: call models through a thin interface or LLM gateway, keep prompts and evals per model, and pin versions, because aliases move and old models get retired.
Code A minimal bake-off: quality, p95 latency, cost per task
import statistics, time
import litellm # one interface over OpenAI, Anthropic, Gemini, Bedrock, vLLM...
# Example ids: one frontier model and cheaper candidates
CANDIDATES = ["gpt-4.1", "gpt-4.1-mini", "anthropic/claude-haiku-4-5", "gemini/gemini-2.5-flash"]
def evaluate(model: str, golden: list[dict]) -> dict:
passed, cost, lat = 0, 0.0, []
for case in golden:
t0 = time.perf_counter()
resp = litellm.completion(model=model, temperature=0,
messages=[{"role": "user", "content": case["input"]}])
lat.append(time.perf_counter() - t0)
cost += litellm.completion_cost(completion_response=resp)
passed += grade(resp.choices[0].message.content, case) # your task's grader
return {"model": model,
"accuracy": passed / len(golden),
"p95_s": statistics.quantiles(lat, n=20)[18],
"usd_per_1k_tasks": 1000 * cost / len(golden)}
results = [evaluate(m, golden_set) for m in CANDIDATES]
# Cheapest model within ~1 point of the best that also meets the latency SLO
best = max(r["accuracy"] for r in results)
ok = [r for r in results if r["accuracy"] >= best - 0.01 and r["p95_s"] < 3.0]
print(min(ok, key=lambda r: r["usd_per_1k_tasks"]) if ok else "nothing meets the SLO")Real example
A team builds contract-clause extraction. On a 300-case golden set, the frontier tier scores 94% at ~$12 per 1k contracts, the mini tier 91% at ~$2.40, the nano tier 78%. They launch on the frontier model to prove value, then route short, standard contracts (~70% of traffic) to the mini tier, where it matches the frontier model on evals. Cost drops ~55%. When a new model ships, the same harness re-runs overnight and the switch is a gateway config change.
Trade-offs +3 · −3
+ You gain
- Decisions rest on your data, not leaderboard gaps that don't transfer to your task.
- Starting with the best model quickly separates "the task is impossible" from "the model is too weak".
- A portable interface turns each new release into an eval re-run, not a rewrite.
− You pay
- Building and maintaining a golden set and graders is real upfront work.
- Frontier-first prototypes can set cost expectations the business later rejects.
- Abstraction layers can hide provider-specific features (prompt caching, special tool modes) unless you leave escape hatches.
Use it when
At project start, when a new model generation ships, when cost or latency budgets change, and before any long-term commitment. Re-run the same evals every time.
Avoid it when
Skip a full bake-off for a throwaway prototype or a low-volume internal tool: pick a strong default model, ship, and revisit if usage grows.
Numbers to know 4
- FrugalGPT: LLM cascades matched GPT-4 quality with up to 98% lower cost on its benchmarks.
- List-price spread within one family: GPT-4.1 $2 vs GPT-4.1-nano $0.10 per M input tokens (20×, as of 2025).
- 200 eval cases at ~90% accuracy → ±~4 points 95% confidence interval: smaller gaps are noise.
- Llama community license: services above 700M monthly active users need a separate license from Meta.
Common pitfalls 4
- Choosing by leaderboard rank, or by vibes from five hand-picked prompts.
- Comparing $/token instead of $/task: a cheaper model that needs retries, longer outputs or more reasoning can cost more.
- Hard-coding one provider's SDK, prompt quirks and model id everywhere: migration becomes a quarter-long project.
- Discovering residency, retention, license or rate-limit blockers after the build.
Interview questions 3
Answer out loud first, then reveal.
How do you choose an LLM for a new product?Show answer
I start with the constraints that eliminate options: data residency, license, on-prem, modalities, context length. Then I shortlist three to five models from public benchmarks and pricing. The decision comes from our own golden set, a few hundred real cases with a grader, scored on quality, p95 latency and cost per task. I prototype with the strongest model to prove value and set the ceiling, then test cheaper tiers, routing and distillation against the same evals, all behind a gateway so switching is a config change.
Open-weights model or API?Show answer
It's a trade between control and operations. APIs give frontier quality, zero infrastructure and fast iteration, so they're my default until something forces a move. Open weights win when data can't leave our boundary, when we need deep fine-tuning, or when volume is high and steady enough that well-utilized GPUs beat per-token pricing. The hidden cost is the team: serving, scaling, evals and upgrades become ours. I decide with a TCO at our real volume, not list prices.
A new model tops the leaderboard. Do we switch?Show answer
Not on that alone. Leaderboards measure someone else's task, suffer from contamination, and arena rankings partly reward style. I add it to the shortlist and re-run our suite: quality, latency, cost per task, plus a diff on the cases we pass today. If it wins by more than the noise, which with 200 cases is at least four points, and clears our constraints, we switch behind the gateway with a canary and roll back if online metrics drop.