# Feature catalog — deepseek-ai/DeepSeek-V3

> Canonical page: https://codevetter.com/unpack/deepseek-v3/feature-catalog

# Feature catalog — deepseek-ai/DeepSeek-V3

Scanned commit 9b4e9788e4a3a731f7567338ed15d3ec549ce03b (2025-08-28). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

User-facing surface is deliberately small: a torchrun-launched CLI supporting interactive multi-turn chat and batch file inference, two checkpoint-conversion utilities, and a set of compile-time implementation switches (attention impl, GEMM impl, gate score function, quantization scale format). Config presets cover 16B/236B/671B model sizes plus the V3.1 variant with ue8m0 scale format. The README documents the model itself (benchmarks, weights layout, deployment ecosystem) more than the code, which is positioned as a demo.
- Interactive chat mode (--interactive) presents a '>>> ' prompt loop with two built-in slash commands: /exit to quit and /clear to reset message history. — [inference/generate.py#L121-144](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/generate.py#L121-L144)
- Batch mode (--input-file FILE) reads one prompt per line, applies the chat template to each as a single user message, and prints Prompt/Completion pairs; prompt count is asserted <= args.max_batch_size. — [inference/generate.py#L145-155](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/generate.py#L145-L155)
- Sampling supports temperature-scaled multinomial sampling (implemented as argmax of probs/exponential(1), i.e. the Gumbel-max trick) and greedy decoding when temperature <= 0 via logits.argmax. — [inference/generate.py#L14-27](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/generate.py#L14-L27) [inference/generate.py#L62-65](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/generate.py#L62-L65)
- Multi-turn context is maintained in a messages list and rendered each turn by tokenizer.apply_chat_template(messages, add_generation_prompt=True). — [inference/generate.py#L139-144](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/generate.py#L139-L144)
- convert.py converts a Hugging Face checkpoint directory into per-rank demo shards, with required CLI args --hf-ckpt-path, --save-path, --n-experts, --model-parallel. — [inference/convert.py#L88-96](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/convert.py#L88-L96) [README.md#L283-289](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/README.md#L283-L289)
- fp8_cast_bf16.py converts an FP8 HF checkpoint to BF16 by dequantizing every 1-byte weight with its *_scale_inv tensor and rewriting model.safetensors.index.json. — [inference/fp8_cast_bf16.py#L63-103](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/fp8_cast_bf16.py#L63-L103) [README.md#L242-247](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/README.md#L242-L247)
- Two attention implementations are selectable via the module-level attn_impl global: 'naive' (materializes per-head k/v caches) and 'absorb' (default; caches latent kv + rope pe vectors). — [inference/model.py#L17](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/model.py#L17) [inference/model.py#L439-497](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/model.py#L439-L497)
- Two GEMM paths are selectable via the gemm_impl global: 'bf16' dequantizes FP8 weights then calls F.linear; 'fp8' quantizes activations with act_quant and runs fp8_gemm. — [inference/model.py#L16](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/model.py#L16) [inference/model.py#L131-163](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/model.py#L131-L163)
- MoE gating supports grouped top-k expert routing with either softmax or sigmoid scoring (score_func), an optional learned bias for auxiliary-loss-free balancing, and route_scale weight scaling. — [inference/model.py#L535-598](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/model.py#L535-L598) [inference/configs/config_671B.json](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/configs/config_671B.json)
- YaRN-style RoPE extension is implemented in precompute_freqs_cis using original_seq_len, rope_factor, beta_fast/beta_slow correction ranges, and an mscale-adjusted softmax_scale for long context. — [inference/model.py#L297-375](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/model.py#L297-L375) [inference/model.py#L435-437](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/model.py#L435-L437)
- Four shipped config presets parameterize the same code for different models: config_16B (DeepSeek-V2-Lite-like, q_lora_rank 0, softmax gate), config_236B, config_671B (61 layers, 256 experts, sigmoid gate, fp8), and config_v3.1 (adds scale_fmt ue8m0). — [inference/configs/config_16B.json](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/configs/config_16B.json) [inference/configs/config_236B.json](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/configs/config_236B.json) [inference/configs/config_671B.json](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/configs/config_671B.json) [inference/configs/config_v3.1.json](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/configs/config_v3.1.json)
- model.py doubles as a smoke-test script: its __main__ block builds a default ModelArgs Transformer on CUDA and prints the output logits shape. — [inference/model.py#L801-808](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/model.py#L801-L808)
- The Multi-Token Prediction (MTP) module weights documented in README_WEIGHTS.md (layer 61: enorm, hnorm, eh_proj, shared_head) are not supported by the demo — convert.py explicitly skips any tensor whose name contains 'model.layers.61'. — [README_WEIGHTS.md#L33-48](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/README_WEIGHTS.md#L33-L48) [inference/convert.py#L53-54](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/convert.py#L53-L54)
- Non-rank-0 ranks participate in interactive chat by receiving the prompt via dist.broadcast_object_list, so all ranks stay synchronized through the input loop. — [inference/generate.py#L124-133](https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/generate.py#L124-L133)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
