~/

← ~/blog

Rethinking Serving Metrics for AI Inference

2026-10-31 · #metrics , #observability , #monitoring , #inference , #dashboard

Traditional observability metrics for web services are useful for LLM inference, but they must be supplemented and interpreted differently. Generative AI serving introduces distinct workloads and resource constraints, making additional metrics necessary for several reasons:

  • Serving pipelines for traditonal web-service requests are roughly similar in costs however in AI inference output is non-deterministic , one request can be 10 tokens, while the next might generate 10000 tokens; thats 10000 to 1 imbalance
  • Hardware is expensive. An 8–16 vCPU CPU node may cost £30–£100 per month, while a GPU node (for example, one equipped with an NVIDIA H100 or A100) can cost £1,500–£10,000 or more which is roughly 50–100 times as much. Inference costs also depend on the unit being measured: traditional web serving may cost $0.01–$0.05 per million requests, while LLM inference may cost $0.50–$3.00 or more per million tokens. Even though these figures are in different unit, they highlight why AI serving requires careful utilisation of the resources ( Cost quoted are as of Q4 2026 )
  • AI models spit out a probabilistic output, and “it works” is a quality spectrum, whereas in a typical web-services correctness is binary
  • Statefulness: during generation, the KV cache stores prior tokens’ keys and values so they do not need to be recomputed at every step. This cache consumes GPU memory and grows with active sequences, making memory a scarce resource and potentially requiring requests to remain associated with their cached state.
  • Provision timelines are off by an order of magnitude; 50ms startup for a CPU workload ( Warm pool, image load, process init ) can easily go above 60 seconds for provisioning a GPU which includes runtime setup (CUD/CuDNN/drivers), context init, model load ( host RAM->VRAM transfer, longer if downloading from storage), and graph capture. That’s roughly 120 times longer cold start

So what are these LLM inference metrics to observe and optimize?

Mostly traditonal web-serving metrics are ommitted below although I covered these on a seperate post #ultimate-ai-inference-dashboard

Time to First Token (TTFT)

This is the latency between the user request to the generative AI inference service, and getting back the first generated token from the model

Request arrives                                             Response ends
	│                                                           | 
	▼               .- Tokenization           Detokenization -. | 
                    |                                         | ▼ 
	├─ Queueing ──┼───┼──── Prompt prefill ────┼── Decode ──┼───┤
	│             │   │                        │  token 0   │   │
	└─────────────┴───┴────────────────────────┴────────────┴───┘
	◄──────────── TTFT ─────────────────────────────────────────►

TTFT is dominated by prefill latency which is a compute bound workload that scales with prompt length, batching/scheduling policy, and compute/memory-bandwidth bottlenecks on the accelerator. Conversely Tokenisation/Detokenisation take a tiny fraction of the TTFT ( Deterministic Rust/C code ) with latency under 1ms.

Depending on the use case the P95 TTFT target could range from sub 200ms to many seconds. An interactive system such as real-time voice or interactive messaging feels snappy with TTFT above a second, whereas tool orchestration/long runing batch jobs TTFT is less of a concern when the throughput matters more. Pick your battles depending on the use case
alt text

Above is a LLM serving pipeline TTFT snapshot with under a 400ms p50 and under a second p99 latency which is within the acceptable range for interactive workloads.

Time Per Output Token / Inter Token Latency ( TPOT / ITL )

This is the latency between each subsequent token generated until the model’s response ends.

First token emitted                                         Response ends
	│                                                           | 
	▼                               .- Detokenization --------. | 
                                    |                         | ▼ 
	├─── Decode token 1 ───┼─── Decode token 2 ───┼─── ...  ───┼───┤
	│                      │                      │            │   │
	└──────────────────────┴──────────────────────┴────────────┴───┘
	◄─── ITL / TPOT ──────►◄─── ITL / TPOT ──────►
	◄────────────────────── Generation / Decode Phase ──────────►

As opposed to TTFT ( which is compute bound ), TPOT is memory bound. During decoding, the model generates one token at a time. Each step reads model weights and active KV-cache entries from accelerator memory. As a result, memory bandwidth and cache capacity often limit generation speed before compute capacity is fully used.

Below is a grafana snapshot from a kserve / vLLM serving setup alt text

End-to-end latency

The time from a request arriving until the complete response is available. For a streamed response, this includes queueing, tokenization, prompt prefill, decoding every output token, and any finalization or network delay after the last token. For a response with $N$ output tokens, a useful approximation is:

$$
T_{\text{end-to-end}} \approx \text{TTFT} + (N - 1) \times \text{average TPOT} + \text{finalization overhead}
$$

This makes output length part of the latency story: two requests with identical TTFT and TPOT can have very different completion times if one generates many more tokens. This output variability is not a typical concern in traditional web-serving workloads ( assuming reliable runtime, & tail latency optimized ), but does make a significant difference in LLM workloads ( in worst case scenarios the imbalance can surpass 1:1000 ).

