opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

DeepSeek's production inference framework is now open source
GitHub RepoViews7

Project Description

View on GitHub

DeepSeek Just Open-Sourced the Inference Framework Behind Its Production Services

You've probably wondered how the big labs actually serve their models at scale—not the demo notebooks, but the real thing running behind an API. DeepSeek has answered part of that question by open-sourcing DeepInfer, the high-performance inference framework that powers its large-scale production services. This release focuses on offline inference, but it ships with the core machinery you'd need to run serious workloads.

What It Does

DeepInfer is a high-performance inference framework built for serving DeepSeek's models at scale. This open-source release supports one model—DeepSeek-V4.1-Flash—and provides offline inference with the features that matter when you're actually pushing tokens through hardware.

The framework covers a lot of ground: optimized kernels (including FlashMLA, DeepGEMM, DeepEP, TileKernels, DeepSelect, and custom TileLang kernels), parallelism strategies like Attention DP with balanced CP and MoE EP with EPLB, and a batch of runtime features aimed at making inference faster and more predictable. It runs on NVIDIA SM100 GPUs and Huawei Ascend 950 NPUs with aarch64 hosts, and it's built for Linux with GCC 13 or newer and Python 3.12.

One thing worth flagging upfront: this isn't a complete inference service. You'll need to bring your own KV cache system, VE/Prefill/Decode disaggregation setup, and load balancing across data-parallel replicas. The README is upfront about this—most of the required engine functionality is implemented, but the surrounding infrastructure is on you.

Why It's Cool

  • It's the actual production code. This isn't a research prototype or a simplified reference implementation. It's the framework DeepSeek uses to serve its own services. That alone makes it worth studying, even if you're not planning to deploy it tomorrow.

  • The performance features are specific and tunable. DSpark with confidence-scheduled verification lets you accelerate decoding using draft tokens, with environment variables to control the maximum draft length. SWA bounded replay reduces decoder prefill work by replaying only a bounded suffix—the README gives you the exact default settings for V4.1, including the caveat that the retained suffix must cover the SWA window plus the maximum backtracking length. These aren't vague knobs; they're concrete levers with documented defaults.

  • Determinism is treated as a first-class concern. Batch-invariant inference keeps model results identical across different batch compositions, and deterministic sampling produces identical outputs for identical inputs when you set the right flags and pass a fixed seq_seed. If you've ever debugged a model that behaved differently depending on how requests were batched, you know why this matters.

  • Asynchronous scheduling is on by default. The zero-overhead batch scheduler overlaps CPU batch scheduling with device execution. It's the kind of optimization that's easy to overlook but hard to live without once you've had it.

  • Structured outputs are built in. You can constrain generation to a regex, JSON schema, or EBNF grammar by passing so_args to SamplingParams, with an example file to show you how. No need to bolt on a separate library.

  • It spans both NVIDIA and Ascend hardware. The recent performance update added fused attention, Mega Gate, Mega-MHC, FP8 einsum output, and native DeepSelect for Ascend 950DT NPUs, alongside substantial decode gains on SM100 GPUs. That's a meaningful signal for anyone working outside the NVIDIA ecosystem.

How to Try It

The README is truncated in the provided content, but here's what you can piece together for getting started:

  1. Check the prerequisites. You'll need Linux, GCC 13.0 or newer, Python 3.12, CUDA 13.2 or newer for NVIDIA, and CANN 9.3 for Ascend.

  2. Set up a clean environment. The README explicitly says to create and activate an empty Python 3.12 environment before building.

  3. Export your accelerator. Set DEEPINFER_ACCELERATOR=nvidia (or ascend for the Ascend platform) and keep it exported in the environment where you run DeepInfer.

  4. Build from source. Follow the build instructions in the repository—the README continues past what's shown here with the actual build commands.

  5. Read the deployment Q&A. The README points to doc/inference_deployment_qa.md for production architecture and deployment details, which is where you'll find the guidance on the KV cache and disaggregation pieces you need to supply yourself.

The full repository is at github.com/deepseek-ai/deepinfer, and it includes benchmarks for both Ascend 950DT and SM100 hardware if you want to see prefill and decode numbers before committing.

Final Thoughts

DeepInfer is best suited for teams that already have inference infrastructure and want to study or adopt the optimizations DeepSeek uses in production—or for anyone running DeepSeek-V4.1-Flash on supported hardware who wants a serious starting point. It's not a drop-in solution for a weekend project, and the missing pieces (KV cache, disaggregation, load balancing) mean you'll be doing real engineering work. But if you're in the target audience, having access to this code is genuinely useful. The framework's recent performance updates show it's actively maintained, and the honest scoping in the README suggests the team knows exactly what they're shipping.


Follow @githubprojects for more developer tools and open source projects.

Back to Projects
Project ID: deepinferLast updated: December 2, 2026 at 09:09 AM