Notes
The idea
Here is the core idea. Every model sits somewhere on a triangle of quality, cost and latency. Bigger models usually give better answers, but they cost more per token and respond more slowly. Smaller models are cheap and quick, but make more mistakes on hard tasks. So the question is never which model is best. It is which is the cheapest and fastest model that is still good enough for this particular task.
- quality: right answers on YOUR task
- cost: price per request, times requests per month
- latency: how long the user waits for an answer
- bigger model: better quality, higher cost, slower
- goal: the cheapest, fastest model that is good enough
Three families
Models come in three broad families. Frontier models are the largest ones from the big labs, served through an A P I. They are best at hard reasoning, long tasks and agents, and they cost the most. Small fast models from the same providers are often ten to thirty times cheaper and great at classifying, extracting and short replies. Open weight models you download and run yourself. You control the data and can fine tune them, but now you operate the G P Us.
- frontier (hosted API) hardest reasoning, long tasks, agents; priciest
- small fast (hosted API) classify, extract, short replies; 10-30x cheaper
- open-weight (you host) weights you download and run; you control data, can fine-tune, but you run GPUs
Check the features
Before comparing quality, filter on hard requirements. Does the context window fit your largest prompt plus the answer? Can it accept the inputs you have, like images, P D Fs or audio? Does it call tools reliably, including several at once? Does it offer a strict structured output mode that follows a JSON schema? Does it handle the languages your users write in? Any model that fails one of these is out, however good its scores look.
- context window: fits your biggest prompt + output?
- max output length
- modalities: images, PDFs, audio in? images out?
- tool use: reliable calls, parallel calls?
- structured output: strict JSON Schema mode?
- languages you serve
- region, privacy terms
Two kinds of speed
Latency has two parts. Time to first token is how long before any text appears. It grows with prompt length, because the model must read the whole prompt first. Tokens per second is how fast text flows after that. Say a small model starts in zero point three seconds and writes one hundred and fifty tokens a second. A three hundred token answer takes two point three seconds. A big model at one point five seconds and fifty tokens a second takes seven and a half.
total = TTFT + tokens / speed
small: 0.3 + 300 / 150
= 0.3 + 2.0 = 2.3 s
big: 1.5 + 300 / 50
= 1.5 + 6.0 = 7.5 s
chat UI: stream, so TTFT is
what the user feels
batch job: total time matters A monthly cost
Now a cost estimate, using example prices. Twenty thousand requests a day is six hundred thousand a month. Each sends fifteen hundred input tokens and gets three hundred back. That is nine hundred million input tokens and one hundred and eighty million output tokens. At two dollars per million in and eight dollars per million out, that is eighteen hundred plus fourteen hundred and forty, about thirty two hundred dollars a month. A small model at a tenth of the price, around three hundred.
20,000 requests/day x 30 = 600k/mo
each: 1,500 in + 300 out tokens
input: 600k x 1,500 = 900M tok
output: 600k x 300 = 180M tok
example price per 1M tokens:
in 2 USD, out 8 USD
cost = 900 x 2 + 180 x 8
= 1,800 + 1,440 = 3,240 USD
small model at ~1/10: ~324 USD Routing
Most traffic is easy, so you rarely need the big model for everything. Put a router in front. If eighty percent of requests go to the small model and twenty percent to the big one, the bill drops from about thirty two hundred dollars to about nine hundred, a cut of over seventy percent. Route with simple rules, a cheap classifier, or a cascade: try the small model first and escalate when its answer fails a check, like invalid JSON or low confidence.
80% easy -> small: 0.8 x 3,240 / 10
= 259 USD
20% hard -> big: 0.2 x 3,240
= 648 USD
total ~907 USD vs 3,240 (-72%)
how to route:
rules (length, intent, tier)
a small classifier model
cascade: escalate if a check fails Hosting it yourself
Open weight models change the economics. Instead of paying per token, you pay for G P U hours whether they are busy or idle. That pays off when volume is high and steady, when data must never leave your network, when you need to fine tune, or when the model must run offline. The price is real engineering: a serving stack, autoscaling, upgrades and someone on call. Quantised small models can even run on a single G P U or a laptop.
- you pay per GPU hour, busy or idle, not per token
- pays off: high steady volume, strict data rules, need to fine-tune, offline or edge
- costs you: serving stack, scaling, upgrades, on-call
- quantised small models can run on one GPU or a laptop
Your own evals
Leaderboards tell you how a model does on someone else's test, and some of those tests have leaked into training data. Build your own eval set instead. Take fifty to three hundred real cases from your logs, including the awkward ones. Give each a check: an exact answer, valid JSON, or a rubric scored by a person or a judge model. Run every candidate on the same cases with the same prompts. Use leaderboards only to pick the shortlist.
- 50-300 real cases from your logs, edge cases too
- each with a check: exact match, schema valid, or a rubric graded by a person or a judge model
- run every candidate model, same prompts, same cases
- leaderboards: a first filter, never the decision
Reading the results
Here is how results might look. Decide the bar first: say ninety two percent of cases pass, and the slowest five percent of answers finish under five seconds. The frontier model passes but is slow and expensive. The small model is fast but misses the bar. The routed setup passes ninety four percent at under a third of the cost. That is the pick. Keep the eval and rerun it every time a model or prompt changes.
model pass p95 USD/mo frontier 95% 7.5 s 3,240 small 86% 2.3 s 324 open, hosted 89% 3.0 s ~1,500 routed 94% 3.1 s 907 bar: 92% pass, p95 under 5 s winner: routed keep the eval; rerun it on every model or prompt change
Privacy
Ask where the model runs and where your data goes. With a provider A P I, read the terms: how long prompts are kept, whether they are used for training, and whether a zero retention option exists. Many models are also offered inside the big cloud platforms, in your own account and region. Self hosting keeps data inside your network entirely. Whatever you choose, sign a data processing agreement, redact personal data you do not need, and log what you send.
- provider API: check data retention, training use, zero-retention options
- your cloud account: same model, your region + keys
- self-hosted: data never leaves your network
- always: data processing agreement, redact PII, log what you send
Avoid lock-in
Models improve every few months, and prices fall, so you will switch. Make it cheap. Put a thin layer between your app and the providers: one function that takes the model, the messages, the tools and a schema, with one small adapter per provider. Read the model id from config, pin exact versions, and log tokens, cost and latency per call. The same layer gives you a fallback model when a provider has an outage. Keep it thin.
complete(model, messages,
tools, schema) -> reply
one adapter per provider
model id comes from config
pin exact model versions
prompts stored per model
log tokens, cost, latency
fallback model on errors
keep it thin: no big framework Common mistakes
A few mistakes come up again and again. Choosing by leaderboard or by hype. Sending every request, even trivial ones, to the biggest model. Estimating cost from input tokens alone, when output tokens cost several times more. Testing with five happy examples. Assuming a prompt tuned for one model works as well on another. And pointing at a latest alias, so the model changes under you without warning. Each one is fixed by measuring rather than guessing.
- picking by leaderboard or by hype
- frontier model for every request, even trivial ones
- forgetting output tokens cost more than input
- testing with 5 happy cases
- one prompt for all models
- letting "latest" alias change under you silently
Numbers worth knowing
Some numbers worth knowing, all rough. Output tokens usually cost three to five times as much as input tokens. Small models are often ten to thirty times cheaper than frontier ones. Time to first token is roughly a fifth of a second to two seconds, and output runs at about thirty to two hundred tokens a second. Context windows run from about a hundred thousand to over a million tokens. Prices change quickly, so always redo the maths.
output vs input price ~3-5x small vs frontier price ~10-30x cheaper time to first token ~0.2-2 s output speed ~30-200 tok/s context windows ~100k-1M+ tok useful eval set ~50-300 cases cached input far cheaper always recompute with current prices
A decision recipe
Put it together as a recipe. One, write down the hard requirements. Two, shortlist three or four models of different sizes from at least two providers. Three, build an eval set and decide the bar. Four, measure each candidate's pass rate, slow end latency and monthly cost. Five, pick the cheapest one that clears the bar, or route between two if your traffic mixes easy and hard requests. Six, rerun the evals whenever a new model or price appears.
- 1 write the hard requirements
- 2 shortlist 3-4 models, mixed sizes, from 2+ providers
- 3 build the eval set + bar
- 4 measure pass rate, p95 latency, cost per month
- 5 cheapest that clears the bar; route if traffic is mixed
- 6 rerun evals on every new model or price change
Say it like this
How to say it. First I filter on hard requirements: context size, tool use, strict JSON and our data rules. Then I run three candidates on a two hundred case eval built from real traffic. A small model handles about eighty percent of requests, and hard ones go to a frontier model, for about nine hundred dollars a month and three seconds at the slow end. It all sits behind a thin provider layer, so switching is a config change.
- "I filter on hard needs: context, tools, JSON, data rules. Then I run 3 models on a 200-case eval. The small one handles 80% of traffic; hard cases go to a frontier model. ~900 USD a month, p95 3 s, behind a thin layer so we can swap."