Skip to main content

1. Model Introduction

DeepSeek V3 is a large-scale Mixture-of-Experts (MoE) language model developed by DeepSeek, designed to deliver strong general-purpose reasoning, coding, and tool-augmented capabilities with high training and inference efficiency. As the latest generation in the DeepSeek model family, DeepSeek V3 introduces systematic architectural and training innovations that significantly improve performance across reasoning, mathematics, coding, and long-context understanding, while maintaining a competitive compute cost. Key highlights include:
  • Efficient MoE architecture: DeepSeek V3 adopts a fine-grained Mixture-of-Experts design with a large number of experts and sparse activation, enabling high model capacity while keeping inference and training costs manageable.
  • Advanced reasoning and coding: The model demonstrates strong performance on mathematical reasoning, logical inference, and real-world coding benchmarks, benefiting from improved data curation and training strategies.
  • Long-context capability: DeepSeek V3 supports extended context lengths, allowing it to handle long documents, complex multi-step reasoning, and agent-style workflows more effectively.
  • Tool use and function calling: The model is trained to support structured outputs and tool invocation, enabling seamless integration with external tools and agent frameworks during inference.

2. SGLang Installation

SGLang offers multiple installation methods. You can choose the most suitable installation method based on your hardware platform and requirements. Please refer to the official SGLang installation guide for installation instructions. For SGLang CPU installation, please refer to the CPU version installation guide.

3. Model Deployment

This section provides a progressive guide from quick deployment to performance optimization, suitable for users at different levels.

3.1 Basic Configuration

Interactive Command Generator: Use the configuration selector below to automatically generate the appropriate deployment command for your hardware platform, model variant, deployment strategy, and thinking capabilities.

3.2 Configuration Tips

Recommended GPU configurations by weight type:
Weight TypeSupported Hardware
FP8 (recommended)8× H200, 8× B200, 8× MI300X, 2×8× H100/H800/H20
BF16 (upcast from FP8)2×8× H200, 2×8× MI300X, 4×8× H100/H800, 4×8× A100/A800
INT816× A100/A800, 32× L40S, Xeon 6980P CPU, 4× Atlas 800I A3
W4A8 / AWQ / MXFP4 / NVFP48× H20/H100, 4× H200; 8× H100/A100; 8/4× MI355X/MI350X; 8/4× B200
The official DeepSeek-V3 checkpoint is already in FP8 format — do not add --quantization fp8 when serving it.
DeepGEMM precompilation (NVIDIA Hopper / Blackwell): Precompile GEMM kernels before the first server run to avoid JIT overhead (~10 min):
DeepGEMM is enabled by default on Hopper/Blackwell and can be disabled with SGLANG_ENABLE_JIT_DEEPGEMM=0. Data Parallelism Attention (--enable-dp-attention): Recommended for high-throughput scenarios with large batch sizes. Reduces KV-cache duplication across TP ranks. Use --enable-dp-attention --tp 8 --dp 8 on a single 8-GPU node. Not recommended for low-latency, small-batch workloads. NCCL timeout: If model loading is slow and you hit an NCCL timeout, increase it: --dist-timeout 3600. Xeon CPU service configuration: Please refer to the Notes part in the serving engine launching section in the SGLang CPU server document to better understand how to configure the arguments, especially for TP (tensor parallel) and NUMA binding settings.

4. Model Invocation

4.1 Basic Usage

For basic API usage and request examples, please refer to:

4.2 Advanced Usage

4.2.1 Reasoning Parser

DeepSeek-V3 supports reasoning mode. Enable the reasoning parser during deployment to separate the thinking and content sections:
Command
Streaming with Thinking Process:
Example
Output Example:
Output
Note: The reasoning parser captures the model’s step-by-step thinking process, allowing you to see how the model arrives at its conclusions.

4.2.2 Tool Calling

DeepSeek-V3 supports tool calling capabilities. Enable the tool call parser: Deployment Command:
Command
Quick Test (curl):
Command
Use a low temperature (e.g. 0) for more consistent tool call results. The --chat-template flag above provides an improved unified prompt for tool use.
Python Example (with Thinking Process):
Example
Output Example:
Output
Note:
  • The reasoning parser shows how the model decides to use a tool
  • Tool calls are clearly marked with the function name and arguments
  • You can then execute the function and send the result back to continue the conversation
Handling Tool Call Results: Please attach the code blocks below to the previous Python script.
Example

4.2.3 Multi-Token Prediction (EAGLE Speculative Decoding)

SGLang implements DeepSeek V3 Multi-Token Prediction (MTP) based on EAGLE speculative decoding. With this optimization, decoding speed improves by up to 1.8× at batch size 1 and 1.5× at batch size 32 on H200 TP8. Enable with:
Command
The default configuration is --speculative-num-steps 3 --speculative-eagle-topk 1 --speculative-num-draft-tokens 4. Find the best values for your workload with bench_speculative.py. The minimum viable config is --speculative-num-steps 1 --speculative-eagle-topk 1 --speculative-num-draft-tokens 2.
For large batch sizes (>48), increase --max-running-requests beyond the default of 48 for MTP. Also set --cuda-graph-bs to include your target batch sizes (default captured sizes for speculative decoding: 48).
The spec-v2 overlap scheduler is enabled by default. It improves performance by overlapping draft and verification stages. Pass --disable-overlap-schedule to disable.

4.2.4 MLA Optimizations

DeepSeek V3 uses Multi-head Latent Attention (MLA), an attention mechanism that improves inference efficiency. SGLang implements several optimizations:
  • Weight Absorption: Reorders matrix multiplications to improve decoding phase efficiency.
  • MLA Attention Backends: FA3, Flashinfer, FlashMLA, CutlassMLA, TRTLLM MLA (Blackwell), and Triton. FA3 is the default.
  • FP8 Quantization: W8A8 FP8 and KV Cache FP8, with BMM operators for weight-absorbed MLA in FP8.
  • CUDA Graph & Torch.compile: Both MLA and MoE support CUDA Graph and Torch.compile for reduced decoding latency.
  • Chunked Prefix Cache: Increases throughput for long-sequence chunked prefill (FlashAttention3 backend only).
Overall, these optimizations achieve up to output throughput improvement vs. the baseline. Reference: See SGLang v0.3 blog and Slides for details.

4.2.5 Multi-Node Deployment

For multi-node serving and hardware-specific examples: Blog references for large-scale deployment:

5. Benchmark

5.1 Speed Benchmark

Test Environment:
  • Hardware: AMD MI300X GPU (8x)
  • Model: DeepSeek-V3
  • Tensor Parallelism: 8
  • sglang version: 0.5.7
We use SGLang’s built-in benchmarking tool to conduct performance evaluation on the ShareGPT_Vicuna_unfiltered dataset. This dataset contains real conversation data and can better reflect performance in actual use scenarios. To simulate real-world usage patterns, we configure each request with 1024 input tokens and 1024 output tokens, representing typical medium-length conversations with detailed responses.

5.1.1 Latency-Sensitive Benchmark

  • Model Deployment Command:
Command
  • Benchmark Command:
Command
  • Test Results:
Output

5.1.2 Throughput-Sensitive Benchmark

  • Model Deployment Command:
Command
  • Benchmark Command:
Command
  • Test Results:
Output

5.2 Accuracy Benchmark

5.2.1 GSM8K Benchmark

  • Benchmark Command:
Command
  • Test Results:
    • DeepSeek-V3
      Output

5.2.2 MMLU Benchmark

  • Benchmark Command:
Command
  • Test Results:
    • DeepSeek-V3
      Output