LmCast :: Stay tuned in

DeepSeek just open-sourced its inference engine

Recorded: Oct. 20, 2026, 10:09 a.m.

Original Summarized

GitHub - deepseek-ai/DeepInfer: DeepInfer: High-performance, large-scale inference framework for DeepSeek models · GitHub

Skip to content

Navigation MenuSign inAppearance settingsPlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub Copilot appDirect agents from issue to mergeMCP RegistryIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesCode QualityEnforce quality at mergeAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersView all resourcesOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityGitHub StarsArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricingSearch/Sign inSign upAppearance settings

You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.
You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

deepseek-aiDeepInferRepository navigationCodePull requests3 (3)ActionsProjectsSecurity and qualityInsightsMore items

DeepInferPublicNotificationsYou must be signed in to change notification settingsFork259 (259)Star3.5k (3.5k)You must be signed in to star a repositoryAboutDeepInfer: High-performance, large-scale inference framework for DeepSeek modelsResourcesReadmeApache-2.0 licenseContributingContributingActivityCustom propertiesStars3.5k starsWatchers2 watchingForks259 forksReport repositorymainBranchesTagsGo to fileCodeOpen more actions menuLatest commit History2 Commits2 CommitsFolders and filesNameNameLast commit messageLast commit datecsrccsrc  deep_clusterdeep_cluster  deepinferdeepinfer  docdoc  evaleval  examplesexamples  scriptsscripts  teststests  vendorvendor  .clang-format.clang-format  .gitignore.gitignore  .gitmodules.gitmodules  CONTRIBUTING.mdCONTRIBUTING.md  LICENSELICENSE  MakefileMakefile  README.mdREADME.md  build.shbuild.sh  pyproject.tomlpyproject.toml  requirements-ascend.txtrequirements-ascend.txt  requirements-dev.txtrequirements-dev.txt  requirements-nvidia.txtrequirements-nvidia.txt  requirements.txtrequirements.txt  setup.pysetup.py  View all filesRepository files navigationREADMEContributingApache-2.0 licenseMore itemsDeepInfer
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.
# 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.
python examples/offline_inference.py
See examples for details.
Performance benchmarks

Prefill
Decode

