DeepInfer's Open Source Code: A One-Model Engine Built for 155T Tokens a Day
DeepInfer ships without an OpenAI-compatible endpoint; the repo offers offline batch generation only, with cross-instance KV cache, request routing, load balancers, and ops tooling absent. On SM100 or Ascend 950, it still works as a reference implementation for how a production MoE engine schedules prefill and decode, prices speculative verification, and balances expert load.
DeepInfer is DeepSeek's open-source inference stack for its V4.1 Flash model, and the repository is deliberately narrow. The model registry contains one entry, DeepseekV41ForCausalLM, the default checkpoint is DeepSeek-V4.1-Flash-1017, and the C++ scheduler, block manager, and model modules are tied to that architecture. The Python API still carries vLLM names like LLM, EngineArgs, Sequence, and SamplingParams, but the engine underneath is a custom rewrite.
The source code rewards careful reading. The step() loop at llm_engine.py:860 invokes a scheduler that uses ALL/ANY voting across DP ranks to avoid allreduce deadlocks when prefill and decode share one process. GPU memory is managed in fixed-size blocks with reference counting, prefix sharing, and block-level preemption. DSpark adds a confidence head to speculative decoding and uses runtime estimators to decide how many draft tokens to verify; official numbers put the gain at 4 to 7% throughput. EPLB replicates hot experts and targets the historically busiest rank instead of average load, so MoE tail latency stays in view.
What is not in the repository matters as much as what is. The architecture diagram shows a protocol layer, three load balancers, and 3FS-based cross-instance KV storage; none of those ship. The open-source code exposes offline LLM.generate() batch inference, one model, NVIDIA SM100 or Ascend 950 support, and no OpenAI-compatible HTTP service. The 155-trillion-token headline belongs to the internal deployment, not to a single checkout of this repo.
DeepSeek released the engine but kept the distributed control plane behind the headline number; the stubbed methods init_pd_split(), do_save_kvcache(), and send_processed_prompts() are explicit extension points for a system that did not ship.
The ALL/ANY voting scheme is a code-level consequence of collapsing separate prefill and decode services into one offline process; it shows production scheduling decisions are shaped as much by collective-communication constraints as by throughput.
DSpark's 4-7% throughput gain is small enough to suggest speculative decoding is reaching diminishing returns on an already tuned model, but the transferable idea is pricing verification work: predict acceptance, estimate runtime, and choose batch size from expected output per unit time.
EPLB's choice to optimize the historically busiest rank rather than average load treats tail latency as the binding constraint; the same principle would change how replicas are placed in any MoE cluster.
The official charts are best-case steady-state measurements with controlled routing, selected measurement windows, and no same-config comparison against vLLM or SGLang, so they establish scalability, not superiority.