All lessons in AI Engineering: From Foundation Models to Evaluated Applications
Inference Latency, Throughput, and Cost
Measure end-to-end latency and cost and choose an optimization subject to quality constraints.
60 minutes · Members lesson · preview
What you will learn
- Measure end-to-end latency, time to first token, throughput, and cost with explicit boundaries.
- Compare caching, batching, routing, and shorter generation under a fixed quality contract.
- Use per-request measurements and load assumptions to choose an optimization without hiding failures.
Your support assistant passes the quality checks, but users wait several seconds before anything useful appears. A teammate suggests a smaller model; another suggests parallel tools. Both may help, but they affect different parts of the path. Without measurements, you can spend time optimizing a component that contributes little to the delay.
This lesson treats performance as an application property. The user experiences queueing, authentication, retrieval, tools, generation, validation, and delivery together. You will measure those stages, choose a change based on the bottleneck, and retain the quality and action boundaries established earlier in the course. All timings and prices below are invented examples.