Choose a model for the task.
Compare candidate models on capability, data rules, latency, cost, and the quality your users actually need.
Start with the meaning.
A public benchmark can suggest which models are capable, but it cannot tell you which model best serves your specific users. Benchmarks use their own prompts, datasets, and scoring rules. Your application has its own evidence, language mix, latency target, and failure cost. Model selection begins with your task contract and evaluation cases.
Candidate models can differ in available context, modalities, output controls, deployment location, price, and speed. A larger model may answer hard cases better while being too slow for an interactive workflow. A smaller model may be sufficient for simple extraction. The useful comparison is quality at the cost and latency your product can accept.
How the idea works.
Compare models under the same application conditions. Use the same retrieval results, prompt template, output schema, and evaluation cases. Otherwise a prompt improvement can be mistaken for a model improvement. Record model versions and settings. Run the comparison on important slices, not only an average. A model that handles English routine questions well but fails on the language your users speak is not the right choice.
Consider where data goes. A hosted service may process prompts outside your own infrastructure. A locally served model gives more control but requires operational capacity and may perform differently. The right choice depends on data sensitivity, deployment constraints, and the available team. A privacy requirement is a hard constraint, not a score to trade away casually.
Model selection is not one-time procurement. Providers update versions, pricing, and limits. The application should isolate model-specific code so a candidate can be swapped and evaluated. A fallback model may help availability, but it must also satisfy the same permission and output contract.
A fair comparison keeps the surrounding system constant. If model A receives clean retrieved passages and model B receives a raw document dump, the result says little about their relative capability. Run both through the same task template, evidence selection, output checks, and case set. If one model needs a different prompt to work well, record that as a separate system configuration and compare the complete configurations with the same user-facing criteria.
Quality, cost, and latency often form a frontier rather than one universal winner. A fast small model might handle simple routing, while a slower model handles rare ambiguous cases. Such routing adds complexity: the application needs a reliable rule for identifying hard cases and must evaluate mistakes made by that rule. Start with one model that satisfies the contract unless measured evidence justifies a more complex choice.
Follow the code.
candidates = [
{"name": "small", "pass_rate": 0.86, "p95_ms": 900, "cost_per_1000": 0.4},
{"name": "large", "pass_rate": 0.91, "p95_ms": 2800, "cost_per_1000": 2.2},
]
usable = [c for c in candidates if c["pass_rate"] >= 0.85 and c["p95_ms"] < 2000]
choice = min(usable, key=lambda c: c["cost_per_1000"])
print(choice["name"])These are invented measurements to show a decision rule. First filter by minimum quality and maximum latency. Then choose the least expensive option among those that pass. With these numbers, small is selected because large misses the latency requirement. A different use case could set a stricter quality threshold and reach a different result.
The simplified pass_rate hides slices and uncertainty. A real selection report should include sample size, confidence intervals where appropriate, critical failures, privacy constraints, and operational behavior. The code's value is the order of reasoning: requirements first, optimisation second.
What the result does not say.
Do not assume the newest or largest model is necessary. A narrow task with clean evidence may favor a smaller, faster option.
Keep a regression evaluation for upgrades. A model change can improve common cases while breaking a previously reliable format or refusal behavior.
One clear idea.
Select a model against your task's constraints and evidence, then keep checking it as versions change.
The AI cookbook
Complete, explained local workflows sit alongside this reading course.