Latency and Cost Budgets
In this article
- Split an end-to-end reply-time limit into p95 and p99 limits per stage that add up to it, with a cost ceiling per answer.
- Find the stages a reply actually waits for, and predict which one to cut first.
- Explain why reply time grows with reply length, and cut it without letting a quality check fail.
- Add a fallback that skips a slow stage and records the skip.
- Terms defined here: latency budget.
Overview
A change makes your answers better and your replies slower. Do you ship it anyway, drop it, or find the time somewhere else?
Brightline, a made-up home-internet provider, runs a support assistant that searches its help pages and gives the 3 best passages to a model that writes the reply. A reranker, a second model that reorders the search results, improved retrieval but was kept out of production because it pushed the reply time past Brightline's 5-second limit. Afterwards you can split that limit into a time and cost allowance per stage, see which stage to cut, and ship a speed-up only when quality holds.
Sign in to keep reading
The rest of this article opens with an account. An account also keeps your progress and quiz results on every device, and lets you follow news for up to five topics.
Still to read in this article
- Where the 5.5 seconds go
- A budget for every stage
- Two knobs and one gate
- When a stage runs over
- Common mistakes
- In production
- Sources
- Check yourself, 13 questions