<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Token Factory | KVCache.AI</title>
    <link>https://kvcache.ai/tag/token-factory/</link>
      <atom:link href="https://kvcache.ai/tag/token-factory/index.xml" rel="self" type="application/rss+xml" />
    <description>Token Factory</description>
    <generator>Hugo Blox Builder (https://hugoblox.com)</generator><language>en-us</language><lastBuildDate>Tue, 15 Sep 2026 00:00:00 +0000</lastBuildDate>
    <image>
      <url>https://kvcache.ai/media/logo.svg</url>
      <title>Token Factory</title>
      <link>https://kvcache.ai/tag/token-factory/</link>
    </image>
    
    <item>
      <title>Over One Trillion Tokens per Day: How Mooncake Powers Approaching.AI’s Token Factory</title>
      <link>https://kvcache.ai/blog/mooncake-in-approaching-ai/</link>
      <pubDate>Tue, 15 Sep 2026 00:00:00 +0000</pubDate>
      <guid>https://kvcache.ai/blog/mooncake-in-approaching-ai/</guid>
      <description>&lt;p&gt;This article was contributed by &lt;strong&gt;Approaching.AI&lt;/strong&gt;, sharing how it uses &lt;strong&gt;Mooncake&lt;/strong&gt; to build large-scale LLM inference infrastructure that reliably produces more than one trillion tokens per day with trillion-parameter models.&lt;/p&gt;
&lt;h2 id=&#34;prologue&#34;&gt;Prologue&lt;/h2&gt;
&lt;p&gt;Whoever can turn the same compute resources into more AI tokens, with higher quality and greater reliability, has greater AI productivity. As agents evolve from single-turn question answering to continuous planning, tool use, and multi-turn execution, token demand is shifting from sporadic API calls to sustained, large-scale production. In its production deployment of leading trillion-parameter models, Approaching.AI now consistently produces more than one trillion high-quality AI tokens per day. Since February 2026, average token production efficiency per node has improved more than threefold, while total production capacity has grown more than thirtyfold. Behind this large-scale production is a series of system-level optimizations spanning inference engines, scheduling, caching, and infrastructure, with Mooncake playing a key role.&lt;/p&gt;
&lt;h2 id=&#34;background&#34;&gt;Background&lt;/h2&gt;
&lt;p&gt;The costs of a token factory are relatively fixed: spending on hardware purchases and rentals, electricity, data centers, and networking is largely fixed, while revenue depends on &lt;strong&gt;token output × price per token&lt;/strong&gt;. The price per token, in turn, is directly tied to service quality: metrics such as TTFT, TPOT, and reliability determine whether those tokens can be delivered at a high standard.&lt;/p&gt;
&lt;p&gt;Our goal is therefore clear: &lt;strong&gt;maximize system throughput and token output per unit of compute while strictly meeting SLOs.&lt;/strong&gt; In other words, no performance optimization can come at the expense of SLOs.&lt;/p&gt;
&lt;p&gt;The rapid growth of agentic workloads makes this tension even more pronounced. Coding agents, multi-turn reasoning, and tool calls repeatedly reuse long contexts. KV cache hits can substantially reduce prefill computation, whereas a single cache miss can mean recomputing hundreds of thousands of tokens. Beyond wasting compute, this can significantly increase response times and even block normal responses to other requests.&lt;/p&gt;
&lt;p&gt;At Approaching.AI, this is already a trillion-token-scale problem. Our production inference system must reliably produce &lt;strong&gt;more than one trillion tokens every day&lt;/strong&gt;. At this scale, even wasting just a few percent of compute can translate into enormous infrastructure costs. In a trillion-token-scale factory, the KV cache is no longer merely an optional, local optimization; it has become critical infrastructure that affects overall production capacity and cost.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A major challenge we face is how to turn the KV cache from a per-node resource into a shared, cluster-wide resource, improving cache hit rates and system throughput while still meeting strict SLOs.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&#34;from-local-caching-to-global-kv-cache-pooling&#34;&gt;From Local Caching to Global KV Cache Pooling&lt;/h2&gt;
&lt;p&gt;The KV cache becomes even more valuable in agentic and long-context scenarios. But relying solely on GPU HBM creates an inherent trade-off for KV cache reuse: allocating too little cache space lowers hit rates and forces extensive recomputation of historical context; allocating too much consumes GPU memory needed to process requests, reducing the efficiency of new-token computation. This trade-off is especially pronounced with extremely long contexts.&lt;/p&gt;
&lt;p&gt;We therefore first introduced &lt;strong&gt;SGLang HiCache&lt;/strong&gt; into production, adding higher-capacity host DRAM to the KV cache hierarchy. This significantly increased both available KV cache capacity and hit rates without materially affecting GPU compute efficiency.&lt;/p&gt;
&lt;p&gt;However, as the system expanded to more than one trillion tokens per day, the limits of per-node caching quickly became apparent.&lt;/p&gt;
&lt;p&gt;On the one hand, a single node&amp;rsquo;s DRAM capacity is ultimately limited, and duplicate KV cache data scattered across different nodes cannot be shared. On the other hand, for certain KV cache structures, the HiCache architecture at the time stored separate copies on multiple TP ranks within the same node, resulting in up to eightfold data redundancy on a single node. These issues left cache hit rates well below the ideal.&lt;/p&gt;
&lt;p&gt;More importantly, &lt;strong&gt;per-node local caching effectively binds the location of the KV cache to the location where a request executes.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When most of the KV cache for a session’s requests resides only on specific prefill nodes, reusing that cache requires routing the session’s subsequent requests back to those same nodes. As a result, scheduling decisions that should otherwise be driven by real-time load, request characteristics, and resource availability become constrained by where the cache resides.&lt;/p&gt;
&lt;p&gt;In other words, if the KV cache remains private to each node, cache reuse and cluster scheduling are coupled: &lt;strong&gt;every expansion of the scheduler&amp;rsquo;s set of choices may come at the cost of lower cache hit rates, more recomputation, or even SLO violations.&lt;/strong&gt; As the cluster grows, this coupling limits not only the benefits of resource pooling but also the design space for scheduling algorithms. It becomes difficult to move requests flexibly in response to real-time conditions such as traffic fluctuations and node failures, or to make finer-grained scheduling decisions based on context length, cache hits, compute characteristics, and the hardware characteristics of different compute nodes.&lt;/p&gt;
&lt;p&gt;Consider load balancing. To improve hit rates, continuously routing requests with the same prefix to a small number of prefill nodes can occasionally concentrate popular requests on a single node. Requests then accumulate and queue on that node, violating the TTFT SLO. But moving requests to other nodes to alleviate the hotspot triggers substantial recomputation because the KV cache cannot be reused across nodes. During peak periods, this may even spread the pressure to the new nodes.&lt;/p&gt;
&lt;p&gt;For a trillion-token-scale factory, this is no longer just a matter of a few percentage points in cache hit rate. It is a system-level issue that directly affects &lt;strong&gt;cluster scheduling flexibility, peak throughput capacity, resilience to failures, and the ability to meet SLOs&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;We therefore introduced &lt;strong&gt;Mooncake Store&lt;/strong&gt; to pool the KV cache previously distributed across individual nodes into a shared, cluster-wide resource.&lt;/p&gt;
&lt;p&gt;We aimed to achieve three things simultaneously:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Further improve KV cache hit rates;&lt;/li&gt;
&lt;li&gt;Remove the constraints that KV cache placement imposes on cluster scheduling;&lt;/li&gt;
&lt;li&gt;Avoid introducing additional performance overhead or system risks into the inference critical path.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Architecturally, SGLang HiCache together with Mooncake Store naturally addresses the first two goals. The real challenge lies in the third: a cache system must be fast and stable enough that it never slows down, or even brings down, the inference system.&lt;/strong&gt; This has been the central engineering challenge over the past six months as we pushed Mooncake into trillion-token-scale production environments.&lt;/p&gt;
&lt;p&gt;Below, we first describe the overall deployment architecture, then explain how we addressed these core challenges.&lt;/p&gt;
&lt;h2 id=&#34;sglang--mooncake-in-production-architecture-and-practice&#34;&gt;SGLang + Mooncake in Production: Architecture and Practice&lt;/h2&gt;
&lt;p&gt;Once the KV cache becomes a shared, cluster-wide resource rather than a per-node resource, it is no longer just a caching system, but something that must be co-designed with compute, networking, and scheduling.&lt;/p&gt;
&lt;h3 id=&#34;architecture-overview&#34;&gt;Architecture Overview&lt;/h3&gt;
&lt;p&gt;















&lt;figure  &gt;
  &lt;div class=&#34;flex justify-center	&#34;&gt;
    &lt;div class=&#34;w-100&#34; &gt;&lt;img alt=&#34;The HiCache &amp;#43; Mooncake Store Architecture within a PD Group&#34; srcset=&#34;
               /blog/mooncake-in-approaching-ai/featured_hue86b549ecdd836b0c6b3aa760df33338_1244829_dafc6f29bffbe42a0d23742f341eba12.webp 400w,
               /blog/mooncake-in-approaching-ai/featured_hue86b549ecdd836b0c6b3aa760df33338_1244829_4a038a73cc49576daab07be231e51efa.webp 760w,
               /blog/mooncake-in-approaching-ai/featured_hue86b549ecdd836b0c6b3aa760df33338_1244829_1200x1200_fit_q85_h2_lanczos_3.webp 1200w&#34;
               src=&#34;https://kvcache.ai/blog/mooncake-in-approaching-ai/featured_hue86b549ecdd836b0c6b3aa760df33338_1244829_dafc6f29bffbe42a0d23742f341eba12.webp&#34;
               width=&#34;760&#34;
               height=&#34;428&#34;
               loading=&#34;lazy&#34; data-zoomable /&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;Approaching.AI&amp;rsquo;s production inference system consists of multiple groups, each containing several GPU nodes and using RDMA for high-speed KV cache transfers. Requests are first distributed at the gateway layer, then routed to a specific group according to a routing policy. The following discussion focuses on how SGLang + Mooncake is deployed within a single group.&lt;/p&gt;
&lt;p&gt;Within each group, we use a disaggregated prefill-decode deployment and enable HiCache only on prefill nodes. This is because the main computational cost of long-context requests lies in the prefill phase, where cache hits directly eliminate substantial recomputation before the first token is generated. The decode phase prioritizes stable, low-latency, token-by-token generation, so we focus on keeping the decode path simple and stable.&lt;/p&gt;
&lt;h3 id=&#34;mooncake-store-turning-node-memory-into-a-shared-kv-cache-pool&#34;&gt;Mooncake Store: Turning Node Memory into a Shared KV Cache Pool&lt;/h3&gt;
&lt;p&gt;Mooncake Store runs as an independent Store Service on all prefill and decode nodes.&lt;/p&gt;
&lt;p&gt;On decode nodes, host memory is primarily used by Mooncake Store; on prefill nodes, memory is shared between HiCache and Mooncake Store. This organizes DRAM previously scattered across nodes into a larger distributed KV cache pool, providing the foundation for cross-node reuse.&lt;/p&gt;
&lt;p&gt;The Mooncake client embedded in HiCache on each prefill node is configured not to contribute storage to the global cache. Instead, separate Store Service processes provide that storage, decoupling the inference engine from the cache system so that each can be upgraded or scaled independently. To account for the NUMA topology of our servers, each of which has two NUMA nodes, we pin one Mooncake Store Service to each NUMA node. This preserves NUMA affinity for local KV cache access and network transfers as much as possible, reduces cross-NUMA access overhead, and fully utilizes the topology-aware transfer capabilities of Mooncake Transfer Engine.&lt;/p&gt;
&lt;p&gt;On the control plane, Mooncake Master is configured with three replicas—one primary and two standbys—deployed across three GPU nodes. The etcd service that Mooncake depends on also uses three replicas and runs on dedicated CPU nodes alongside other cluster management components.&lt;/p&gt;
&lt;h3 id=&#34;cluster-scheduling-with-smg&#34;&gt;Cluster Scheduling with SMG&lt;/h3&gt;
&lt;p&gt;A shared KV cache alone is not enough. Cache pooling expands the set of nodes to which requests can be scheduled, but the scheduler still needs to make sound decisions that balance cache locality, real-time load, node health, and request characteristics. For example, pursuing cache locality solely to reduce cross-node network transfers can repeatedly send requests with the same prefix to a small number of prefill nodes, eventually creating hotspots. Focusing only on load balancing, however, can frequently move requests to nodes with colder caches, increasing remote accesses or even recomputation.&lt;/p&gt;
&lt;p&gt;Our intra-group request scheduling is based on &lt;strong&gt;SMG (SGLang Model Gateway)&lt;/strong&gt;, with improvements tailored to production conditions. On the prefill side, the scheduler considers information such as HiCache&amp;rsquo;s local hit rate, real-time node load, node health, and request characteristics. While meeting SLOs, it seeks to maximize overall system throughput and reduce request TTFT.&lt;/p&gt;
&lt;p&gt;On the decode side, where the focus is on throughput and stable tail latency during ongoing generation, the scheduler distributes generation load as evenly as possible across multiple decode instances.&lt;/p&gt;
&lt;h3 id=&#34;production-orchestration-with-rbg&#34;&gt;Production Orchestration with RBG&lt;/h3&gt;
&lt;p&gt;At the Kubernetes layer, we use &lt;strong&gt;RBG (RoleBasedGroup)&lt;/strong&gt; to manage SGLang and Mooncake workloads together. RBG provides topology definitions and coordination policies for different application roles, allowing prefill, decode, Mooncake Store, and other roles to be deployed and managed as a unit. As a foundational metadata component, etcd runs independently and is not managed by RBG.&lt;/p&gt;
&lt;h2 id=&#34;bringing-mooncake-to-a-trillion-token-scale-factory&#34;&gt;Bringing Mooncake to a Trillion-Token-Scale Factory&lt;/h2&gt;
&lt;p&gt;To bring Mooncake into a production environment generating more than one trillion tokens per day, the central question was not just whether the KV cache could be shared, but &lt;strong&gt;whether Mooncake could keep pace with the token factory&amp;rsquo;s exceptionally demanding performance and stability requirements&lt;/strong&gt;. SGLang HiCache + Mooncake Store addresses cache hit rates and cross-node scheduling at the architectural level, but only if this cache infrastructure is sufficiently fast and stable to avoid introducing new performance overhead or system risks into the inference path.&lt;/p&gt;
&lt;p&gt;Since February 2026, Approaching.AI&amp;rsquo;s average AI token production efficiency per node has improved more than threefold, and total token production capacity has grown more than thirtyfold. KV cache hit rates have also improved significantly, remaining consistently above 90%. This means Mooncake must handle KV cache throughput that has increased severalfold on each node while continuing to expand the number of inference nodes a single cluster can support. &lt;strong&gt;Every improvement in token production efficiency at the application layer demands a corresponding advance in the underlying cache system. Over the past six months, this has been the “sword of Damocles” hanging over our production optimization of Mooncake.&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id=&#34;fast-data-retrieval-hiding-remote-kv-cache-reads-behind-computation&#34;&gt;Fast Data Retrieval: Hiding Remote KV Cache Reads Behind Computation&lt;/h3&gt;
&lt;p&gt;KV cache reuse primarily occurs during prefill. For a prefill request, HiCache first checks the local cache. For local misses, it queries Mooncake Master via RPC to retrieve metadata for the corresponding KV cache, then uses RDMA to fetch available data in parallel from multiple Mooncake Store nodes. Only after the data is ready does the request proceed to the GPU for the remaining prefill computation. Once prefill completes, newly computed KV cache data that does not yet exist in Mooncake is written back to Store for reuse by subsequent requests. As KV cache data is continuously written, Mooncake Master must also continuously maintain metadata and perform LRU eviction.&lt;/p&gt;
&lt;p&gt;For production inference, retrieval speed is critical. HiCache asynchronously initiates remote KV cache prefetching as early as possible after a request enters the scheduling queue, overlapping network transfers with computation already running on the GPU. Mooncake therefore needs to ensure that &lt;strong&gt;KV cache retrieval is hidden as much as possible behind the execution time of preceding requests&lt;/strong&gt;. As long as remote data is ready before the GPU begins processing the current request, the additional overhead Mooncake Store imposes on the inference engine is almost imperceptible. Conversely, if data retrieval falls behind the scheduling cadence, the GPU must wait for the KV cache to arrive, and the cache system creates new idle time and TTFT overhead.&lt;/p&gt;
&lt;p&gt;Mooncake&amp;rsquo;s batched-read data path is straightforward: a single Master RPC query locates the cached data, followed by direct parallel RDMA reads from multiple Store nodes. Read performance therefore depends primarily on two factors: Master RPC query latency and throughput, and RDMA transfer efficiency, which in turn depends on both network bandwidth and Transfer Engine performance. Our production deployments typically use high-performance 800 Gbps NICs. Combined with Transfer Engine&amp;rsquo;s architectural strengths, such as multi-NIC pooling and topology-aware path selection, this means we have not observed RDMA data transfers becoming the primary performance bottleneck under our current production network configuration and workload characteristics. After optimizing the first factor, average latency for batched KV cache read requests in production is below 50 milliseconds, with the vast majority completing within 100 milliseconds. This keeps remote KV cache reuse off the GPU&amp;rsquo;s critical waiting path as much as possible.&lt;/p&gt;
&lt;h3 id=&#34;scaling-to-larger-clusters&#34;&gt;Scaling to Larger Clusters&lt;/h3&gt;
&lt;p&gt;After pooling the KV cache across the cluster, we wanted each Mooncake cluster to serve as many prefill and decode nodes as possible. Larger groups mean a wider scope for cache reuse, greater capacity to absorb traffic fluctuations, and more room for scheduling and optimization.&lt;/p&gt;
&lt;p&gt;We scaled incrementally rather than attempting to reach the target size in a single step. We first validated stability in small groups, then expanded the scale in a test cluster for long-duration stability testing, continuously monitoring performance and stability bottlenecks. Once issues were resolved, we moved to a production canary rollout, followed by full deployment after confirming stability. We then used that deployment as the basis for expanding to still larger groups. Through this process of staged validation and incremental expansion, we turned cluster scaling itself into a controlled, repeatable engineering process.&lt;/p&gt;
&lt;p&gt;Along the way, we encountered many issues and challenges.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The first was performance bottlenecks in the Master service.&lt;/strong&gt; Data in Mooncake Master is hashed into 1,024 shards, each with its own read-write lock to control concurrent access. As Store cache capacity and concurrent requests increase, Master must handle more frequent metadata queries, while periodically triggered LRU eviction operations also take longer. During eviction, the eviction thread acquires each shard&amp;rsquo;s write lock in turn. If there is too much metadata, it holds the shard&amp;rsquo;s write lock for an extended period, blocking read and write requests and significantly increasing request latency during eviction.&lt;/p&gt;
&lt;p&gt;We addressed this in two ways: improving eviction efficiency and reducing lock contention between eviction and read/write requests. For the former, we substantially reduced overhead from string copies, object construction, and memory allocation. We also enhanced the write mechanism to allow multiple ranks of the inference engine to write to different offsets within the same object, greatly reducing the number of cached objects. For the latter, we first moved time-consuming operations such as replica destruction and memory deallocation out of the write-lock critical section during eviction, shortening the time the lock is held. We then further refined locking from shard granularity to object granularity, substantially reducing contention.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The second was scaling performance.&lt;/strong&gt; When a Store node comes online, it must allocate several terabytes of memory and register that memory with multiple RDMA NICs. When it goes offline, the memory must be deregistered from those NICs and freed. This process is very time-consuming. We optimized memory initialization and RDMA registration, achieving severalfold performance improvements, then added huge page support to further reduce the time spent on memory allocation, registration, deregistration, and deallocation.&lt;/p&gt;
&lt;p&gt;On the Master side, taking a Store node offline previously required traversing all shards to remove the metadata associated with that node. Otherwise, subsequent requests would attempt to read data from the offline node and fail. With large amounts of metadata, this process could take a long time, significantly delaying node removal. We addressed this by splitting node removal into two phases: “synchronous invalidation, asynchronous cleanup.” We first remove the segment from the allocation pool and mark it as going offline, preventing subsequent requests from attempting to read or write the node&amp;rsquo;s data. A background thread then cleans up the metadata. This reduced the time needed for Master to complete a node-removal request to milliseconds.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The third was networking issues during KV cache transfers.&lt;/strong&gt; Most of our clusters use RoCE networking with RTT-based congestion control enabled. Mooncake-based prefill-decode disaggregation and KV cache reuse generate substantial KV cache transfer traffic. In production, we observed frequent all-to-all microbursts with incast, visible spikes in ECN/CNP packets, and increased PFC counters caused by congestion within servers. After long-term monitoring and testing, however, we concluded that these phenomena do not significantly affect KV cache transfer speeds or production metrics such as TTFT, and do not impact inference cluster throughput.&lt;/p&gt;
&lt;p&gt;For KV cache transfers, network stability and jitter in production deserve more attention than network performance itself. We found that many failures were unrelated to the Mooncake Transfer Engine implementation and instead stemmed from cluster configuration. For example, OVS configuration, routing configuration, IOMMU configuration, inconsistencies in NIC firmware and drivers, and Kubernetes networking failures can all cause Mooncake Transfer Engine errors. Troubleshooting RDMA network errors therefore requires investigating potential failure points across the entire path, rather than focusing solely on connectivity tests such as nccl-tests.&lt;/p&gt;
&lt;h3 id=&#34;cluster-stability-and-safety-containing-the-blast-radius-of-failures&#34;&gt;Cluster Stability and Safety: Containing the Blast Radius of Failures&lt;/h3&gt;
&lt;p&gt;For large-scale inference clusters, performance determines the system&amp;rsquo;s upper limit, while stability determines whether that limit can be confidently used in production.&lt;/p&gt;
&lt;p&gt;As clusters grow, hardware failures, network jitter, process errors, and configuration mistakes gradually shift from rare events to everyday occurrences. Mooncake Store also sits on the shared KV cache data path: if cache system failures propagate to the inference engine, an issue confined to a single Store node, NIC, or transfer link can escalate into blocked requests, TTFT fluctuations, or even reduced availability across the entire inference cluster.&lt;/p&gt;
&lt;p&gt;During the early stages of deploying Mooncake, we therefore took a conservative approach to stability: &lt;strong&gt;the distributed KV cache service may become temporarily unavailable, but it must not disrupt the inference service itself; local failures may occur, but they must not escalate into cluster-wide failures.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Following this principle, we added safeguards for cluster isolation, network isolation, timeouts and circuit breaking, and data allocation policies. Some of these measures were deliberately overcautious during the initial rollout. As Mooncake and the cluster network environment become more stable, they can be simplified or removed as appropriate based on operational experience. During rapid system expansion, however, these mechanisms helped us control the risks and failure blast radius introduced by new infrastructure.&lt;/p&gt;
&lt;p&gt;First, instead of having all inference nodes share one enormous Mooncake Store cluster, we retained the inference system&amp;rsquo;s group boundaries and deployed an independent Mooncake Store cluster in each group. Cache services are isolated across groups. Even if an entire group&amp;rsquo;s Mooncake Store becomes unavailable, the impact remains confined to that group and does not affect KV cache services in other groups. This sacrifices some potential benefits of cross-group cache sharing, but provides clearer failure domains and makes canary upgrades, scaling, and failure handling more controllable.&lt;/p&gt;
&lt;p&gt;Second, we further isolated the network resources used by Mooncake. In production, prefill-decode disaggregation already requires RDMA transfers between prefill and decode nodes, while Mooncake Store introduces another substantial stream of KV cache read and write traffic. If both traffic types fully share the same NICs and Transfer Engine, abnormal traffic, resource contention, or a Transfer Engine failure on either side could affect the other. During the initial rollout, we therefore assigned dedicated NICs to Mooncake Store and used separate Transfer Engine instances for Store and prefill-decode disaggregation, breaking failure propagation paths at both the data-plane and software-instance levels as much as possible.&lt;/p&gt;
&lt;p&gt;An even more important safeguard comes from &lt;strong&gt;timeouts and circuit breaking&lt;/strong&gt;. HiCache already provides a read timeout mechanism: when a KV cache read from Mooncake exceeds a configurable threshold, HiCache stops waiting for unfinished transfers, uses only the cache data already retrieved successfully, and recomputes the remainder. This ensures that even a remote read with long-tail latency does not block prefill computation.&lt;/p&gt;
&lt;p&gt;On top of this, we added a &lt;strong&gt;Mooncake Store cluster-level circuit breaker&lt;/strong&gt;. When the system detects persistent errors or unavailability in a Store cluster, it can automatically disconnect HiCache from Mooncake Store, temporarily falling back to local-only KV caching so that inference can continue.&lt;/p&gt;
&lt;p&gt;We also specifically optimized the KV cache data allocation policy to reduce the blast radius of a single-node failure. Under Mooncake&amp;rsquo;s default allocation policy, KV cache data is assigned to Store nodes at random, scattering a long request&amp;rsquo;s KV cache across almost all nodes. If any node fails and a block in the middle of the KV cache is lost, subsequent cached blocks can no longer be used for prefix reuse even if they remain available, amplifying the impact of the failure. Random remote writes also increase cross-node network overhead and latency. We therefore implemented a new allocation policy: when writing KV cache data, Mooncake prefers the local Store. If local space is insufficient, it tries other nodes in a deterministic order. The order remains consistent for a given writer node, keeping a request&amp;rsquo;s KV cache concentrated on the first few candidate nodes as much as possible. Different writer nodes use different orders to maintain load balancing.&lt;/p&gt;
&lt;h2 id=&#34;future-work&#34;&gt;Future Work&lt;/h2&gt;
&lt;p&gt;SGLang HiCache + Mooncake now reliably supports Approaching.AI&amp;rsquo;s production of more than one trillion tokens per day, but there is still room to optimize cache capacity, the scope of cache reuse, and hardware configurations. We will focus on the following directions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Introducing SSDs as a Third Cache Tier.&lt;/strong&gt; In agentic workloads, KV cache lifetimes exhibit a long tail: most cached data quickly becomes obsolete, but a small portion is reused after a much longer interval. Keeping this data in expensive DRAM is not cost-effective. We plan to introduce SSDs as the next cache tier, asynchronously moving cold KV cache data from DRAM to SSDs. This will expand effective cache capacity while controlling costs and further improve KV cache hit rates.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Federated Mooncake: Enabling Cross-Group KV Cache Reuse.&lt;/strong&gt; Our Mooncake Store clusters are currently deployed independently within each group. This architecture clearly isolates failure domains, but it also imposes artificial boundaries on KV cache reuse: even if the same prefix already exists in another group, a request entering a new group cannot reuse it directly. Going forward, we will continue to expand individual groups while also breaking down group boundaries. We plan to retain independent clusters while allowing Mooncake clients to query and read KV cache data across clusters when necessary. This would further improve global cache hit rates and give the router greater scheduling flexibility, so requests would no longer face a strict choice between a cache hit and cross-group scheduling. Cross-group sharing does, of course, introduce more complex metadata management and network traffic control, as well as greater risk of failure propagation. As we expand the scope of KV cache reuse, we must therefore also improve cross-cluster failure isolation and fault tolerance, ensuring that broader sharing does not come at the cost of a larger failure blast radius.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Supporting Heterogeneous Inference Clusters.&lt;/strong&gt; As inference infrastructure evolves, token factories will no longer consist solely of fully homogeneous GPU nodes. We plan to support more flexible heterogeneous deployments, such as using different accelerators for prefill and decode nodes. As shared KV cache infrastructure connecting different compute nodes, Mooncake can further loosen the coupling between inference services and specific compute devices. By further decoupling computation, transfers, and caching, tasks at different stages can be dynamically assigned to the compute resources best suited to the workload&amp;rsquo;s characteristics.&lt;/p&gt;
&lt;h2 id=&#34;acknowledgments&#34;&gt;Acknowledgments&lt;/h2&gt;
&lt;p&gt;We thank the Mooncake and SGLang communities for their generous help and support throughout Approaching.AI&amp;rsquo;s production deployment and ongoing optimization efforts.&lt;/p&gt;
&lt;p&gt;The Mooncake optimizations and improvements discussed in this article are being progressively contributed back to the open-source community.&lt;/p&gt;
&lt;h2 id=&#34;related-links&#34;&gt;Related Links&lt;/h2&gt;
&lt;p&gt;Approaching.AI: &lt;a href=&#34;https://approaching-ai.com/en/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://approaching-ai.com/en/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Mooncake project: &lt;a href=&#34;https://github.com/kvcache-ai/Mooncake&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://github.com/kvcache-ai/Mooncake&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;SGLang project: &lt;a href=&#34;https://github.com/sgl-project/sglang&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://github.com/sgl-project/sglang&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
