The tiers, and the price gap between them
Providers offer models with different capabilities, prices and latency. Compare candidates on the task you need to perform, using current rates for input, output, cached input and any separately billed features.
A small model may be suitable for a bounded classification task. A more capable model may justify its extra cost on a difficult reasoning or coding task. Those are hypotheses to test on your own inputs, rather than guarantees associated with a model tier. Model selection.
Benchmarks will not tell you which to use
Published scores measure performance on their test sets. They provide context, while your application also needs representative evaluation. Three reasons a ranking may not transfer are:
Contamination risk. If benchmark material entered training, the score may overstate performance on new cases. Check what the benchmark and model authors disclose.
Distribution mismatch. Your inputs are customer messages with typos in three languages, or scanned invoices from one supplier, or your own product’s jargon. Nothing in a reasoning benchmark resembles that.
The metric is not your metric. A benchmark rewards the right final answer. Your feature might need to refuse when unsure, cite a source, keep to a format, and finish in 800 milliseconds. A model can win on the first and lose badly on the rest.
Start with a small set of your own cases with known correct answers, then expand it to cover difficult and costly failures. Twenty cases can be an initial comparison, but they do not establish a reliable production error rate. Record cost and latency alongside task-specific quality.
Route, do not choose
One design to test is a lower-cost model first, followed by escalation when application checks require it. Compare the cascade with sending requests directly to each candidate.
The following design sketch assumes small, frontier and your task-specific passes_checks are defined by the application.
def answer(q, docs):
draft = small(q, docs)
if passes_checks(draft, docs):
return draft
return frontier(q, docs)passes_checks() needs tests for the task. Schema validation checks structure. A retrieval score checks a property of retrieval. A matching quote establishes that text occurs in a source. None alone establishes that an answer is correct. Evaluate their combined false accepts and false rejects against labeled cases, then measure the actual escalation rate.
Account for both stages when measuring a cascade. Every request pays for the initial attempt, and escalated requests add another model call. Compare total cost, latency and error consequences under the measured traffic mix.
Open weights are a real option
Open-weight models can be candidates for hosted or self-managed inference. Evaluate the particular model, license, runtime and task. You can use a hosted endpoint, run a model on your own machine, or operate a server.
Local inference avoids a per-call provider bill but still consumes hardware, power and maintenance. Hosted compatibility layers can simplify request formats, while model features and response semantics still need checking. Keep a tested fallback that meets your operational and access requirements.
Design for replacement
Model availability and behavior change. Isolate provider-specific request and response handling behind an interface. This design sketch leaves the application’s Completion type and provider adapters to define:
class LLM(Protocol):
def complete(
self,
system: str,
messages: list,
*,
tools=None,
max_tokens=1024,
temperature: float | None = None,
) -> Completion: ...Use one adapter per provider and omit unsupported optional fields. Re-run prompts, retrieval checks, validation and evaluations when switching models. A gateway is another integration option, with its own privacy, routing and feature-support requirements.
A narrow adapter can reduce the implementation work of a model change. A reviewed evaluation set still determines whether that change is acceptable.
Check your understanding
A team wants to test whether a lower-cost cascade can reduce spend while preserving its support-reply quality target. Which experiment is most informative?
Pick the one you would defend. Your answer stays private.
Your place and first choices stay on this browser. Classroom credit is recorded separately.
Every lesson here is open. Your progress is recorded once you pass the Python, from Zero, for AI exam.
Stuck on something?Ask Sayali, your AI tutor