DeepSeek Open-Sources Inference Framework DeepInfer, Breaking the LLM Black Box

DeepSeek open-sources DeepInfer, using PD separation, cache reuse, and speculative decoding to slash inference cost and latency.
DeepSeek has open-sourced its large model inference framework DeepInfer, reportedly handling 155 trillion tokens daily, with average first-token latency of 0.4 seconds and 300 tokens per second in coding scenarios. It reached 25,000 GitHub stars in two weeks. DeepInfer manages request queuing, classification, split scheduling, and result merging. Key techniques include PD separation (Prefill and Decode on different machines), cache reuse (about 100 PiB flash cache, 96% hit rate, 50x price difference), small-model draft with large-model verification, and expert parallelism. NVIDIA and Huawei Ascend 950 launch simultaneously. However, core code for cache management, read/write, split scheduling, and load balancing remains closed-source.
DeepSeek has once again flipped the table. This time, what it open-sourced is not another model, but the inference framework that large model companies usually guard most closely—DeepInfer. According to a Bilibili creator, this system handles 155 trillion tokens of requests per day, and within two weeks of open-sourcing, its GitHub stars have surged to 25,000. What exactly it manages, why it is so fast and cheap, and what DeepSeek is aiming for by giving away its family jewels—all of this deserves a closer look.
What DeepInfer Actually Manages
When you ask a question, the request first gets queued and classified, then split into two paths—"graph body" and "graph characters"—and sent to different machines. Only after computation is complete and results are merged do you see the output. DeepInfer manages exactly this pipeline: how long you wait, when the first character appears, and how much electricity is burned—all determined by it.
In other words, the model decides "how well it answers," while the inference framework decides "how fast and how expensive the answer is." In the past, this part was the core secret of cloud vendors and model companies. Now DeepSeekAd has put it on the table.

Two Sets of Numbers Show Its Power
According to data cited by the creator, DeepInfer processes 155 trillion tokens per day; users wait an average of only 0.4 seconds for the first character; in coding scenarios, it outputs 300 tokens per second; and counting only off-peak electricity prices, each card earns $38 per hour. Together, these metrics show that it has achieved quite aggressive levels simultaneously in throughput, latency, and cost.
What truly supports these numbers are the following engineering techniques.
First Move: Separate Machines for Reading and Writing
Reading the question means computing the entire passage from scratch, which consumes compute; writing means flipping through notes for every character emitted, which consumes bandwidth. Just like a restaurant separating prep work from cooking, reading uses ordinary 8-card machines, while writing uses 64- to 128-card supernodes—no one wastes money.

The technical terms for reading and writing are Prefill and Decode—the two stages of large model inference. Prefill feeds the entire user prompt into the model at once, computing the Key/Value cache for each position. It is a compute-intensive task with high GPU utilization but relatively low memory bandwidth pressure. Decode, on the other hand, generates autoregressively token by token; each token generated requires reading the entire historical KV cache, making it memory-access heavy but compute-light—a typical bandwidth bottleneck. The two have completely different hardware requirements, and running them together drags each other down. Therefore, modern inference frameworks generally adopt a PD Disaggregation (Prefill-Decode Disaggregation) architecture, using machines of different specifications to handle each. This is also the technical basis for DeepInfer splitting reading and writing onto two sets of machines.
Second Move: Don't Recompute What's Already Computed
If the beginning of the conversation hasn't changed, previously computed results are directly retrieved. The cache pool is a flash cluster of about 100 PiB: without cache hits, 60,000 tokens per second; with hits, 1.5 million—a 25x difference. Online, 96% of requests hit the cache.
This is exactly why DeepSeek dares to sell cheaply. On the official price list, input with cache hits costs only $0.003, while misses cost $0.15—a 50x difference.

