<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Laura J on Medium]]></title>
        <description><![CDATA[Stories by Laura J on Medium]]></description>
        <link>https://medium.com/@laurajor?source=rss-3e35044ccf4f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*QD4eAUX-ZIevVaxR</url>
            <title>Stories by Laura J on Medium</title>
            <link>https://medium.com/@laurajor?source=rss-3e35044ccf4f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 02:15:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@laurajor/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Basics of KV cache]]></title>
            <link>https://medium.com/@laurajor/the-basics-of-kv-cache-13acce0be46b?source=rss-3e35044ccf4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/13acce0be46b</guid>
            <category><![CDATA[nutanix]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Laura J]]></dc:creator>
            <pubDate>Thu, 23 Apr 2026 16:47:47 GMT</pubDate>
            <atom:updated>2026-04-23T16:47:47.196Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oLQBeVoyo0DetwP2dgVzPg.png" /><figcaption>Gemini’s abstract representation of KV cache</figcaption></figure><h3>Introduction</h3><p>In Nutanix Enterprise AI 2.6, one of the key features introduced in Tech Preview was <strong>KV cache-aware routing</strong>, which improves performance by routing to a GPU that already has the required data in its KV cache, therefore eliminating the need to recompute. But what exactly is a KV cache? Where does it live, what is it storing, and what are the challenges?</p><h3>What exactly is a KV cache?</h3><p>LLMs are inherently stateless. They have no natural memory. Every time an LLM generates a new word, it has to re-read the entire conversation to understand the context.</p><p>As the model processes words (tokens), it calculates <strong>Keys (K)</strong> and <strong>Values (V)</strong> — mathematical representations of how words relate to each other. Without a cache, the model would recalculate the math for every previous word from scratch. With a cache, the inference engine saves those K and V tensors in the GPU’s memory. (A tensor is a multi-dimensional array used as the fundamental data structure for representing and processing data.) When generating the next word, it simply retrieves the previous context from the cache instead of re-computing it.</p><h3>What is KV cache-aware routing?</h3><p>KV cache is all well and good until you go beyond a single GPU. In a world of massive scale, we don’t just use one GPU, we use clusters of them.</p><p>Imagine you are working on a long legal document. GPU #1 has the KV cache for that document stored in its RAM. If your next question is routed to GPU #2, that GPU has no idea what happened before. It has to re-process the entire document to “learn” the context, causing a massive delay and wasting electricity.</p><p>This is where <strong>KV cache-aware routing</strong> comes in.</p><p>When interacting with an LLM, the prompt consists of more than just your query. The system instructions, relevant context (from a RAG system, for example), and the previous input and output text are also sent as context so that the LLM can refer to them. For every subsequent prompt, the prompt is now [historical context] + [new query]. That historical context is essentially the <strong>prefix </strong>of your prompt.</p><p>Instead of a “blind” load balancer sending your request to any random worker, an aware router uses content hashing. It looks at your prompt, identifies the prefix, identifies which GPU worker contains that specific prefix (or closest match) in its cache, and then sends your request to that GPU.</p><h3>Challenges with KV cache</h3><p>As the historical context gets longer, the cache gets bigger and bigger, and can eventually fill up your GPU memory. To resolve this, the inference engine (e.g. vLLM) will start evicting parts of the cache. Other options to resolve are to reduce the prompt length or context window (lowering LLM performance), or add more GPUs (expensive).</p><h3>KV cache offloading</h3><p>The answer to the challenge outlined above is <strong>KV cache offloading. </strong>This is a technique where the KV cache is moved from expensive, limited GPU VRAM to larger, cheaper storage like CPU RAM or even an SSD. Inference engines such as vLLM or llama.cpp have built-in flags to enable offloading of KV cache blocks to CPU RAM, local NVMe/SSD, or other GPUs.</p><p>In large-scale deployments, offloading at the individual inference node level can be a bottleneck. This is where offloading to remote shared storage comes into play, and software such as LMCache can be leveraged. It introduces the ability to offload and share KV caches across multiple storage tiers.</p><p>However, there is a trade-off. If the storage bandwidth is slower than the time it would take the GPU to recalculate the tokens, then offloading doesn’t make sense. The underlying file system must provide high-throughput and low-latency access.</p><p>For an in-depth technical deep dive into these topics, please check out the blog series “How LMCache and Nutanix Files Storage Tame LLM Inference Costs at Scale” written by Jesse Gonzalez:</p><ul><li><a href="https://next.nutanix.com/community-blog-154/context-overload-of-the-gpu-kind-how-lmcache-and-nutanix-files-storage-tame-llm-inference-costs-at-scale-part-1-45411?tid=45411&amp;fid=154">https://next.nutanix.com/community-blog-154/context-overload-of-the-gpu-kind-how-lmcache-and-nutanix-files-storage-tame-llm-inference-costs-at-scale-part-1-45411?tid=45411&amp;fid=154</a></li><li><a href="https://next.nutanix.com/community-blog-154/context-overload-of-the-gpu-kind-how-lmcache-and-nutanix-files-storage-tame-llm-inference-costs-at-scale-part-2-45412?tid=45412&amp;fid=154">https://next.nutanix.com/community-blog-154/context-overload-of-the-gpu-kind-how-lmcache-and-nutanix-files-storage-tame-llm-inference-costs-at-scale-part-2-45412?tid=45412&amp;fid=154</a></li><li><a href="https://next.nutanix.com/community-blog-154/context-overload-of-the-gpu-kind-how-lmcache-and-nutanix-files-storage-tame-llm-inference-costs-at-scale-part-3-45413?tid=45413&amp;fid=154">https://next.nutanix.com/community-blog-154/context-overload-of-the-gpu-kind-how-lmcache-and-nutanix-files-storage-tame-llm-inference-costs-at-scale-part-3-45413?tid=45413&amp;fid=154</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13acce0be46b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>