DeepSeek has open-sourced DeepInfer, an inference framework that supports its large-scale AI services. It works with DeepSeek-V4.1-Flash and provides an inference engine that optimizes model execution and workload distribution on NVIDIA GPUs and Huawei Ascend NPUs. DeepSeek has previously released individual compute kernels, but this release extends to the entire framework that manages model execution. However, the public version is centered on offline inference, and building an online service that handles requests from many users requires additional components. How much of the published optimization technology can be put to use, and how the performance figures DeepSeek has presented should be evaluated in real operating environments, will be key questions for anyone deciding whether to adopt it.

AD

What the inference engine includes, and what production use requires

DeepInfer is software that runs trained AI models and generates outputs in response to inputs. It has been released under the Apache License 2.0 in the official GitHub repository. In its official README, DeepSeek describes it as the inference framework that supports its own large-scale services, while characterizing this public release as an offline inference engine with the core features needed for large-scale service operation.

The published code includes accelerated compute kernels and model execution processing, as well as parallel processing features that distribute computation across multiple devices. It also supports "speculative decoding," which predicts candidate tokens in advance and verifies their correctness in batches, and "structured output," which constrains output to follow JSON Schema, regular expressions, or grammar rules. According to the README, DeepInfer was developed mainly on top of vLLM and also draws on the designs of SGLang and TensorRT-LLM.

DeepInfer alone, however, is not enough to build an online service. DeepSeek has not included in this release the KV cache management system used across its services, or the load-balancing functionality between multiple data-parallel inference engines. The KV cache stores part of the computation results for past inputs, reducing the amount of computation needed when the same context is processed again. The engine's internal KV cache and a mechanism for storing and sharing caches across multiple servers need to be distinguished.

What the DeepInfer release covers, and what production deployment requires

Item to check What the public release offers Work needed for deployment
Model execution Offline inference for V4.1-Flash and various optimizations Prepare supported hardware and runtime environments, and verify operation
Service architecture Most engine-side features needed for separating processing stages Build an operations platform that separates image processing, input processing, and output generation
Caching and request routing Production system design published in the official Q&A Implement service-level KV cache management and load balancing across data-parallel instances
Performance evaluation Benchmark scripts and measurement conditions published Measure performance that reflects actual token acceptance rates and load conditions

This table was compiled by cross-checking the scope described in the official README, the official Q&A explaining the inference system architecture, and the benchmark measurement methods. The Q&A also describes in detail the design of the production system DeepSeek actually uses, but not every feature introduced there is included in the public code. The stage of verifying the inference engine itself and the stage of building a service that responds reliably to many users require different technologies and facilities.

AD

More efficient speculative decoding and less GPU idle time

One of DeepInfer's distinctive optimizations is more efficient verification in speculative decoding. DeepSeek's "DSpark" prioritizes verifying those pre-generated candidate tokens that are most likely to be accepted. If many candidates are generated but few are likely to be adopted, the computation spent on verification tends to be wasted. DeepSeek therefore uses a prediction mechanism called the "Confidence Head" to estimate the acceptance probability of each candidate and dynamically adjusts the length of what is verified to maximize processing efficiency.

According to the official Q&A, DeepSeek's production system generates five candidate tokens at a time. Rather than verifying all five every time, however, it selects the range to verify by considering each candidate's acceptance probability and the hardware's processing capability. This is not a technique for improving the quality or capability of the text the model can generate; it is a mechanism for using the computing resources needed for token verification efficiently.

Another key feature is asynchronous scheduling, which runs CPU and GPU work in parallel. In ordinary inference, the CPU receives the GPU's results and performs post-processing and assigns the next computation, during which the GPU may sit idle. In DeepInfer, the CPU prepares the next task while the GPU is working on the current computation, reducing GPU waiting time. According to the official README, this feature is enabled by default.

An optimization called "SWA bounded replay" has also been introduced for processing that reuses past context. It limits recomputation to the most recent 128 tokens and approximately rebuilds the KV cache for Sliding Window Attention (SWA). DeepSeek says that using this method on the decoder side, which handles output generation, as well, roughly halves the total computation for input processing. Ordinarily, the cache would have to be restored exactly by recomputing a long span of past context, but computing only a limited recent range reduces the load. Because the reconstructed cache differs from one produced by strict recomputation, however, it is important to understand that this is an approximate method, not just a computation-saving one.

