Cost and latency evaluation
Treat cost and latency as evaluation metrics next to quality: percentiles instead of means, time to first token versus total time, cost per successful task, SLO checks with confidence intervals, and how to compare configurations fairly. With a runnable comparison where the most accurate model is the wrong choice.
By Sandip Maity, Applied AI Engineer
Quality scores tell you whether answers are right. Users also notice how long they wait, and the business notices the bill. A configuration that is 3 points more accurate, five times slower and twenty times more expensive is often the wrong choice, but you only see that if cost and latency sit in the same report as quality.
#The metrics
| Metric | Why | How to report |
|---|---|---|
| Time to first token (TTFT) | Perceived responsiveness in streaming UIs | p50, p95 |
| Total latency | Agents, non-streaming calls, pipelines | p50, p95, p99 |
| Output speed | Long answers, code generation | tokens per second, p50 |
| Cost per request | Budget | mean, from token counts and prices |
| Cost per successful request | What a correct answer actually costs | total cost / successes |
| Quality | Correctness | rate with a confidence interval |
Latency is skewed: most requests are quick, a few are slow, and the slow ones are what users remember. Always report percentiles (measuring speed).
Pro content
Keep reading with Inference Academy Pro
Unlock the rest of this lesson, plus every advanced lesson, hands-on lab, the larger playground models and completion certificates.
Still to come in this lesson
- A worked comparison
- Getting the numbers right
- Make it a gate
- Common mistakes
- Exercises
You will be able to answer
- Why report p95 latency rather than the mean?
- Why divide cost by successful requests rather than by all requests?
- Configuration A has quality 0.82 with interval [0.78, 0.86]. The SLO says quality must be at least 0.80. Should you say it meets the SLO?
- For a streaming chat UI, which latency number matters most to perceived speed?
- What makes a latency comparison between two configurations fair?