deepseek-v4
Inside DeepSeek V4.1’s New Open Inference Toolkit
DeepSeek-V4 Team · September 14, 2026 · 5 min read
Keywords: deepseek v4.1 inference, deepselect topk, deepjit cuda ascend
Published: September 14, 2026 Author: DeepSeek-V4 Team
Three DeepSeek repositories updated in the same week tell a more useful story together than they do separately. DeepSelect accelerates a narrow TopK operation. DeepJIT compiles and caches device kernels. deepseek-recipe translates API-shaped conversations into prompts and parses model output back into responses. None is a complete inference server, but together they expose layers that are often hidden behind one endpoint.
The distinction matters because “faster inference” is frequently reported as if it were a single knob. In reality, a request can lose time while being validated, rendered into model tokens, scheduled, executed on accelerators, sampled, and converted into a streaming response. Optimizing one layer may be valuable without producing the same percentage improvement end to end.
DeepSelect: a fast, deliberately narrow TopK
DeepSelect 1.0 implements TopK kernels for DeepSeek Sparse Attention (DSA) and sampling. Its README states that DSA is used in DeepSeek V3.2, V4, and V4.1. The project reports a 2–20× speedup over vanilla torch.topk, but that number belongs to supported test shapes, not to complete model generation.
The constraints are concrete. The Lightning Indexer path accepts bfloat16, small topk values no greater than 4096, and both small and large batches and vocabularies. The sampling path uses float32, targets a vocabulary around 128K, and also limits topk to 4096. Input rows need a specific alignment, and callers may need to pad them.
Several options reveal where practical speed is found. If indices do not need ordering, sorted output should be disabled. If values are unnecessary, return_value=False skips that output; the project says this is roughly 10% faster for the operation. These are API-level savings, not mysterious model intelligence.
There is also a sharp NaN policy. Checking is always enabled, and the default behavior traps and aborts when a NaN is found. That may be appropriate for catching corrupted computation early, but an inference service needs to decide how a worker crash is isolated and reported.
DeepJIT: compile once, reuse with evidence
DeepJIT sits lower in the stack. It is a header-only C++20 runtime for JIT-compiling kernels on NVIDIA CUDA GPUs and Huawei Ascend NPUs. The shared interface covers compilation, binary caching, loading, and launch, while the kernel source and backend-specific options remain separate.
Caching is its central operational feature. Cache keys account for source, tracked includes, compiler versions, effective compiler options, and an application-supplied dependency signature. That last field matters when generated code depends on something the include parser cannot see. If a library upgrades CUTLASS but leaves the extra signature unchanged, a superficially valid cache key could represent the wrong artifact.
DeepJIT supports both memory and disk caches, including shared storage with POSIX behavior for atomic rename and fsync. Multiple workers can compile the same entry, then reuse the published result. A personal writable cache can also precede a read-only shared cache. This is a practical answer to cold-start cost on clusters, provided the shared directory is trusted.
The hardware support is not symmetrical magic. CUDA requires recent CUDA headers and NVCC; Ascend requires the Bisheng toolchain, CANN headers, ACL, and torch_npu. The unified runtime reduces duplicated host logic, but operators still maintain two device ecosystems.
deepseek-recipe: the protocol layer is real engineering
At the request boundary, deepseek-recipe provides Rust libraries and Python bindings for converting Messages, Chat Completions, and Responses requests into a shared Conversation representation. It can then encode DeepSeek V4 or V4.1 prompts and parse generated output into the caller’s expected format.
Supported content includes text, images, thinking, and client tool calls. Generation settings cover reasoning effort, temperature, top-p, and output limits. The Responses format can carry tool namespaces and an apply_patch custom tool. For V4.1 images, preprocessing is provided through OpenCV.
The omissions are just as useful. The library does not provide model inference, HTTP transport, or tool execution. Server-side web search is unsupported. It does not enforce strict JSON Schema or regex outputs, store conversations through previous_response_id, or retrieve files by ID. A team building an OpenAI-compatible endpoint still has to supply those services.
How the layers line up
| Layer | Project | Primary job | Does not provide |
|---|---|---|---|
| API and prompt | deepseek-recipe | Convert request formats; encode V4/V4.1 prompts; parse output | HTTP server, inference, tool execution |
| Kernel runtime | DeepJIT | Compile, cache, load, and launch CUDA/Ascend kernels | Model scheduler or model weights |
| Selection kernel | DeepSelect | TopK for DSA and sampling in supported shapes | End-to-end inference engine |
A hypothetical request enters through an API service. deepseek-recipe validates and normalizes it, then renders the correct prompt. An inference engine schedules model work and uses device kernels, some of which may be compiled and cached through DeepJIT. During sparse attention or sampling, a supported TopK call may use DeepSelect. Generated tokens then travel back through the recipe parser into a streaming API response.
That diagram contains important hypothetical glue. DeepSeek does not claim that installing these three repositories creates a V4.1 server. The scheduler, distributed execution, weights, HTTP layer, authentication, quotas, observability, and actual tool runner remain outside the combined scope.
Who should care
Inference engineers can use these projects as concrete building blocks or readable references. API platform teams will get the most immediate value from deepseek-recipe; kernel authors from DeepJIT and DeepSelect. Application developers calling a hosted model do not need to install any of them.
For evaluators, the disciplined conclusion is modest: DeepSeek is opening more of the machinery around V4 and V4.1, and the interfaces show where its engineers are spending effort. DeepSelect’s benchmark is credible only inside its published shapes. DeepJIT can reduce repeat compilation, not generation tokens. deepseek-recipe improves protocol consistency, not model accuracy.
Those boundaries make the releases more useful, not less. A narrowly specified component can be benchmarked, replaced, and debugged. The interesting update is not one dramatic speed claim; it is a stack becoming easier to inspect one layer at a time.
Sources checked 14 September 2026: DeepSelect, DeepJIT, and deepseek-recipe.