AD

Published performance: watch the token acceptance rate and load conditions

DeepSeek publishes performance measurements for DeepInfer in the official README. They were taken with four NVIDIA SM100 GPUs for the "Prefill" stage, which reads the input, and 64 for the "Decode" stage, which generates the output, each within a single domain connected by high-speed interconnects. When comparing against environments with different GPU counts or interconnect configurations, these measurement conditions need to be taken into account.

Particular care is needed with how output throughput is calculated. In the official benchmark example, throughput is computed on the assumption that all candidate tokens generated by speculative decoding are accepted. The number of tokens regarded as generated in one step is "1 + candidate token length" per request. Because this calculation does not reflect the actual acceptance rate, the published tokens-per-second-per-GPU figure cannot be equated with the text generation speed users actually experience.

This difference also matters when evaluating the effect of DSpark's optimization. DeepSeek estimates the performance gain from dynamically varying the length of verified candidates, based on benchmark data with expert parallelism (EP) and data parallelism (DP) both set to 64. According to the company, in conditions close to production operation, where each parallel processing unit handles about 60 sequences simultaneously, throughput improves by roughly 4–7% compared with a fixed-length approach that always verifies five tokens.

The size of the gain varies, however, with the number of sequences processed concurrently. In the comparison table DeepSeek published, throughput with the dynamic-length method falls 1.5% when there are 16 concurrent sequences, but rises 5.4% at 60. In other words, reducing the number of verified tokens does not necessarily speed things up under every load condition. These values are also estimates calculated from the company's measurement data, and they do not directly prove superiority over other inference frameworks.

In actual deployment, teams must check whether the required response speed can be maintained, taking into account the number of concurrent requests and the acceptance rate of candidate tokens. The published benchmarks offer a clue to the performance of the inference engine itself, but the throughput of an entire online service also depends on KV cache reuse efficiency and load balancing between servers. It is therefore important to re-measure under conditions close to your own usage.

AD

Support for NVIDIA and Huawei Ascend, but production use needs extra build-out

The hardware DeepInfer officially supports is NVIDIA SM100 GPUs and Huawei Ascend 950 NPUs. The runtime environment requires Linux, GCC 13.0 or later, and Python 3.12, with CUDA 13 for NVIDIA environments and CANN 9.2 for Ascend environments. Because the supported platforms are explicitly limited, it may not run as-is on existing GPU environments.

There are also constraints on features that ensure reproducible inference results. The feature that keeps model computation results identical even when batch composition changes is limited to NVIDIA environments and must be explicitly enabled. Further, using deterministic sampling, which produces identical output from the same input tokens and sampling settings, requires disabling dynamic-length verification and specifying a fixed seed. In other words, not every feature DeepInfer supports can be used at the same time, and the configuration conditions for reproducibility and optimization need to be checked.

The scale of hardware needed for production operation also differs greatly from ordinary functional testing. The official Q&A cites, as a minimal efficiency-oriented configuration, one that uses 64 GPUs for input processing and 64 for output generation. This assumes the company's recommended configuration of 64 or more GPUs for output generation, and it is not the minimum requirement for running offline inference. Trying out the model in a small environment and securing high processing efficiency in a large-scale user-facing service should be considered separately.

Alongside DeepInfer, DeepSeek also released "deepseek-recipe," which converts between API request formats and the token sequences the model processes. It is software that converts requests from different API formats for DeepSeek models and returns generated results in the corresponding format. Although it is a useful component for building a service, it does not include request load balancing or shared KV cache management. With this release, external developers can refer to the inference optimization techniques DeepSeek uses, as well as concrete implementations for incorporating them into a service.

The release of DeepInfer is an important step toward letting third parties verify DeepSeek's inference technology and bring it into their own systems. However, the performance of the published inference engine does not translate directly into the performance of an entire online service. Measuring token acceptance rates and response times under real traffic, and evaluating the efficiency of the whole system including KV caching and load balancing, is likely to shape future adoption decisions.