DeepInfer: High-performance, large-scale inference framework for DeepSeek models
★ 25,778⑂ 3,162👁 65⑃ 246● 0▤ 0◈ 9
25,778
stars
+66+762
3,162
forks
65
watchers
246
prs
0
issues
0
releases
9
discussions
README
DeepInfer
DeepInfer is the high-performance inference framework that powers DeepSeek's large-scale production services. This open-source release provides offline inference with the core features needed for serving at scale.
Supported models:
- DeepSeek-V4.1-Flash
Supported features:
- Optimized kernels, model and sampler runtime
- Parallelism: Attention DP / balanced CP, MoE EP + EPLB
- DSpark and confidence-scheduled verification
- SWA bounded replay
- Asynchronous scheduling (zero-overhead batch scheduler)
- Batch-invariant inference
- Deterministic sampling
- Structured outputs
Feature details and configuration
- Optimized kernels: FlashMLA, DeepGEMM, DeepEP, TileKernels, DeepSelect, and custom TileLang kernels.
- DSpark and confidence-scheduled verification: accelerate decoding with draft tokens and use confidence estimates to schedule verification. Set DEEPINFER_ENABLE_MTP_VARLEN=1; DEEPINFER_USE_NEXTN_DECODE controls the maximum draft length (default: 5).
- Decoder SWA bounded replay: reduce decoder prefill work by replaying only a bounded suffix. Set DEEPINFER_YOCO_PREFILL_TRUNCATION_MODE=compact and DEEPINFER_YOCO_PREFILL_KEEP_TOKENS=140 for the default V4.1 settings; the retained suffix must cover the SWA window plus the maximum backtracking length.
- Asynchronous scheduling: overlap CPU batch scheduling with device execution. Enabled by default.
- Batch-invariant inference: keep model results identical across different batch compositions. Enable with DEEPINFER_BATCH_INVARIANT=1 (NVIDIA only).
- Deterministic sampling: produce identical outputs for identical input tokens and sampling parameters. Set DEEPINFER_BATCH_INVARIANT=1 DEEPINFER_ENABLE_MTP_VARLEN=0 and pass a fixed seq_seed to SamplingParams (NVIDIA only).
- Structured outputs: constrain generation to a regex, JSON schema, or EBNF grammar. Pass so_args={"schema_type": ..., "schema": ...} to SamplingParams; see examples.
Supported hardware:
- NVIDIA SM100 GPUs
- Huawei Ascend 950 NPUs
Required for a complete inference service (not included in this release):
- A KV cache system
- VE/Prefill/Decode disaggregation (most required engine functionality is already implemented)
- Load balancing across data-parallel replicas for both prefill and decode
Getting started
Prerequisites
- Linux
- GCC = 13.0
- Python 3.12
- CUDA 13 (NVIDIA only)
- CANN 9.2 (Ascend only)
Build from source
Before building DeepInfer, please create and activate an empty Python 3.12 environment.
bash
Use ascend instead for the Ascend platform
Keep it exported in the environment where you run DeepInfer
export DEEPINFER_ACCELERATOR=nvidia
./build.sh
Offline inference
The default checkpoint, deepseek-ai/DeepSeek-V4.1-Flash-1017, is
downloaded into the Hugging Face cache on the first run; set DEEPINFER_HF_MODEL_DIR=/path/to/DeepSeek-V4.1-Flash-1017 to
run from a local copy instead.
bash
python examples/offline_inference.py
See examples for details.
Performance benchmarks
| Prefill | DDiscussions
#275Visible-device assignment can select ids past the last GPU when offset is nonzero0 comments · 2026-11-05#270Profiling manager fails to start when route-based address lookup fails0 comments · 2026-11-04#268Visible-device helpers count entries after CUDA -1 sentinel0 comments · 2026-11-04#238Is NVIDIA H200 (Hopper, SM90) officially supported or planned?3 comments · 2026-10-26#231Roadmap for official Docker images and production serving recipes/cookbooks (similar to vLLM/SGLang)?1 comments · 2026-10-26#225Proposal: per-request prompt mask that keeps KV but zeroes attention0 comments · 2026-10-25#224Low-concurrency decode: EP-only MoE leaves a ~7 ms/step floor (TP path for small batches?)0 comments · 2026-10-24#223CUDA_ERROR_ILLEGAL_ADDRESS from cuModuleLoadData (tilelang) at first forward — GB200 Grace ARM, single node without NCCL GIN2 comments · 2026-10-24
相关报道 (9)
硬是要學SOFT4FUNDeepSeek 開源 DeepInfer:正式服務用的推論引擎首度公開,同時支援 Blackwell 與昇騰 9502026-10-22blocktempoDeepSeek 開源推論框架 DeepInfer:支援 Nvidia、華為昇騰,但只含離線推論2026-10-20雷峰网DeepSeek 又一开源重器!深挖 DeepInfer 究竟藏着多少技术狠活?2026-10-29智源社区vLLM 称已追平 DeepSeek 自研引擎 DeepInfer 的性能曲线:decode 吞吐差距 6% 以内2026-10-25InfoQ.cnDeepSeek 开源最新推理框架:单集群日吞吐 155 万亿 Token,KVCache 可保存 7 天2026-10-21智源社区刚刚,DeepSeek开源自家推理框架!2026-10-2136氪突发,DeepSeek重磅开源核心推理引擎2026-10-20OSCHINADeepSeek 开源推理框架DeepInfer:服务链路的最后一块拼图2026-10-20QQ News刚刚,DeepSeek又掀桌了!开源推理引擎2026-10-20
News & coverage (10)
Hacker NewsDeepInfer: High-performance inference framework for DeepSeek models▲ 2,355 · 892 comments · 2026-10-20noteWhat did DeepSeek release? The scope of the engine as read from GitHub2026-11-05MarkTechPostDeepSeek Open-Sources DeepInfer, the Inference Framework Behind DeepSeek-V4.1-Flash2026-10-20The Next WebDeepSeek open-sources DeepInfer, the engine that runs its AI models2026-10-20GizmodoDeepSeek Dials Up the Pressure on OpenAI and Anthropic With Open-Source Inference Tool2026-10-20SiliconANGLEDeepSeek open-sources DeepInfer, the inference framework behind its production services2026-10-20Crypto BriefingDeepSeek open-sources DeepInfer to cut the cost of running AI models2026-10-20GIGAZINEDeepSeek has released 'DeepInfer,' an open-source version of its AI inference system, which is actually used in DeepSeek's production service.2026-10-21QuartzDeepSeek is open-sourcing the software it uses to run its AI models at scale2026-10-20Kingy AIDeepInfer Explained: DeepSeek’s Open Inference Engine, Benchmarks, Specs, and Costs2026-10-20