How automatic prefix caching works in vLLM: block hashes, reference counts, and eviction policy
vLLM turns each complete KV block into a content-addressed cache entry using `hash(prefix_tokens + block_tokens)` — this removes the need for a tree of shared prefixes and lets the engine evict blocks with refcount 0 using LRU-style policy, but partial blocks and advanced attention patterns are deliberate edge cases the design leaves for later.