SuperAPIAI Directory

DeepInfer

github.com · AI developer platforms

DeepInfer is a high-performance large-scale inference framework open-sourced by DeepSeek, powering its large-scale production services. This open-source release provides offline inference and the core features required for large-scale serving: optimized kernels, model and sampler runtime, Attention DP / balanced CP, MoE EP + EPLB parallel strategies, DSpark and confidence-scheduled verification, SWA bounded replay, asynchronous scheduling (zero-overhead batch scheduler), batch-invariant inference, deterministic sampling, and structured output. The currently supported model is DeepSeek-V4.1-Flash, supporting NVIDIA SM100 GPUs and Huawei Ascend 950 NPUs paired with aarch64 hosts. The KV cache system, VE/Prefill/Decode disaggregation, and data-parallel replica load balancing required for a complete inference service are not included in this release. The project is released under the Apache License 2.0.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

DeepInfer is a high-performance inference framework open-sourced by DeepSeek, used to support DeepSeek's large-scale production services. According to the official description, this open-source release provides offline inference capabilities and includes the core features required for large-scale serving.

  1. Purpose DeepInfer is positioned as a high-performance, large-scale inference framework for DeepSeek models. The open-source release provides offline inference and covers several core capabilities needed in large-scale serving; a complete inference service also depends on some components not included in this release.

  2. Supported models The currently supported model is DeepSeek-V4.1-Flash. Offline inference uses the checkpoint by default: deepseek-ai/DeepSeek-V4.1-Flash-1017, which will be downloaded to the Hugging Face cache on first run; to run from a local copy, set DEEPINFER_HF_MODEL_DIR=/path/to/DeepSeek-V4.1-Flash-1017.

  3. Main capabilities

  4. Optimized kernels, model and sampler runtime.

  5. Parallel strategies: Attention DP / balanced CP, MoE EP + EPLB.

  6. DSpark and confidence-scheduled verification: use draft tokens to accelerate decoding, and use confidence estimation to schedule verification. DEEPINFER_ENABLE_MTP_VARLEN=1 must be set; DEEPINFER_USE_NEXTN_DECODE controls the maximum draft length (default: 5).

  7. Decoder SWA bounded replay: reduce decoder prefill work by replaying only a bounded suffix. The default V4.1 settings require setting DEEPINFER_YOCO_PREFILL_TRUNCATION_MODE=compact and DEEPINFER_YOCO_PREFILL_KEEP_TOKENS=140; the retained suffix must cover the SWA window plus the maximum backtrack length.

  8. Asynchronous scheduling: overlap CPU batch scheduling with device execution, enabled by default.

  9. Batch-invariant inference: keep model results consistent across different batch compositions, can be enabled via DEEPINFER_BATCH_INVARIANT=1 enabled.

  10. Deterministic sampling: produces identical outputs for the same input tokens and sampling parameters. Requires setting DEEPINFER_BATCH_INVARIANT=1 DEEPINFER_ENABLE_MTP_VARLEN=0, and passing a fixed seq_seed to SamplingParams.

  11. Structured output: constrains generation to a regex, JSON schema, or EBNF grammar. Pass so_args={"schema_type": ..., "schema": ...} to SamplingParams; see examples for details.

IV. Optimized kernels Includes FlashMLA, DeepGEMM, DeepEP, TileKernels, DeepSelect, and custom TileLang kernels.

V. Supported hardware NVIDIA SM100 GPUs; Huawei Ascend 950 NPUs paired with aarch64 hosts.

VI. What a complete inference service requires but this release does not include A KV cache system; VE/Prefill/Decode disaggregation (most of the required engine functionality is already implemented); data-parallel replica load balancing for prefill and decode. The official guidance suggests consulting the inference deployment Q&A for production architecture and deployment details.

VII. 2026.11.28 update (DeepSeek-V4.1-Flash performance update) This update applies system optimizations for the Ascend 950DT NPU and achieves significant decode performance improvements on SM100 GPUs. Ascend 950DT NPU: adds fused attention, Mega Gate, Mega-MHC, FP8 einsum output, native DeepSelect, batch-invariant inference, and deterministic sampling; uses UDMA to optimize EPLB expert shuffling, and uses hugepages to optimize KV cache allocation. Runtime: captures target sampling and verification in the device graph and combines them with fused pinned-host I/O, overlaps prefill post-processing with model execution, and optimizes CP, SWA, EPLB, and startupprocesses. Vision encoder: fuses GEMM epilogue on NVIDIA GPUs, and optimizes image metadata preparation and downsampling. Benchmarks: adds Ascend 950DT, and refreshes SM100 prefill and decode results.

VIII. Usage Build requirements: CUDA >= 13.2 (NVIDIA only); CANN 9.3 (Ascend only). The official instructions state that before building DeepInfer from source, you should create and activate an empty Python 3.12 environment. Offline inference: the default checkpoint (deepseek-ai/DeepSeek-V4.1-Flash-1017) is downloaded to the Hugging Face cache on first run; you can set DEEPINFER_HF_MODEL_DIR=/path/to/DeepSeek-V4.1-Flash-1017 to use a local copy instead. See examples for more details. The materials do not provide the specific build and run command text.

IX. Performance and evaluation benchmarks SM100 benchmarks use 4 GPUs for prefill and 64 for decode; Ascend 950 benchmarks use 8 NPUs for prefill and 64 for decode. Each configuration runs within a single scale-up domain. For sweep instructions to reproduce the benchmarks and for the evaluation benchmarks, refer to the relevant documentation and eval/README.md respectively.

X. License and acknowledgments DeepInfer is released under the Apache License 2.0; see LICENSE for details. DeepInfer was initially built primarily on vLLM, and drew inspiration from SGLang and TensorRT-LLM; the official team thanks the above developers.

XI. Limitations The KV cache system, VE/Prefill/Decode disaggregation, and data-parallel replica load balancing required for a complete inference service are not within the scope of this release; apart from the models, hardware, features, and environment variables listed above, other functionality, pricing, platforms, or usage steps are not yet provided in the materials.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools