Skip to content
inference.academy

glossary/serving/kv-cache-aware-routing

KV-cache-aware routing

also prefix-aware routing, cache-aware load balancing, KV router

A load balancer that knows which replica's memory holds which prefixes, and routes a request to the one with the longest match instead of the next one in line. Prefix caches are per replica, so a router that spreads a session's turns evenly across N replicas finds the cached history about one time in N. Sticky sessions fix that and cannot rebalance. Cache-aware routers, SGLang's router, NVIDIA Dynamo's KV router, the Kubernetes inference gateway and llm-d, keep an index of prefixes per worker and fall back to the shortest queue when load drifts past a threshold.


11% to 93%

Prefix cache hit rate on eight replicas under round-robin against prefix-aware routing, measured by llm-d on Qwen2.5-7B; mean time to first token fell from 19 seconds to under one.


See it happen


Related