The underlying mechanism of cache reuse is KV Cache. When generating each token, Transformer needs to compute attention based on the Key and Value of all previous tokens. If recomputed every time, the cost grows linearly with context length. Storing these intermediate results for reuse avoids redundant computation. In multi-turn conversations, system prompts and historical turns often remain unchanged, making cache hits extremely beneficial. The industry often refers to this idea as Prefix Caching. The challenge lies in cache addressing and eviction strategies across requests and machines, as well as multi-level caching across GPU memory, RAM, and flash storage. DeepSeek's cache pool as a flash cluster of about 100 PiB is precisely about trading high-capacity, low-cost media for high hit rates, thereby saving the most expensive GPU compute.
Third Move: Small Model Guesses First, Large Model Verifies
Stack a few more moves: a small model guesses first, a large model verifies; 384 experts spread across 64 cards, with hot experts getting extra copies. Ultimately, each card outputs 14,000 tokens per second.
Hardware is equally critical—NVIDIA and Huawei Ascend 950 launch simultaneously, marking the first time domestic data centers get first-hand choice.
This move is called Speculative Decoding in academia. The principle is to first use a small, fast draft model to generate several candidate tokens consecutively, then have the large model verify these candidates in parallel at once, accepting the correct ones and rejecting and correcting the wrong ones. Since verifying multiple tokens costs approximately the same as verifying one, overall generation speed can be significantly improved without changing the output distribution. Variants like Medusa and EAGLE replace the independent draft model with additional prediction heads. The accompanying Expert Parallelism targets MoE architectures: distributing many experts across multiple cards, with hot experts replicated to alleviate load imbalance—a key scheduling technique for sparse large model inference.
Not Everything Handed Over: A Card Kept Close
Interestingly, DeepSeek did not open-source everything. The code for cache management, read/write, split scheduling, and load balancing was not released—only the design concepts.

This is precisely the part of the inference framework closest to business and hardest to replicate. Open-sourcing interfaces and design while retaining core scheduling implementation allows the community to follow along without filling in the moat all at once.
The unopen-sourced cache management, read/write, split scheduling, and load balancing correspond exactly to the parts of an inference framework that most test engineering accumulation. Cache management must handle hit determination, cross-node addressing, capacity eviction, and consistency; split scheduling must decide whether each request goes to Prefill or Decode, which machine it is assigned to, and how to queue and preempt; load balancing must avoid individual cards becoming bottlenecks when expert distribution is uneven and request lengths vary enormously. These logics are deeply coupled with specific hardware topologies, cluster scales, and business traffic patterns—poor in generality and costly to tune—and are often where vendors truly differentiate performance. Publishing only design and interfaces while retaining core implementation is a common boundary in open-source projects.
What DeepSeek Is After
From model weights, training frameworks, operator libraries, and 3FS to today's inference framework, DeepSeek is handing things out one by one. Others lag behind the frontier not just in models, but also in this set of inference skills—now placed directly on the table.
One interpretation is genuine vision: making intelligence affordable for everyone. Another is a grand strategy: bringing Ascend along to grasp industry standards. The two are not mutually exclusive. Open-sourcing an inference framework can rapidly expand ecosystem adoption, and once the ecosystem revolves around DeepInfer's scheduling methods and hardware adaptations, standard-setting power naturally falls to the open-source party.
For developers, the most practical short-term change is: the cost and latency barriers for deploying large model inference have been further lowered, and domestic hardware now has a more mature path to deployment. As for whether this move ultimately benefits others or itself, the answer may only become clear when the next table is flipped.
Related articles

Michael Nielsen Takes Down His Classic Neural Network Textbook, Sparking Community Discussion
Michael Nielsen's classic free textbook Neural Networks and Deep Learning has been taken offline, sparking discussion on Hacker News about the reasons and impact.

Inside the AI Training Data Market: The Trade-off Between Exclusivity and Discounts
G2i founder Gabe Greenberg reveals the dual-track pricing of the AI training data market: labs pay a premium for exclusive data or accept discounts that allow others to buy it.

SessionGraph: Unifying All Coding Agent Sessions in One Interactive Graph
SessionGraph aggregates coding agent sessions into an interactive graph, helping developers review, debug, and manage AI coding workflows across sessions. This article examines its positioning, value, and open questions.