Measured on 4 SM100 GPUs for prefill and 64 for decode — each within one scale-up domain. To reproduce the benchmarks, see run_sweep.sh.
Evaluation benchmarks
See eval/README.md.
License
DeepInfer is released under the Apache License 2.0. See LICENSE for details.
Acknowledgments
DeepInfer was originally built primarily on vLLM, with additional inspiration from SGLang and TensorRT-LLM. We thank their developers.
Citation
@misc{deepinfer2026,
title = {DeepInfer: High-performance, large-scale inference framework for DeepSeek models},
author = {DeepSeek-AI},
year = {2026},
publisher = {GitHub},
howpublished = {\url{https://github.com/deepseek-ai/DeepInfer}},
}
AboutDeepInfer: High-performance, large-scale inference framework for DeepSeek modelsResourcesReadmeApache-2.0 licenseContributingContributingActivityCustom propertiesStars3.5k starsWatchers2 watchingForks259 forksReport repositoryReleasesPackagesUsed byContributorsLanguages

Footer

© 2026 GitHub, Inc.

Footer navigation

Terms

Privacy

Security

Status

Community

Docs

Contact

Manage cookies

Do not share my personal information

You can’t perform that action at this time.

DeepInfer is an open-source, high-performance inference framework developed by DeepSeek-AI, designed to power DeepSeek's large-scale production services by enabling offline inference with the essential capabilities required for serving models at scale. The framework is specifically tailored for the DeepSeek-V4.1-Flash model, providing a robust and efficient solution for real-world deployment scenarios. At its core, DeepInfer integrates a suite of optimized computational kernels, including FlashMLA, DeepGEMM, DeepEP, TileKernels, DeepSelect, and custom TileLang kernels, which collectively enhance the speed and efficiency of matrix operations, attention mechanisms, and expert parallelism within the inference pipeline. This combination of specialized kernels, along with a comprehensive model and sampler runtime, forms the technical foundation that ensures high throughput and low latency during inference.

The framework supports advanced parallelism strategies to handle large-scale workloads effectively. These include attention data-parallel (DP) and balanced compute (CP) approaches, as well as mixture-of-experts (MoE) expert parallelism (EP) combined with expert load balancing (EPLB). Additionally, DeepInfer incorporates DSpark and confidence-scheduled verification, which accelerate decoding by leveraging draft tokens and utilizing confidence estimates to strategically schedule verification steps. A notable feature is SWA bounded replay, which reduces decoder prefill workload by replaying only a bounded suffix, thereby optimizing resource usage during prefill phases. Asynchronous scheduling is enabled by default, allowing CPU batch scheduling to overlap with device execution, thereby minimizing idle time and improving overall performance. Batch-invariant inference is also supported, ensuring that model outputs remain consistent regardless of the composition of the input batch, which is crucial for reproducibility and reliability. Deterministic sampling is another key capability, guaranteeing identical outputs for identical input tokens and sampling parameters, achieved through specific configuration settings and constraints. Finally, structured outputs are provided, enabling constrained generation to adhere to regex patterns, JSON schemas, or EBNF grammars, with the ability to pass schema specifications to the SamplingParams object.

To harness these features, DeepInfer requires precise configuration of environment variables and parameters. For instance, DSpark and confidence-scheduled verification are activated by setting DEEPINFER_ENABLE_MTP_VARLEN=1 and DEEPINFER_USE_NEXTN_DECODE to control the maximum draft length, with a default of 5. Decoder SWA bounded replay is configured by setting DEEPINFER_YOCO_PREFILL_TRUNCATION_MODE=compact and DEEPINFER_YOCO_PREFILL_KEEP_TOKENS=140 for the default V4.1 settings; the retained suffix must cover both the SWA window and the maximum backtracking length to ensure correctness. Asynchronous scheduling, which overlaps CPU and device operations, is enabled by default without additional flags. Batch-invariant inference is enabled by setting DEEPINFER_BATCH_INVARIANT=1, though this is restricted to NVIDIA hardware. Deterministic sampling requires DEEPINFER_BATCH_INVARIANT=1, DEEPINFER_ENABLE_MTP_VARLEN=0, and the use of a fixed seq_seed passed to SamplingParams, again limited to NVIDIA environments. Structured outputs are implemented by passing arguments such as so_args with schema_type and schema to the SamplingParams, allowing generation to be constrained to predefined formats.

DeepInfer is compatible with two primary hardware platforms: NVIDIA SM100 GPUs and Huawei Ascend 950 NPUs, each with its own set of dependencies. For NVIDIA, CUDA 13 is required; for Ascend, CANN 9.2 is needed. The prerequisites also include a Linux operating system, GCC version 13.0 or higher, and Python 3.12. To build the framework from source, users must create and activate an empty Python 3.12 environment, then export the appropriate accelerator environment variable (either DEEPINFER_ACCELERATOR=nvidia or DEEPINFER_ACCELERATOR=ascend) and execute the build script, ./build.sh. Offline inference can be performed by running the example script examples/offline_inference.py, with the default checkpoint deepseek-ai/DeepSeek-V4.1-Flash-1017 automatically downloaded to the Hugging Face cache on the first run. Users can alternatively point to a local copy by setting the DEEPINFER_HF_MODEL_DIR environment variable. Performance benchmarks for both prefill and decode are measured on specific hardware configurations and documented in the repository, with evaluation benchmarks available in the eval directory.

While DeepInfer provides a comprehensive inference framework, a complete inference service requires additional components not included in this release. These include a KV cache system, VE/Prefill/Decode disaggregation (where most required engine functionality is already implemented), and load balancing across data-parallel replicas for both prefill and decode operations. These elements are necessary to fully realize the framework's capabilities in production settings.

DeepInfer is released under the Apache License 2.0, which grants broad rights for use and distribution. The framework was originally built primarily on vLLM, with additional inspiration drawn from SGLang and TensorRT-LLM, and the developers express gratitude to those projects' communities. For academic citation, DeepInfer is referenced as: @misc{deepinfer2026, title = {DeepInfer: High-performance, large-scale inference framework for DeepSeek models}, author = {DeepSeek-AI}, year = {2026}, publisher = {GitHub}, howpublished = {\url{https://github.com/deepseek-ai/DeepInfer}}}.

In summary, DeepInfer represents a sophisticated and efficient inference framework that enables large-scale, high-performance deployment of DeepSeek models, integrating optimized kernels, advanced parallelism, and a range of specialized features tailored to production needs, all while maintaining flexibility across NVIDIA and Ascend hardware platforms.