Larger batches increase latency per request but reduce cost per token
Controls
Batch Size
18128
Context Length
512204816384
Model Size
Hardware
Roofline Model: if arithmetic intensity > ridge point, you're compute-bound. Otherwise memory-bound.
Larger batches improve GPU utilization but increase first-token latency.
Inference Cost Explorer - Interactive Visualization
LLM inference cost breaks down into three components: compute (FLOPs per token), memory bandwidth (loading model weights), and KV cache storage. The roofline model determines whether you are compute-bound or memory-bound - most LLM inference with small batch sizes is memory-bandwidth-limited. Increasing batch size improves GPU utilization but adds latency per request. This explorer lets you find the sweet spot.
Stacked cost breakdown: compute vs KV cache vs memory bandwidth percentage
Batch size vs throughput curve with optimal operating point highlighted
Batch size vs latency curve - see the trade-off in real time
Context length slider - see how longer contexts blow up KV cache cost
Cost per 1M tokens for each hardware + model size combination
Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.