Token Throughput

This metric provides the overall serving capacity when measured across the system ( Multi node/ GPU setup ) and potential bottleneck GPUs when measured per GPU. Below is a snapshot of token throughput on a GPU responding to a request after an idle period. alt text

Token throughput should be considered alongside requests per second; a high request rate can consist of many short exchanges, while a lower request rate can still drive substantial token throughput with long prompts or generations.

  • A related metric token Goodput is the throughput that meets the latency SLOs ( i.e Qualifying tokens/sec ). The ratio between token goodput and throughput is a good indicator of whether to start investigating bottlenecks in TPOT

Hardware Utilization

  • Mechanical sympathy is a hard requirement when working with GPUs and oversimplified metrics such as GPU utilisation is a shallow indicator into system efficiency. Additonally, hardware utilisation analysis requires distinguishing hardware telemetry ( GPU Metrics ) from engine/serving telemetry ( vLLM, SGLang etc.. ) and interpreting them across the two distinct phases of generation; prefill (compute-heavy) and decode (memory-bandwidth-heavy autoregressive process).

Model FLOPs utilisation ( MFU )

  • Measures how effectively the raw GPU compute capability ( Theoretical peak floating-point compute capacity ) ise used for actual model compute. First introduced in 2022 paper https://arxiv.org/abs/2204.02311 ( a good read ) $$\text{MFU} = \frac{\text{Achieved Useful Model FLOPs/s}}{\text{Peak Hardware FLOPs/s}}$$ Larger bathes/optimized batching strategy ( continuous batching ), longer prompts ( high prefill to decode ratio ), avoiding stall ( eg. high prefix cache hit rate ), fused kernels, cuda graphs help improve MFU conversely memory stalls, idle time, small batch sizes, upstream bottlenecks ( slow tokenisation, network I/O, KV Offload stalls ) hurt MFU.

## KV-Cache

  • Prefix cache is formed during the prefill phase. During prefill, the model processes input tokens in parallel and stores their computed key-value (KV) attention states. Inference engines like vLLM retain these KV blocks so later requests with an identical starting sequence can reuse them

KV-Cache Utilisation

Percentage of KV-cache blocks/pages currently occupied by active sequences. A healthy KV-cache utilization rate in LLM inference is below 80%. Sufficient memory headroom is important to avoid active requests triggerring preemptions, evictions, or out-of-memory errors.

KV-Cache Hit Rate

Percentage of input tokens served from previously computed attention states fetched from memory rather than recomputed. Higher hit rates reduce time-to-first-token (TTFT). A typical setup achieves 50-60% Hit rate, while highly optimized setups with repetitive agentic workload could reach 80%.

KV-Cache Preemptions / Swaps

Measures scheduler has to evict a running sequence (or swap/offload blocks to host RAM/SSD) because KV blocks ran out mid-generation ( vllm:num_requests_swapped / preemptions )

HBM Bandwidth Utilization

  • Percentage of time over the sampling interval during which the GPU’s memory controller / memory copy engines (such as reading/writing device memory / HBM) were actively transferring data. Typically measured using DCGM_FI_DEV_MEM_COPY_UTIL available through DCGM telemetry. During decode, generating each new token reads model weights and growing KV-cache entries from HBM with relatively low arithmetic intensity. High DCGM_FI_DEV_MEM_COPY_UTIL paired with lower MFU/Tensor Core utilization indicates HBM bandwidth is gating token generation speed.

Cost per 1M Input / Output Tokens

Inference Unit Economics to tie cost to output & traffic, often expressed per token

  • Track input (prefill) and output (decode) separately because output generation is typically much more expensive per token on memory-bandwidth-bound GPUs.

Cost per Request / Session / Agentic Task

  • Essential when a single user workflow triggers multiple LLM calls, tool executions, or retrieval steps.

Effective Cost per Useful Token

  • Adjusts token spend for retries, timeouts, failed/aborted streams, or rejected speculative tokens so wasted compute isn’t hidden.

Idle & Wasted GPU Cost ($/hr)

  • Spend on allocated GPUs that are sitting idle, under-utilized during off-peak hours, or over-provisioned for headroom/scale-down lag.

Tokens per Watt-Hour (tok/kWh)

  • Direct energy-efficiency metric for comparing model sizes, quantization (FP8/INT8 vs. BF16), batching strategies, or engines (vLLM, SGLang, TensorRT-LLM).
  • A typical signal to measure is DCGM_FI_DEV_TOTAL_ENERGY_CONSUMPTION

Energy per Model FLOP (J / GFLOP or J / TFLOP)

  • Normalizes energy against useful model compute delivered.

GPU Hardware & Driver Faults (DCGM_FI_DEV_XID_ERRORS, ECC errors, thermal/power throttling)

Xid errors, double-bit ECC errors (DBE), or NVLink/PCIe errors can silently or overtly degrade a single GPU inside a multi-GPU replica—requiring drain/cordon or node replacement.


more posts in ~/blog