# PaddleOCR-VL
Source: https://docs.sglang.io/cookbook/autoregressive/Baidu/PaddleOCR-VL
Deploy PaddleOCR-VL 1.6 / 1.5 / 0.9B with SGLang — Baidu's 0.9B NaViT + ERNIE-4.5 document-parsing VLM for OCR, tables, formulas and charts in 109 languages, on a single H100, H200 or B200.
## Deployment
| Variant | Total params | Use |
|---|---|---|
| PaddleOCR-VL-1.6 | 0.9B | Latest. Best tables, Chinese characters and seals; drop-in for 1.5. |
| PaddleOCR-VL-1.5 | 0.9B | Previous generation; pin it if you have calibrated against its output. |
| PaddleOCR-VL | 0.9B | The original 0.9B release. |
| Configuration | TTFT, 1 stream | req/s at 32 concurrent |
|---|---|---|
With --trust-remote-code (remote image processor) |
219 ms | 10.9 |
| Recipe above (native image processor) | 114 ms | 11.3 |
| Prompt | Task |
|---|---|
OCR: |
Plain text recognition. |
Table Recognition: |
Table structure and cell contents. |
Formula Recognition: |
Mathematical expressions. |
Chart Recognition: |
Chart contents. |
Spotting: |
Text with locations. Benefits from the high-detail resolution setting. |
Seal Recognition: |
Seals and stamps (1.6). |
| Mode | Use | Multiple images |
|---|---|---|
tiny |
Lowest prefill cost. | Yes |
small |
Lightweight OCR requests. | Yes |
base |
Balanced quality and cost. | Yes |
large |
Higher resolution single-image OCR. | No |
gundam |
Default high-detail document parsing mode. | No |
| Model | Format | Deploy Panel | Notes |
|---|---|---|---|
| deepreinforce-ai/Ornith-1.0-397B | BF16 | H200 only | Flagship 397B MoE checkpoint; model-card baseline uses TP=8 on an H200 single node. |
| deepreinforce-ai/Ornith-1.0-397B-FP8 | FP8 | H100 / H200 | FP8 repo in the collection; the deploy command uses this repo id with TP=8. |
| deepreinforce-ai/Ornith-1.0-35B | BF16 | H100 / H200 | 35B MoE checkpoint; the deploy command uses TP=2. |
| deepreinforce-ai/Ornith-1.0-35B-FP8 | FP8 | H100 / H200 | FP8 repo in the collection; the deploy command uses this repo id with TP=2. |
| deepreinforce-ai/Ornith-1.0-9B | BF16 | H100 / H200 | Dense 9B checkpoint; the model card describes it as designed for efficient single-GPU deployment. |
| deepreinforce-ai/Ornith-1.0-35B-GGUF | GGUF | No | Listed for completeness; GGUF targets llama.cpp-style local inference, not the SGLang server recipe here. |
| deepreinforce-ai/Ornith-1.0-9B-GGUF | GGUF | No | Listed for completeness; the model card shows llama.cpp and Ollama examples for the GGUF build. |
| Weight Type | Supported 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 |
| INT8 | 16× A100/A800, 32× L40S, Xeon 6980P CPU, 4× Atlas 800I A3 |
| W4A8 / AWQ / MXFP4 / NVFP4 | 8× H20/H100, 4× H200; 8× H100/A100; 8/4× MI355X/MI350X; 8/4× B200 |
| Scenario | Input Length | Output Length | Use Case |
|---|---|---|---|
| **Chat** | 1K | 1K | Most common conversational AI workload |
| **Reasoning** | 1K | 8K | Long-form generation, complex reasoning tasks |
| **Summarization** | 8K | 1K | Document summarization, RAG retrieval |
| Weight Type | Supported 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 |
| INT8 | 16× A100/A800, 32× L40S, Xeon 6980P CPU, 4× Atlas 800I A3 |
| W4A8 / AWQ / MXFP4 / NVFP4 | 8× H20/H100, 4× H200; 8× H100/A100; 8/4× MI355X/MI350X; 8/4× B200 |
| Weight Type | Supported 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 |
| INT8 | 16× A100/A800, 32× L40S, Xeon 6980P CPU, 4× Atlas 800I A3 |
| W4A8 / AWQ / MXFP4 / NVFP4 | 8× H20/H100, 4× H200; 8× H100/A100; 8/4× MI355X/MI350X; 8/4× B200 |
| Scenario | Input Length | Output Length | Use Case |
|---|---|---|---|
| **Chat** | 1K | 1K | Most common conversational AI workload |
| **Reasoning** | 1K | 8K | Long-form generation, complex reasoning tasks |
| **Summarization** | 8K | 1K | Document summarization, RAG retrieval |
| Model | pass\@1 avg-of-4 | majority\@4 | pass\@4 |
|---|---|---|---|
| DeepSeek-V3.2-Exp | 87.50% ± 1.67% | 90.00% | 90.00% |
| DeepSeek-V3.2 | 92.50% ± 1.67% | 94.71% | 96.67% |
| DeepSeek-V3.2-Speciale | 95.00% ± 1.92% | 95.83% | 100.00% |
Panel controls (top of the command box):
sglang serve … for an existing SGLang env, or a docker run … sglang serve … wrap against the per-hardware image from the Install SGLang panel above.localhost:30000 to confirm the server is up.HOST\_IP, PORT, HF\_TOKEN, NODE\_RANK, NODE0\_IP) the command and cURL share. Persists in localStorage across cookbooks.(hw, variant, quant, strategy, nodes) combo has been run end-to-end on real hardware; yellow when auto-derived from a neighbor and not yet re-checked.Panel controls reuse Python / Docker · ⧉ Copy · \$ cURL · ⚙ Env from the Deploy panel, plus one extra:
| Variant | Total params | Active (MoE) | Use |
|---|---|---|---|
| DeepSeek-V4-Flash | 284B | 13B | single-node serving on B200 / B300 / GB200 / GB300 / H200 (TP=4); RTX PRO 6000 (TP=2); H100 (TP=8) |
| DeepSeek-V4-Flash-0731 | 304 | 13B | Flash Official (0731), with a bundled DSpark draft head; verified on 8×B200, 4×GB300, and 4×H200 |
| DeepSeek-V4-Pro | 1.6T | 49B | high-capacity: B200 / B300 (TP=8) · GB300 (TP=4) · H200 FP4 (TP=8) · GB200 (2-node, TP=8) · H200 FP8 (2-node, TP=16) · H100 (2-node, TP=16) |
| DeepSeek-V4-Pro-0813 | 1.65T | 49B | Pro Official (0813), with a bundled DSpark draft head; verified on 4×GB300 (TP=4) · B200 / B300 / H200 FP4 (TP=8) · GB200 (2-node, TP=8) · H100 (2-node, TP=16) · MI355X |
| Scenario | Input Length | Output Length | Use Case |
|---|---|---|---|
| **Chat** | 1K | 1K | Most common conversational AI workload |
| **Reasoning** | 1K | 8K | Long-form generation, complex reasoning tasks |
| **Summarization** | 8K | 1K | Document summarization, RAG retrieval |
| Scenario | Input Length | Output Length | Use Case |
|---|---|---|---|
| **Chat** | 1K | 1K | Most common conversational AI workload |
| **Reasoning** | 1K | 8K | Long-form generation, complex reasoning tasks |
| **Summarization** | 8K | 1K | Document summarization, RAG retrieval |
| Hardware Platform | Docker Image |
|---|---|
| NVIDIA H100 / H200 / B200 | `lmsysorg/sglang:v0.5.12` |
| NVIDIA GB200 / B300 / GB300 (aarch64) | `lmsysorg/sglang:v0.5.12-cu130` |
| AMD MI300X / MI325X | `lmsysorg/sglang:v0.5.12-rocm720-mi30x` |
| AMD MI355X | `lmsysorg/sglang:v0.5.12-rocm720-mi35x` |
| Hardware | NVFP4 | FP8 | BF16 |
|---|---|---|---|
| B200 (8×, single node) | tp=2 / 4 / 8 | tp=4 / 8 | tp=8 |
| GB200 (NVL72, 4× per tray) | tp=2 / 4 | tp=4 | — |
| H200 (8×) | — | tp=8 | tp=8 |
| AMD MI300X / MI325X / MI355X | — | tp=2 / 4 / 8 | tp=4 / 8 |
| Scenario | Input Length | Output Length | Use Case |
|---|---|---|---|
| **Chat** | 1K | 1K | Most common conversational AI workload |
| **Reasoning** | 1K | 8K | Long-form generation, complex reasoning tasks |
| **Summarization** | 8K | 1K | Document summarization, RAG retrieval |
| **Throughput** | 4K | 1K | Mixed RAG / agent / multi-turn conversation (used for the inline B200 / GB200 results below) |
| Scenario | Input Length | Output Length | Use Case |
|---|---|---|---|
| **Chat** | 1K | 1K | Most common conversational AI workload |
| **Reasoning** | 1K | 8K | Long-form generation, complex reasoning tasks |
| **Summarization** | 8K | 1K | Document summarization, RAG retrieval |
| Hardware | FP8 | BF16 |
|---|---|---|
| H100 | tp=16 | tp=32 |
| H200 | tp=8 | tp=16 |
| B200 | tp=8 | tp=16 |
| MI300X/MI325X | — | tp=8 |
| MI355X | — | tp=8 |
| Hardware | NVFP4 | FP8 | BF16 | MXFP4 |
|---|---|---|---|---|
| H100 | — | tp=16 | — | — |
| H200 | — | tp=8 | — | — |
| B300 | tp=8 | — | — | — |
| GB300 | tp=4 | — | — | — |
| MI300X/MI325X | — | tp=8 | tp=8 | — |
| MI355X | — | tp=8 | tp=8 | tp=4 |
| Model | Architecture | Context |
|---|---|---|
| GLM-5.2-FP8 | MoE · DSA · 256 experts (top-8) · MTP · FP8 | 1,048,576 |
| GLM-5.2 | MoE · DSA · 256 experts (top-8) · MTP · BF16 | 1,048,576 |
| GLM-5.2-NVFP4 | MoE · DSA · 256 experts (top-8) · MTP · NVFP4 | 1,048,576 |
| GLM-5.2-MXFP4 | MoE · DSA · 256 experts (top-8) · MTP · MXFP4 | 1,048,576 |
| Tasks | Version | Filter | n-shot | Metric | Value | Stderr | |
|---|---|---|---|---|---|---|---|
| ocrbench | Yaml | none | 0 | ocrbench\_accuracy | ↑ | 0.806 | N/A |
| Model | Architecture | Parameters |
|---|---|---|
| [google/diffusiongemma-26B-A4B-it](https://huggingface.co/google/diffusiongemma-26B-A4B-it) | MoE, uniform-state diffusion (text + image) | 25.2B total / 3.8B active |
| Parameter | Description | Recommended Value |
|---|---|---|
| `--dllm-algorithm` | Diffusion decoding algorithm | `Gemma4Renoise` |
| `--trust-remote-code` | Required to load the checkpoint's modeling code | Always enabled |
| `--dllm-algorithm-config` | Optional YAML overriding the renoise schedule | Checkpoint defaults |
| Benchmark | Score |
|---|---|
| GSM8K | 95.4% |
| ARC-Challenge | 91.6% |
| HumanEval | 92.7% pass\@1 |
| MMLU | 76.2% |
| MMLU-Pro | 73.7% |
| GSM-Symbolic | 92.2% |
| MATH-500 | 72.1% |
| AIME-2026 | 10.0% |
| HMMT-Feb-2025 | 10.0% |
| GPQA-main | 59.2% |
| Multimodal benchmark | Score |
|---|---|
| MMMU (val, MC) | 64.9% |
| MMMU-Pro (standard 10-opt, MC) | 57.3% |
| MathVista (testmini) | 68.4% |
| DocVQA (val) | 85.9% |
| ChartQA (test) | 61.7% |
| AI2D (test) | 78.7% |
| MMStar (val) | 65.9% |
| Model | Architecture | Parameters |
|---|---|---|
| [google/gemma-4-E2B-it](https://huggingface.co/google/gemma-4-E2B-it) | Dense | \~2B |
| [google/gemma-4-E4B-it](https://huggingface.co/google/gemma-4-E4B-it) | Dense | \~4B |
| [google/gemma-4-12B-it](https://huggingface.co/google/gemma-4-12B-it) | Dense | 12B |
| [google/gemma-4-31B-it](https://huggingface.co/google/gemma-4-31B-it) | Dense | 31B |
| [google/gemma-4-26B-A4B-it](https://huggingface.co/google/gemma-4-26B-A4B-it) | MoE | 26B total / 4B active |
| Model | Hardware | TP |
|---|---|---|
| gemma-4-E2B-it | 1x H200 / 1x B200 / 1x B300 / 1x MI300X / 1x MI325X / 1x MI355X | 1 |
| gemma-4-E4B-it | 1x H200 / 1x B200 / 1x B300 / 1x MI300X / 1x MI325X / 1x MI355X | 1 |
| gemma-4-12B-it | 1x H200 / 1x B200 / 1x B300 | 1 |
| gemma-4-31B-it | 2x H200 / 1x B200 / 1x B300 / 1x MI300X / 1x MI325X / 1x MI355X | 2 (H200) / 1 (B200/B300/AMD) |
| gemma-4-26B-A4B-it | 1x H200 / 1x B200 / 1x B300 / 1x MI300X / 1x MI325X / 1x MI355X | 1 |
| Model | Humanities | Social Sciences | STEM | Other | Overall |
|---|---|---|---|---|---|
| gemma-4-E2B-it | 0.621 | 0.739 | 0.830 | 0.736 | **0.720** |
| gemma-4-E4B-it | 0.703 | 0.862 | 0.902 | 0.825 | **0.810** |
| gemma-4-12B-it | 0.784 | 0.888 | 0.946 | 0.861 | **0.859** |
| gemma-4-31B-it | 0.878 | 0.921 | 0.884 | 0.911 | **0.896** |
| gemma-4-26B-A4B-it | 0.853 | 0.906 | 0.938 | 0.886 | **0.891** |
| Model | Accuracy | Invalid | Latency (s) | Output Throughput (tok/s) |
|---|---|---|---|---|
| gemma-4-E2B-it | 0.170 | 0.000 | 3.990 | 8041.739 |
| gemma-4-E4B-it | 0.745 | 0.000 | 4.174 | 4672.030 |
| gemma-4-12B-it | 0.431 | 0.052 | 55.105 | 6580.229 |
| gemma-4-31B-it | 0.805 | 0.005 | 16.148 | 1559.914 |
| gemma-4-26B-A4B-it | 0.450 | 0.010 | 13.001 | 4089.457 |
| Model | Overall |
|---|---|
| gemma-4-E2B-it | **0.307** |
| gemma-4-E4B-it | **0.396** |
| gemma-4-12B-it | **0.683** |
| gemma-4-31B-it | **0.589** |
| gemma-4-26B-A4B-it | **0.549** |
| Model | WER | Avg Latency (s) | Throughput (req/s) |
|---|---|---|---|
| gemma-4-E2B-it | 23.86% | 0.212 | 2.99 |
| gemma-4-E4B-it | 29.55% | 0.366 | 2.46 |
| gemma-4-12B-it | Supported (see §4.5) | — | — |
| gemma-4-31B-it | Not Supported | — | — |
| gemma-4-26B-A4B-it | Not Supported | — | — |
| Model | WER | Avg Latency (s) | Throughput (req/s) |
|---|---|---|---|
| gemma-4-E2B-it | 7.37% | 0.8963s | 16.25 |
| gemma-4-E4B-it | 6.08% | 0.8707s | 16.20 |
| gemma-4-12B-it | Supported (see §4.5) | — | — |
| gemma-4-31B-it | Not Supported | — | — |
| gemma-4-26B-A4B-it | Not Supported | — | — |
| Model | Parameters | Architecture | Context Length | HuggingFace |
|---|---|---|---|---|
| **LLaDA2.1-mini** | 16B | MoE (20 layers, 16 attention heads) | 32,768 tokens | [inclusionAI/LLaDA2.1-mini](https://huggingface.co/inclusionAI/LLaDA2.1-mini) |
| **LLaDA2.1-flash** | 100B | MoE | 32,768 tokens | [inclusionAI/LLaDA2.1-flash](https://huggingface.co/inclusionAI/LLaDA2.1-flash) |
| Parameter | Description | Recommended Value |
|---|---|---|
| `--dllm-algorithm` | Diffusion decoding algorithm | `JointThreshold` |
| `--trust-remote-code` | Required for LLaDA model loading | Always enabled |
| `--mem-fraction-static` | Static memory fraction for KV cache | `0.8` |
| `--max-running-requests` | Maximum concurrent requests | `1` (for best quality) |
| `--attention-backend` | Attention computation backend | `flashinfer` |
| Mode | Threshold | Speed | Quality | Best For |
|---|---|---|---|---|
| **Quality Mode (Q)** | Conservative | Moderate | Higher benchmark scores | Accuracy-critical tasks |
| **Speed Mode (S)** | Aggressive | Very fast, relies on T2T editing | Slightly lower | Throughput-critical tasks |
| Variant | Architecture | Context | License |
|---|---|---|---|
| Intern-S2-Mobius | Mobius-v0 · GDN ×30 + full ×10 · MoE-2560 / top-8 · MTP · BF16 | 262,144 | Apache-2.0 |
| Intern-S2-Mobius-FP8 | Mobius-v0 · GDN ×30 + full ×10 · MoE-2560 / top-8 · MTP · FP8 E4M3 | 262,144 | Apache-2.0 |
Panel controls (top of the command box):
sglang serve … for an existing SGLang env, or a docker run … sglang serve … wrap against the dev image from the Install SGLang panel above.localhost:30000 to confirm the server is up.HOST\_IP, PORT, HF\_TOKEN) the command and cURL share. Persists in localStorage across cookbooks.(hw, variant, quant, strategy, nodes) combo has been run end-to-end on real hardware; yellow when auto-derived from a neighbor and not yet re-checked.Panel controls reuse Python / Docker · ⧉ Copy · \$ cURL · ⚙ Env from the Deploy panel, plus one extra:
| Model | Parameters | Context | Role |
|---|---|---|---|
| LFM2.5-8B-A1B | 8.3B total / 1.5B active (MoE) | 128K | Reasoning-tuned, agentic / tool use |
| LFM2.5-1.2B-Instruct | 1.17B (dense) | 32K | General instruct, RAG, data extraction |
| LFM2.5-1.2B-Thinking | 1.17B (dense) | 32K | Reasoning (always-on chain-of-thought) |
| LFM2.5-350M | 350M (dense) | 32K | Compact instruct, structured output |
| LFM2.5-230M | 230M (dense) | 32K | Most compact; data extraction, structured output |
| LFM2.5-1.2B-JP-202606 | 1.17B (dense) | 32K | Japanese chat (latest) |
| LFM2.5-1.2B-JP | 1.17B (dense) | 32K | Japanese chat (original) |
| LFM2.5-VL-1.6B | 1.2B LM + SigLIP2 400M | 32K | Vision-language (OCR, docs, multi-image) |
| LFM2.5-VL-450M | 350M LM + SigLIP2 86M | 32K | Compact vision-language (captioning, object detection) |
| LFM2.5-1.2B-Base | 1.17B (dense) | 32K | Pre-trained base (no post-training) |
| Model | temperature | extra\_body (sampler) |
|---|---|---|
| LFM2.5-8B-A1B | 0.2 | |
| LFM2.5-1.2B-Instruct | 0.1 | |
| LFM2.5-1.2B-Thinking | 0.05 | |
| LFM2.5-350M | 0.1 | |
| LFM2.5-230M | 0.1 | |
| LFM2.5-1.2B-JP-202606 | 0.1 | |
| LFM2.5-1.2B-JP | 0.3 | |
| LFM2.5-VL-1.6B (text) | 0.1 | |
| LFM2.5-VL-450M (text) | 0.1 | |
| LFM2.5-1.2B-Base | 0.3 |
| Model | Architecture | Serving precision |
|---|---|---|
| LongCat-2.0-FP8 | Sparse MoE · LongCat Sparse Attention · n-gram embedding | FP8 weights, BF16 KV cache |
| Evaluation | Examples | Accuracy |
|---|---|---|
| GSM8K | 200 | 98.0% |
| GSM8K | 1314 | 95.8904109589041% |
| Model | Official | SGLang |
|---|---|---|
| Llama-4-Scout-17B-16E-Instruct | 74.3 | 75.2 |
| Llama-4-Maverick-17B-128E-Instruct | 80.5 | 80.7 |
| Form | Source | Notes |
|---|---|---|
| BF16 | meta-models/Muse-Glimmer-30B |
Supports image input. |
| GGUF Q4\_K\_M | meta-models/Muse-Glimmer-30B-GGUF |
Text only. This path is not optimized. SGLang shows a warning at startup. |
| NVFP4 | RadixArk/Muse-Glimmer-NVFP4 |
Text only. Ready to serve, no conversion needed. |
| MLX Q4 | RadixArk/Muse-Glimmer-q4-MLX |
Text only. Apple Silicon (MLX backend). Same serve recipe as gs128, no measured round yet. See §3.4. |
| MLX Q4\_K\_M (gs128) | RadixArk/Muse-Glimmer-q4km-gs128-MLX |
Text only. Apple Silicon (MLX backend). Carries the vendor GGUF's exact quantization codes in MLX format. The measured MLX artifact. See §3.4. |
| MLX Q4\_K (dynamic) | RadixArk/Muse-Glimmer-q4k-dynamic-MLX |
Text only. Apple Silicon (MLX backend). Same serve recipe as gs128, no measured round yet. See §3.4. |
| Benchmark | SGLang MLX | llama.cpp (same GGUF) |
|---|---|---|
| GSM8K (200q, no-thinking, greedy) | 0.970 | 0.970 |
| CIMemories — violation rate (lower is better) | 0.00% | 8.27% |
| CIMemories — coverage (higher is better) | 76.0% | 68.4% |
| GPUs | Context Length Support |
|---|---|
| 4× 96 GB GPUs | Up to 400K tokens |
| 8× 144 GB GPUs | Up to 3M tokens |
| Parameter | Description | Recommended Value |
|---|---|---|
| `--tool-call-parser` | Tool call parser for function calling support | `minimax-m2` |
| `--reasoning-parser` | Reasoning parser for thinking mode | `minimax-append-think` |
| `--trust-remote-code` | Required for MiniMax model loading | Always enabled |
| `--mem-fraction-static` | Static memory fraction for KV cache | `0.85` |
| `--tp` | Tensor parallelism size | `2` (2-GPU) or `4` (4-GPU) or `8` (8-GPU) |
| `--ep` | Expert parallelism size | `8` (NVIDIA 8-GPU) or EP=TP (AMD) |
| `--kv-cache-dtype` | KV cache data type (AMD only) | `fp8_e4m3` |
| `--attention-backend` | Attention backend (AMD only) | `triton` |
| Hardware Platform | Docker Image |
|---|---|
| NVIDIA A100 / H100 / H200 / B200 | `lmsysorg/sglang:v0.5.10.post1` |
| NVIDIA B300 / GB300 | `lmsysorg/sglang:v0.5.10.post1-cu130` |
| AMD MI300X / MI325X | `lmsysorg/sglang:v0.5.10.post1-rocm720-mi30x` |
| AMD MI355X | `lmsysorg/sglang:v0.5.10.post1-rocm720-mi35x` |
| Parameter | Description | Recommended Value |
|---|---|---|
| `--tool-call-parser` | Tool call parser for function calling support | `minimax-m2` |
| `--reasoning-parser` | Reasoning parser for thinking mode | `minimax-append-think` |
| `--trust-remote-code` | Required for MiniMax model loading | Always enabled |
| `--mem-fraction-static` | Static memory fraction for KV cache | `0.85` |
| `--tp` | Tensor parallelism size | `2` / `4` / `8` depending on hardware |
| `--ep` | Expert parallelism size | `8` (NVIDIA 8-GPU) or EP=TP (AMD) |
| `--kv-cache-dtype` | KV cache data type (AMD only) | `fp8_e4m3` |
| `--attention-backend` | Attention backend (AMD only) | `triton` |
| Evaluation Mode | Accuracy | No Answer |
|---|---|---|
| pass\@1 (avg-of-8) | 84.91% | 3.54% |
| **majority\@8** | **88.89%** | 0.00% |
| pass\@8 | 96.46% | 0.00% |
| Evaluation Mode | Accuracy | No Answer |
|---|---|---|
| pass\@1 (avg-of-8) | 92.50% ± 5.56% | 2.92% |
| **majority\@8** | **97.08%** | 0.00% |
| pass\@8 | 100.00% | 0.00% |
| Evaluation Mode | Accuracy | No Answer |
|---|---|---|
| pass\@1 (greedy) | 69.41% | 18.75% |
| Benchmark | Score |
|---|---|
| HLE w/ tools | 54.0 |
| SWE-Bench Pro | 58.6 |
| SWE-bench Multilingual | 76.7 |
| BrowseComp | 83.2 |
| Toolathlon | 50.0 |
| AIME 2026 | 96.4 |
| GPQA-Diamond | 90.5 |
| LiveCodeBench | 89.6 |
| Precision | GPQA Diamond | SciCode | τ²-Bench Telecom | MMMU Pro | AA-LCR | IFBench |
|---|---|---|---|---|---|---|
| Baseline (INT4) | 90.9 | 52.6 | 98.2 | 75.6 | 71.0 | 73.9 |
| NVFP4 | 90.4 | 54.4 | 98.0 | 76.5 | 71.8 | 73.9 |
| Metric | Value |
|---|---|
| Success Rate | 99.95% (1999/2000) |
| Tool Call Triggered | 970 |
| Tool Call Valid | 89.6% (869/970) |
| Tool Call Invalid (schema error) | 10.4% (101/970) |
| Evaluation Mode | Accuracy |
|---|---|
| pass\@1 (avg-of-32) | 98.9% (29.7/30) |
| majority\@32 | 100.0% (30/30) |
| pass\@32 | 100.0% |
| Evaluation Mode | Accuracy |
|---|---|
| pass\@1 (avg across epochs) | 96.9% |
| Epoch | Accuracy |
|---|---|
| 1 | 96.4% (160/166) |
| 2 | 96.9% (156/161) |
| 3 | 96.9% (155/160) |
| 4 | 98.5% (65/66) |
| Evaluation Mode | Accuracy |
|---|---|
| pass\@1 | 90.8% |
| Evaluation Mode | Accuracy |
|---|---|
| pass\@1 | 82.2% |
| Benchmark | Kimi-K2.6 | Kimi-K2.7-Code |
|---|---|---|
| Kimi Code Bench v2 | 50.9 | 62.0 |
| Program Bench | 48.3 | 53.6 |
| MLS Bench Lite | 26.7 | 35.1 |
| Kimi Claw 24/7 Bench | 42.9 | 46.9 |
| MCP Atlas | 69.4 | 76.0 |
| MCP Mark Verified | 72.8 | 81.1 |
| Category | Benchmark | Kimi-K2.6 | Kimi-K2.7-Code |
|---|---|---|---|
| Coding | Kimi Code Bench v2 | 50.9 | 62.0 |
| Coding | Program Bench | 48.3 | 53.6 |
| Coding | MLS Bench Lite | 26.7 | 35.1 |
| Agentic | Kimi Claw 24/7 Bench | 42.9 | 46.9 |
| Agentic | MCP Atlas | 69.4 | 76.0 |
| Agentic | MCP Mark Verified | 72.8 | 81.1 |
| Checkpoint | Precision | Use |
|---|---|---|
| NVIDIA-Nemotron-3.5-Lightning-30B-A3B-NVFP4 | NVFP4 | Serving — the checkpoint this page deploys |
| NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16 | BF16 | Full-precision reference |
| NVIDIA-Nemotron-3.5-Lightning-30B-A3B-NVFP4-DFlash | W4A16 | DFlash speculative draft model |
| NVIDIA-Nemotron-3.5-Lightning-30B-A3B-NVFP4-DSpark | W4A16 | DSpark speculative draft model |
| Quantization | Hugging Face path |
|---|---|
| BF16 | [`poolside/Laguna-M.1`](https://huggingface.co/poolside/Laguna-M.1) |
| FP8 | [`poolside/Laguna-M.1-FP8`](https://huggingface.co/poolside/Laguna-M.1-FP8) |
| NVFP4 | [`poolside/Laguna-M.1-NVFP4`](https://huggingface.co/poolside/Laguna-M.1-NVFP4) |
| Precision | Target model | Draft model |
|---|---|---|
| BF16 | [`poolside/Laguna-S-2.1`](https://huggingface.co/poolside/Laguna-S-2.1) | [`poolside/Laguna-S-2.1-DFlash`](https://huggingface.co/poolside/Laguna-S-2.1-DFlash) |
| FP8 | [`poolside/Laguna-S-2.1-FP8`](https://huggingface.co/poolside/Laguna-S-2.1-FP8) | [`poolside/Laguna-S-2.1-DFlash-FP8`](https://huggingface.co/poolside/Laguna-S-2.1-DFlash-FP8) |
| NVFP4 | [`poolside/Laguna-S-2.1-NVFP4`](https://huggingface.co/poolside/Laguna-S-2.1-NVFP4) | [`poolside/Laguna-S-2.1-DFlash-NVFP4`](https://huggingface.co/poolside/Laguna-S-2.1-DFlash-NVFP4) |
| INT4 | [`poolside/Laguna-S-2.1-INT4`](https://huggingface.co/poolside/Laguna-S-2.1-INT4) | [`poolside/Laguna-S-2.1-DFlash-INT4`](https://huggingface.co/poolside/Laguna-S-2.1-DFlash-INT4) |
| Precision | Target model | Draft model |
|---|---|---|
| BF16 | [`poolside/Laguna-XS-2.1`](https://huggingface.co/poolside/Laguna-XS-2.1) | [`poolside/Laguna-XS-2.1-DFlash`](https://huggingface.co/poolside/Laguna-XS-2.1-DFlash) |
| FP8 | [`poolside/Laguna-XS-2.1-FP8`](https://huggingface.co/poolside/Laguna-XS-2.1-FP8) | [`poolside/Laguna-XS-2.1-DFlash-FP8`](https://huggingface.co/poolside/Laguna-XS-2.1-DFlash-FP8) |
| NVFP4 | [`poolside/Laguna-XS-2.1-NVFP4`](https://huggingface.co/poolside/Laguna-XS-2.1-NVFP4) | [`poolside/Laguna-XS-2.1-DFlash-NVFP4`](https://huggingface.co/poolside/Laguna-XS-2.1-DFlash-NVFP4) |
| INT4 | [`poolside/Laguna-XS-2.1-INT4`](https://huggingface.co/poolside/Laguna-XS-2.1-INT4) | [`poolside/Laguna-XS-2.1-DFlash-INT4`](https://huggingface.co/poolside/Laguna-XS-2.1-DFlash-INT4) |
| Variant | Hugging Face path |
|---|---|
| BF16 | [`poolside/Laguna-XS.2`](https://huggingface.co/poolside/Laguna-XS.2) |
| FP8 | [`poolside/Laguna-XS.2-FP8`](https://huggingface.co/poolside/Laguna-XS.2-FP8) |
| NVFP4 | [`poolside/Laguna-XS.2-NVFP4`](https://huggingface.co/poolside/Laguna-XS.2-NVFP4) |
| Tasks | Version | Filter | n-shot | Metric | Value | Stderr | ||
|---|---|---|---|---|---|---|---|---|
| mmmu_val | 0 | none | 0 | mmmu_acc | ↑ | 0.6567 | ± | N/A |
| Model | BF16 (Full precision) | FP8 (8-bit Quantized) | FP4 (4-bit Quantized) |
|---|---|---|---|
| Qwen3.5-397B-A17B | [Qwen/Qwen3.5-397B-A17B](https://huggingface.co/Qwen/Qwen3.5-397B-A17B) | [Qwen/Qwen3.5-397B-A17B-FP8](https://huggingface.co/Qwen/Qwen3.5-397B-A17B-FP8) | NVIDIA NVFP4: [nvidia/Qwen3.5-397B-A17B-NVFP4-V2](https://huggingface.co/nvidia/Qwen3.5-397B-A17B-NVFP4-V2) AMD MXFP4: [amd/Qwen3.5-397B-A17B-MXFP4](https://huggingface.co/amd/Qwen3.5-397B-A17B-MXFP4) |
| Qwen3.5-122B-A10B | [Qwen/Qwen3.5-122B-A10B](https://huggingface.co/Qwen/Qwen3.5-122B-A10B) | [Qwen/Qwen3.5-122B-A10B-FP8](https://huggingface.co/Qwen/Qwen3.5-122B-A10B-FP8) | - |
| Qwen3.5-35B-A3B | [Qwen/Qwen3.5-35B-A3B](https://huggingface.co/Qwen/Qwen3.5-35B-A3B) | [Qwen/Qwen3.5-35B-A3B-FP8](https://huggingface.co/Qwen/Qwen3.5-35B-A3B-FP8) | - |
| Qwen3.5-27B | [Qwen/Qwen3.5-27B](https://huggingface.co/Qwen/Qwen3.5-27B) | [Qwen/Qwen3.5-27B-FP8](https://huggingface.co/Qwen/Qwen3.5-27B-FP8) | - |
| Qwen3.5-9B | [Qwen/Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B) | - | - |
| Qwen3.5-4B | [Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B) | - | - |
| Qwen3.5-2B | [Qwen/Qwen3.5-2B](https://huggingface.co/Qwen/Qwen3.5-2B) | - | - |
| Qwen3.5-0.8B | [Qwen/Qwen3.5-0.8B](https://huggingface.co/Qwen/Qwen3.5-0.8B) | - | - |
| Hardware | Memory | BF16 TP | FP8 TP | FP4 TP |
|---|---|---|---|---|
| H100 | 80GB | 16 | 8 | N/A |
| H200 | 141GB | 8 | 4 | N/A |
| B200 | 183GB | 8 | 4 | 4 / 2 + EP2 (MTP) |
| B300 | 275GB | 4 | 2 | 2 |
| MI300X | 192GB | 8 | 4 | N/A |
| MI325X | 256GB | 4 | 2 | N/A |
| MI355X | 288GB | 4 | 2 | 2 / 4 (MXFP4) |
| Model | Architecture | Weights |
|---|---|---|
| Qwen3.6-35B-A3B (BF16) | MoE 35B / 3B active | [Qwen/Qwen3.6-35B-A3B](https://huggingface.co/Qwen/Qwen3.6-35B-A3B) |
| Qwen3.6-35B-A3B (FP8) | MoE 35B / 3B active | [Qwen/Qwen3.6-35B-A3B-FP8](https://huggingface.co/Qwen/Qwen3.6-35B-A3B-FP8) |
| Qwen3.6-35B-A3B (NVFP4) | MoE 35B / 3B active (Blackwell) | [nvidia/Qwen3.6-35B-A3B-NVFP4](https://huggingface.co/nvidia/Qwen3.6-35B-A3B-NVFP4) |
| Qwen3.6-27B (BF16) | Dense 27B | [Qwen/Qwen3.6-27B](https://huggingface.co/Qwen/Qwen3.6-27B) |
| Qwen3.6-27B (FP8) | Dense 27B | [Qwen/Qwen3.6-27B-FP8](https://huggingface.co/Qwen/Qwen3.6-27B-FP8) |
| Qwen3.6-27B (NVFP4) | Dense 27B (Blackwell) | [nvidia/Qwen3.6-27B-NVFP4](https://huggingface.co/nvidia/Qwen3.6-27B-NVFP4) |
| Hardware | Memory | BF16 TP | FP8 TP | NVFP4 TP |
|---|---|---|---|---|
| H100 | 80GB | 1 | 1 | — |
| H200 | 141GB | 1 | 1 | — |
| B200 | 183GB | 1 | 1 | 1 |
| B300 | 275GB | 1 | 1 | 1 |
| Strategy | State slots per request |
|---|---|
--disable-radix-cache |
1 |
no\_buffer |
3 |
extra\_buffer (this model's auto) |
5, or 4 where PP disables the overlap scheduler |
| Tier | Shape | Spec |
|---|---|---|
| Low Latency | TP16 narrow EP | NEXTN 3+1 |
| Balanced | DP4×TP4 + EP16 | NEXTN 3+1 |
| High Throughput | DP4×TP4 + EP16 | off |
| Model | Quantization | Weights |
|---|---|---|
| Qwen3.8-27B | BF16 | Qwen/Qwen3.8-27B |
| Qwen3.8-27B-FP8 | FP8 (blockwise) | Qwen/Qwen3.8-27B-FP8 |
| Qwen3.8-27B-NVFP4 (FP4 head) | NVFP4 W4A4 + FP8 projections, `lm_head` packed to FP4 | RadixArk/Qwen3.8-27B-NVFP4 |
| Qwen3.8-27B-NVFP4 (BF16 head) | Same body, `lm_head` left dense in BF16 | RadixArk/Qwen3.8-27B-NVFP4-BF16-LMHead |
| Field | Default | Purpose |
|---|---|---|
seq |
131072 |
Total sequence budget used by the video flattener. |
audio\_cap |
1.0 |
Maximum fraction of the input budget assigned to audio; 0 disables audio processing. |
audio\_sr |
16000 |
Audio sample rate. |
k\_mode |
eval\_ek |
Deterministic evaluation/sampling mode of the flattener. |
| Parameter | Value |
|---|---|
| `temperature` | 0.7 |
| `top_p` | 0.9 |
| `reasoning_effort` | `high` / `medium` / `low` (thinking) or `none` (instant) |
| Hardware Platform | Docker Image |
|---|---|
| NVIDIA H200 / B200 / B300 / GB300 | `lmsysorg/sglang:latest` |
| Parameter | Description | Recommended Value |
|---|---|---|
| `--tool-call-parser` | Tool call parser for function-calling support | `hunyuan` |
| `--reasoning-parser` | Reasoning parser for hybrid thinking modes | `hunyuan` |
| `--trust-remote-code` | Required for Hunyuan model loading | Always enabled |
| `--mem-fraction-static` | Static memory fraction (KV + activations) | `0.9` |
| `--tp` | Tensor parallelism size | `2` / `4` / `8` depending on hardware |
| `--attention-backend` | Attention backend (Blackwell only) | `trtllm_mha` |
| `--speculative-algorithm` | Speculative decoding via the bundled MTP draft | `EAGLE` + `--speculative-num-steps 3 --speculative-eagle-topk 1 --speculative-num-draft-tokens 4` |
Panel controls (top of the command box):
sglang serve … for an existing SGLang env, or a docker run … sglang serve … wrap against the per-hardware image from the Install SGLang panel above.localhost:30000 to confirm the server is up.HOST\_IP, PORT, HF\_TOKEN, NODE\_RANK, NODE0\_IP) the command and cURL share. Persists in localStorage across cookbooks.(hw, variant, quant, strategy, nodes) combo has been run end-to-end on real hardware; yellow when auto-derived from a neighbor and not yet re-checked.Panel controls reuse Python / Docker · ⧉ Copy · \$ cURL · ⚙ Env from the Deploy panel, plus one extra:
| Parameter | Value |
|---|---|
temperature |
0.9 |
top\_p |
1.0 |
reasoning\_effort |
high / low (thinking) or no\_think (instant) |
| GPU | VRAM | TP | Notes |
|---|---|---|---|
| H200 | 141GB | 8 | minimum single-node for BF16 |
| B200 | 192GB | 4 | BF16 590GB → 148GB/GPU |
| B300 / GB300 | 288GB | 4 | BF16 590GB → 148GB/GPU; ample KV headroom |
| GB200 | 192GB | 4 | single-node 4×192GB = 768GB fits BF16 590GB |
Panel controls (top of the command box):
localhost:30000 to confirm the server is up.HOST\_IP, PORT, NODE\_RANK, NODE0\_IP) the command and cURL share.(hw, variant, quant, strategy, nodes) combo has been run end-to-end on real hardware; yellow when auto-derived from a neighbor and not yet re-checked.| reasoning\_effort | value |
|---|---|
none | 0.0 |
minimal | 0.1 |
low | 0.2 |
medium | 0.7 |
high | 0.9 |
xhigh | 0.99 |
max | 0.99 |
Panel controls (top of the command box):
localhost:30000 to confirm the server is up.HOST\_IP, PORT, NODE\_RANK, NODE0\_IP) the command and cURL share.(hw, variant, quant, strategy, nodes) combo has been run end-to-end on real hardware; yellow when auto-derived from a neighbor and not yet re-checked.| reasoning\_effort | value |
|---|---|
none | 0.0 |
minimal | 0.1 |
low | 0.2 |
medium | 0.7 |
high | 0.9 |
xhigh | 0.99 |
max | 0.99 |
| Variant | Total params | Active (MoE) | Modalities |
|---|---|---|---|
| MiMo-V2.5-Pro | 1.02T | 42B | Text (multimodal planned) |
| MiMo-V2.5 | 310B | 15B | Text, Image, Video, Audio |
| Parameter | Description |
|---|---|
| `--backend` | **Required.** Specifies the backend engine. Options: `sglang`, `sglang-native`, `sglang-oai`, `sglang-oai-chat`, `vllm`, `vllm-chat`, `lmdeploy`, `lmdeploy-chat`, `trt`, `gserver`, `truss`. |
| `--base-url` | The API base URL (if not using specific host/port flags). |
| `--host` | Server hostname. Default: `0.0.0.0`. |
| `--port` | Server port. If not set, it defaults to the specific backend's standard port. |
| `--model` | Model name or path. If unset, it queries `/v1/models` for configuration. |
| `--served-model-name` | The model name used in the API request body. Defaults to the value of `--model`. |
| `--tokenizer` | Path or name of the tokenizer. Defaults to the model configuration. |
| Parameter | Description |
|---|---|
| `--dataset-name` | The type of dataset. Options: `sharegpt`, `custom`, `random`, `random-ids`, `generated-shared-prefix`, `mmmu`, `image`, `mooncake`. |
| `--dataset-path` | File path to the dataset (e.g., local JSON file for ShareGPT). |
| `--num-prompts` | Total number of prompts to process. Default: `1000`. |
| `--seed` | Random seed for reproducibility. |
| `--tokenize-prompt` | Uses integer IDs instead of strings for inputs. Useful for precise length control. |
| Parameter | Description |
|---|---|
| `--request-rate` | Requests per second (RPS). If `inf` (default), all requests are sent immediately (burst). Otherwise, arrival times follow a Poisson process. |
| `--max-concurrency` | The maximum number of active requests allowed at once. Even if `request-rate` is high, the client will hold back requests if this limit is reached. |
| `--warmup-requests` | Number of requests to run before the actual measurement begins to warm up the server. |
| `--flush-cache` | Flushes the server cache before starting the benchmark. |
| Parameter | Description |
|---|---|
| `--output-file` | Path to save the results in JSONL format. |
| `--output-details` | Includes detailed metrics in the output. |
| `--print-requests` | Prints requests to stdout as they are sent (useful for debugging). |
| `--disable-tqdm` | Hides the progress bar. |
| `--disable-stream` | Disables streaming mode (waits for full response). |
| `--return-logprob` | Requests logprobs from the server. |
| `--tag` | An arbitrary string tag added to the output file for identification. |
| Argument | Default | Description |
|---|---|---|
| `--base-url` | `None` | Base URL of the server (e.g., `http://localhost:30000`). If specified, this overrides `--host` and `--port`. |
| `--host` | `None` | The server host (e.g., `127.0.0.1`). |
| `--port` | `None` | The server port. |
| `--model` | `None` | Model name or path. |
| Argument | Choices | Description |
|---|---|---|
| `--task` | `text-to-video`, `image-to-video`, `text-to-image`, `image-to-image`, `video-to-video` | Defines the generation task when it cannot be inferred from the model metadata. |
| `--dataset` | `vbench`, `random` | The source of prompts/inputs. |
| `--dataset-path` | `None` | (Optional) Path to a local dataset file if not using built-in presets. |
| `--num-prompts` | `None` | The total number of prompts/requests to execute during the benchmark. |
| Argument | Description |
|---|---|
| `--width` | The target width for the generated image or video. |
| `--height` | The target height for the generated image or video. |
| `--num-frames` | Number of frames to generate (Specific to Video backends). |
| `--fps` | Frames Per Second configuration (Specific to Video backends). |
| Argument | Description |
|---|---|
| `--request-rate` | The number of requests initiated per second. If set to `inf`, all requests are sent immediately (burst). If set to a number, request arrival times follow a Poisson process. |
| `--max-concurrency` | The maximum number of requests allowed to execute simultaneously. This simulates a semaphore or upstream limit. Even if `request-rate` is high, the actual processing rate is capped by this value. |
| Argument | Description |
|---|---|
| `--output-file` | Path to save the benchmark metrics (JSON format). |
| `--disable-tqdm` | If set, disables the progress bar in the console. |
| Config Field | SGLang CLI Argument | Description |
|---|---|---|
| `tp` | `--tp-size`, `--tensor-parallel-size` | Tensor Parallelism - splits model across GPUs |
| `dp` | `--dp-size`, `--data-parallel-size` | Data Parallelism - runs multiple model replicas |
| `ep` | `--ep-size`, `--expert-parallel-size`, `--ep` | Expert Parallelism - distributes MoE experts |
| `enable_dp_attention` | `--enable-dp-attention` | DP for attention, TP for FFN (hybrid) |
| Parameter | Env Variable | Default | Description |
|---|---|---|---|
| Fn | `SGLANG_CACHE_DIT_FN` | 1 | Number of first blocks to always compute |
| Bn | `SGLANG_CACHE_DIT_BN` | 0 | Number of last blocks to always compute |
| W | `SGLANG_CACHE_DIT_WARMUP` | 4 | Warmup steps before caching starts |
| R | `SGLANG_CACHE_DIT_RDT` | 0.24 | Residual difference threshold |
| MC | `SGLANG_CACHE_DIT_MC` | 3 | Maximum continuous cached steps |
| Parameter | Env Variable | Default | Description |
|---|---|---|---|
| Enable | `SGLANG_CACHE_DIT_TAYLORSEER` | false | Enable TaylorSeer calibrator |
| Order | `SGLANG_CACHE_DIT_TS_ORDER` | 1 | Taylor expansion order (1 or 2) |
| Parameter | Env Variable | Default | Description |
|---|---|---|---|
| Fn | `SGLANG_CACHE_DIT_FN` | 1 | Number of first blocks to always compute |
| Bn | `SGLANG_CACHE_DIT_BN` | 0 | Number of last blocks to always compute |
| W | `SGLANG_CACHE_DIT_WARMUP` | 4 | Warmup steps before caching starts |
| R | `SGLANG_CACHE_DIT_RDT` | 0.24 | Residual difference threshold |
| MC | `SGLANG_CACHE_DIT_MC` | 3 | Maximum continuous cached steps |
| Parameter | Env Variable | Default | Description |
|---|---|---|---|
| Enable | `SGLANG_CACHE_DIT_TAYLORSEER` | false | Enable TaylorSeer calibrator |
| Order | `SGLANG_CACHE_DIT_TS_ORDER` | 1 | Taylor expansion order (1 or 2) |
| Parameter | Env Variable | Default | Description |
|---|---|---|---|
| Fn | `SGLANG_CACHE_DIT_FN` | 1 | Number of first blocks to always compute |
| Bn | `SGLANG_CACHE_DIT_BN` | 0 | Number of last blocks to always compute |
| W | `SGLANG_CACHE_DIT_WARMUP` | 4 | Warmup steps before caching starts |
| R | `SGLANG_CACHE_DIT_RDT` | 0.24 | Residual difference threshold |
| MC | `SGLANG_CACHE_DIT_MC` | 3 | Maximum continuous cached steps |
| Parameter | Env Variable | Default | Description |
|---|---|---|---|
| Enable | `SGLANG_CACHE_DIT_TAYLORSEER` | false | Enable TaylorSeer calibrator |
| Order | `SGLANG_CACHE_DIT_TS_ORDER` | 1 | Taylor expansion order (1 or 2) |
| Parameter | Env Variable | Default | Description |
|---|---|---|---|
| Fn | `SGLANG_CACHE_DIT_FN` | 1 | Number of first blocks to always compute |
| Bn | `SGLANG_CACHE_DIT_BN` | 0 | Number of last blocks to always compute |
| W | `SGLANG_CACHE_DIT_WARMUP` | 4 | Warmup steps before caching starts |
| R | `SGLANG_CACHE_DIT_RDT` | 0.24 | Residual difference threshold |
| MC | `SGLANG_CACHE_DIT_MC` | 3 | Maximum continuous cached steps |
| Parameter | Env Variable | Default | Description |
|---|---|---|---|
| Enable | `SGLANG_CACHE_DIT_TAYLORSEER` | false | Enable TaylorSeer calibrator |
| Order | `SGLANG_CACHE_DIT_TS_ORDER` | 1 | Taylor expansion order (1 or 2) |
| Parameter | Env Variable | Default | Description |
|---|---|---|---|
| Fn | `SGLANG_CACHE_DIT_FN` | 1 | Number of first blocks to always compute |
| Bn | `SGLANG_CACHE_DIT_BN` | 0 | Number of last blocks to always compute |
| W | `SGLANG_CACHE_DIT_WARMUP` | 4 | Warmup steps before caching starts |
| R | `SGLANG_CACHE_DIT_RDT` | 0.24 | Residual difference threshold |
| MC | `SGLANG_CACHE_DIT_MC` | 3 | Maximum continuous cached steps |
| Parameter | Env Variable | Default | Description |
|---|---|---|---|
| Enable | `SGLANG_CACHE_DIT_TAYLORSEER` | false | Enable TaylorSeer calibrator |
| Order | `SGLANG_CACHE_DIT_TS_ORDER` | 1 | Taylor expansion order (1 or 2) |
| origin model | supported LoRA |
|---|---|
| [Wan-AI/Wan2.1-T2V-14B](https://huggingface.co/Wan-AI/Wan2.1-T2V-14B) | [NIVEDAN/wan2.1-lora](https://huggingface.co/NIVEDAN/wan2.1-lora) |
| [Wan-AI/Wan2.1-I2V-14B-720P](https://huggingface.co/Wan-AI/Wan2.1-I2V-14B-720P) | [valiantcat/Wan2.1-Fight-LoRA](https://huggingface.co/valiantcat/Wan2.1-Fight-LoRA) |
| Parameter | Env Variable | Default | Description |
|---|---|---|---|
| Fn | `SGLANG_CACHE_DIT_FN` | 1 | Number of first blocks to always compute |
| Bn | `SGLANG_CACHE_DIT_BN` | 0 | Number of last blocks to always compute |
| W | `SGLANG_CACHE_DIT_WARMUP` | 4 | Warmup steps before caching starts |
| R | `SGLANG_CACHE_DIT_RDT` | 0.24 | Residual difference threshold |
| MC | `SGLANG_CACHE_DIT_MC` | 3 | Maximum continuous cached steps |
| Parameter | Env Variable | Default | Description |
|---|---|---|---|
| Enable | `SGLANG_CACHE_DIT_TAYLORSEER` | false | Enable TaylorSeer calibrator |
| Order | `SGLANG_CACHE_DIT_TS_ORDER` | 1 | Taylor expansion order (1 or 2) |
| origin model | supported LoRA |
|---|---|
| [Wan-AI/Wan2.2-I2V-A14B-Diffusers](https://huggingface.co/Wan-AI/Wan2.2-I2V-A14B-Diffusers) | [lightx2v/Wan2.2-Distill-Loras](https://huggingface.co/lightx2v/Wan2.2-Distill-Loras) |
| [Wan-AI/Wan2.2-T2V-A14B-Diffusers](https://huggingface.co/Wan-AI/Wan2.2-T2V-A14B-Diffusers) | [Cseti/wan2.2-14B-Arcane\_Jinx-lora-v1](https://huggingface.co/Cseti/wan2.2-14B-Arcane_Jinx-lora-v1) |
| Parameter | Env Variable | Default | Description |
|---|---|---|---|
| Fn | `SGLANG_CACHE_DIT_FN` | 1 | Number of first blocks to always compute |
| Bn | `SGLANG_CACHE_DIT_BN` | 0 | Number of last blocks to always compute |
| W | `SGLANG_CACHE_DIT_WARMUP` | 4 | Warmup steps before caching starts |
| R | `SGLANG_CACHE_DIT_RDT` | 0.24 | Residual difference threshold |
| MC | `SGLANG_CACHE_DIT_MC` | 3 | Maximum continuous cached steps |
| Parameter | Env Variable | Default | Description |
|---|---|---|---|
| Enable | `SGLANG_CACHE_DIT_TAYLORSEER` | false | Enable TaylorSeer calibrator |
| Order | `SGLANG_CACHE_DIT_TS_ORDER` | 1 | Taylor expansion order (1 or 2) |
| Target Model | EAGLE3 Draft Model |
|---|---|
| meta-llama/Llama-3.1-8B-Instruct | [🤗 Hugging Face](https://huggingface.co/lmsys/SGLang-EAGLE3-Llama-3.1-8B-Instruct-SpecForge) |
| meta-llama/Llama-3.3-70B-Instruct | [🤗 Hugging Face](https://huggingface.co/lmsys/SGLang-EAGLE3-Llama-3.3-70B-Instruct-SpecForge) |
| meta-llama/Llama-4-Scout-17B-16E-Instruct | [🤗 Hugging Face](https://huggingface.co/lmsys/SGLang-EAGLE3-Llama-4-Scout-17B-16E-Instruct-SpecForge) |
| meta-llama/Llama-4-Maverick-17B-128E-Instruct | [🤗 Hugging Face \*](https://huggingface.co/lmsys/sglang-EAGLE3-Llama-4-Maverick-17B-128E-Instruct-v1) |
| Target Model | EAGLE3 Draft Model |
|---|---|
| Qwen/Qwen3-30B-A3B-Instruct-2507 | [🤗 Hugging Face](https://huggingface.co/lmsys/SGLang-EAGLE3-Qwen3-30B-A3B-Instruct-2507-SpecForge-Nex) |
| Qwen/Qwen3-235B-A22B-Instruct-2507 | [🤗 Hugging Face](https://huggingface.co/lmsys/SGLang-EAGLE3-Qwen3-235B-A22B-Instruct-2507-SpecForge-Meituan) |
| Qwen/Qwen3-Next-80B-A3B-Instruct-FP8 | [🤗 Hugging Face](https://huggingface.co/lmsys/SGLang-EAGLE3-Qwen3-Next-80B-A3B-Instruct-FP8-perfect-blend-regenerated) |
| Target Model | EAGLE3 Draft Model |
|---|---|
| Qwen/Qwen3-Coder-30B-A3B-Instruct | [🤗 Hugging Face](https://huggingface.co/lmsys/SGLang-EAGLE3-Qwen3-Coder-30B-A3B-Instruct-SpecForge) |
| Qwen/Qwen3-Coder-480B-A35B-Instruct | [🤗 Hugging Face](https://huggingface.co/lmsys/SGLang-EAGLE3-Qwen3-Coder-480B-A35B-Instruct-SpecForge-EigenAI) |
| Target Model | EAGLE3 Draft Model |
|---|---|
| inclusionAI/Ling-flash-2.0 | [🤗 Hugging Face](https://huggingface.co/AQ-MedAI/Ling-Flash-2.0-eagle3) |
| Target Model | EAGLE3 Draft Model |
|---|---|
| moonshotai/Kimi-K2-Instruct | [🤗 Hugging Face](https://huggingface.co/AQ-MedAI/Kimi-K2-Instruct-eagle3) |
| Target Model | EAGLE3 Draft Model |
|---|---|
| openai/gpt-oss-20b | [🤗 Hugging Face +](https://huggingface.co/zhuyksir/EAGLE3-gpt-oss-20b-bf16) |
| openai/gpt-oss-120b | [🤗 Hugging Face +](https://huggingface.co/lmsys/EAGLE3-gpt-oss-120b-bf16) |
| Target Model | EAGLE3 Draft Model |
|---|---|
| nex-agi/Qwen3-30B-A3B-Nex-N1 | [🤗 Hugging Face](https://huggingface.co/nex-agi/SGLANG-EAGLE3-Qwen3-30B-A3B-Nex-N1) |
| nex-agi/Qwen3-32B-Nex-N1 | [🤗 Hugging Face](https://huggingface.co/nex-agi/SGLANG-EAGLE3-Qwen3-32B-Nex-N1) |
| Key | Default | Meaning |
|---|---|---|
candidate\_steps |
required | Candidate speculative\_num\_steps tiers for this BS range. Must be a non-empty list of positive ints; a slot that omits it raises a config error |
down\_hysteresis |
-0.25 |
Extra margin before moving to a smaller step |
up\_hysteresis |
0.0 |
Extra margin before moving to a larger step |
ceiling\_coeff |
0 (disabled) |
EMA ceiling coefficient; set > 0 to cap steps proportionally to draft quality |
| Key | Default | Meaning |
|---|---|---|
ema\_alpha |
0.2 |
EMA smoothing factor for accepted draft length |
update\_interval |
5 |
Recompute interval, in verify batches, after warmup |
warmup\_batches |
10 |
Number of verify batches to observe before switching |
| **Backend** | **Page Size > 1 (native)** | **FP8 KV Cache** | **FP4 KV Cache** | **Spec topk=1** | **Spec topk>1** | **Sliding Window** | **MultiModal** |
|---|---|---|---|---|---|---|---|
| **FlashInfer** | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ |
| **FA3 (FlashAttention 3)** | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ |
| **FA4 (FlashAttention 4)** | 128 | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **Triton** | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **Torch Native (SDPA)** | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ |
| **FlexAttention (PyTorch)** | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ |
| **TRTLLM MHA** | 16, 32 or 64 | ✅ | ✅ | ✅ | ❌ | ✅ | ❌ |
| **Dual Chunk FlashAttention** | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| **HPC-Ops** | 64 | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| **AITER (ROCm)** | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ |
| **Wave (ROCm)** | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| **Ascend (NPU)** | ✅ | ❌ | ❌ | ✅ | ❌ | ✅ | ✅ |
| **Intel XPU** | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ |
| **Intel AMX (CPU)** | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| **Backend** | **Native Page Sizes** | **FP8 KV Cache** | **FP4 KV Cache** | **Chunked Prefix Cache** | **Spec topk=1** | **Spec topk>1** |
|---|---|---|---|---|---|---|
| **FlashInfer MLA** | 1 | ❌ | ✅ | ✅ | ✅ | ❌ |
| **FlashMLA** | 64 | ✅ | ✅ | ✅ | ✅ | ❌ |
| **Cutlass MLA** | 128 | ✅ | ✅ | ✅ | ✅ | ❌ |
| **TRTLLM MLA (Blackwell)** | 32 or 64 | ✅ | ✅ | ✅ | ✅ | ❌ |
| **CuteDSL MLA (Blackwell)** | 32 or 64 | ✅ | ❌ | ✅ | ✅ | ❌ |
| **TokenSpeed MLA (Blackwell)** | 32 or 64 | ✅ (required) | ❌ | ✅ | ✅ | ❌ |
| **FA3 (FlashAttention 3)** | n/a | ❌ | ❌ | ✅ | ✅ | ⚠️ (page\_size=1 only) |
| **Triton** | n/a | ❌ | ❌ | ❌ | ✅ | ⚠️ (page\_size=1 only) |
| **FA4** | 1 | ❌ | ✅ | ✅ | ❌ | ❌ |
| **Ascend MLA (NPU)** | 128 | ❌ | ❌ | ❌ | ❌ | ❌ |
| Backend | Decode | Prefill / Extend | Spec Decoding (Target Verify) |
|---|---|---|---|
| Triton (CUDA) | ✅ | ✅ | ✅ |
| Triton (AMD/ROCm) | ✅ | ✅ | ✅ |
| Triton (NPU) | ✅ | ✅ | ❌ |
| Triton (CPU) | ✅ | ✅ | ❌ |
| CuTe DSL (CUDA only) | ✅ | ❌ | ❌ |
| FlashInfer (CUDA, SM90/SM100/SM103) | ✅ | ✅ | ✅ linear chain; tree falls back to Triton |
| Sub-backend | Prefill | Decode | Notes |
|---|---|---|---|
| flashmla\_sparse | ✅ | ✅ | Default prefill on Hopper and Blackwell (BF16) |
| flashmla\_sparse\_q8 | ✅ | ❌ | Native FP8 (q8×kv8) sparse prefill on Hopper (SM90); requires --kv-cache-dtype fp8\_e4m3 |
| flashmla\_kv | ✅ | ✅ | Default for FP8 on Hopper (prefill + decode) |
| flashmla\_auto | ✅ | ❌ | Picks flashmla\_sparse or flashmla\_kv by KV cache dtype |
| fa3 | ✅ | ✅ | Default decode on Hopper (BF16) |
| trtllm | ✅ | ✅ | Default decode on Blackwell (BF16); default for FP8 on Blackwell (prefill + decode) |
| tilelang | ✅ | ✅ | Default on AMD (ROCm) |
| aiter | ✅ | ✅ | AMD-specific kernel library (requires aiter package) |
| Argument | Default | Description |
|---|---|---|
--debug-cuda-graph |
False |
Enable debug/eager mode. Wraps the entire forward pass in a graph break so every op runs eagerly through the capture/replay path. |
SGLANG\_USE\_BREAKABLE\_CUDA\_GRAPH |
0 |
Environment variable. Enables breakable CUDA graph without debug mode. Required for @eager\_on\_graph decorators to take effect. |
| File | Description |
|---|---|
python/sglang/srt/model\_executor/runner\_backend\_utils/breakable\_cuda\_graph/breakable\_cuda\_graph.py |
Core implementation: eager\_on\_graph, BreakableCUDAGraph, BreakableCUDAGraphCapture |
python/sglang/srt/model\_executor/runner\_backend\_utils/breakable\_cuda\_graph/cuda\_utils.py |
CUDA runtime binding utilities (NVIDIA stream-capture queries) |
python/sglang/srt/model\_executor/runner\_backend/breakable\_cuda\_graph\_backend.py |
Integration with CUDA graph runner backends |
python/sglang/srt/server\_args.py |
--debug-cuda-graph flag and environment variable handling |
python/sglang/srt/environ.py |
SGLANG\_USE\_BREAKABLE\_CUDA\_GRAPH environment variable definition |
| Attention Backend | CUDA Graph | Chunked Prefill | Radix Cache | Non-greedy Sampling (Temp > 0) |
|---|---|---|---|---|
| **FlashInfer** | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes |
| **FlashAttention 3 (FA3)** | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
| **Triton** | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
| Argument | Type/Default | Description |
|---|---|---|
| `--enable-deterministic-inference` | flag; default: disabled | Enable deterministic inference with batch-invariant operations |
| `--attention-backend` | string; default: fa3 | Choose attention backend (flashinfer, fa3, or triton) |
|
|
Each DP replica:
Communication patterns in DPA + EP:
|
| Feature | Native DP | SMG-Based DP |
|---|---|---|
| Load Balancing | Built-in in-process methods | Advanced policies (cache-aware, power-of-two, etc.) |
| Cache Awareness | ❌ No | ✅ Yes - significantly higher cache hit rate |
| Throughput | Baseline | Significant improvement |
| Multi-Node Support | Limited | ✅ Full support |
| Worker Health Monitoring | Basic | ✅ Circuit breakers, health checks |
| Reliability | Basic | ✅ Retries, rate limiting, queuing |
| Observability | Basic metrics | ✅ 40+ Prometheus metrics, OpenTelemetry |
| Hot Worker Add/Remove | ❌ No | ✅ Yes |
| Metric | Without Cache-Aware | With Cache-Aware SMG |
|---|---|---|
| Throughput (token/s) | 82,665 | 158,596 (+92%) |
| Cache Hit Rate | 20% | 75% (+275%) |
| Policy | Description | Best For |
|---|---|---|
cache\_aware |
Combines cache locality with load balancing | Recommended for most workloads |
round\_robin |
Cycles through workers in order | Simple, predictable distribution |
random |
Random worker selection | Baseline, testing |
power\_of\_two |
Samples two workers, picks lighter one | Low latency requirements |
| Strategy | Use Case | Key Benefit |
|---|---|---|
Native DP (--dp-size) |
Never | Easy to understand, not rust based |
| SMG-Based DP | Production (recommended) | Cache-aware routing, high availability |
DPA (--dp-size N --enable-dp-attention) |
DeepSeek/MLA models | Eliminates KV cache duplication, improved throughput |
| DPA + EP | DeepSeek MoE models | Significant throughput improvement vs vanilla TP |
| Backend | Description | Use Cases |
|---|---|---|
| **`none` (default)** | Disables all-to-all for EP. Uses All-Reduce or All-Gather for token dispatch. | Hybrid EP and TP setups. |
| `deepep` | DeepEP, a communication library for efficient token shuffling in MoE models. | Large-scale EP deployments. |
| `mooncake` | An extension of DeepEP for elastic inference, leveraging RDMA for high-performance data transfers. | Elastic EP serving. |
nixl |
NIXL-EP, an elastic EP communication library built on NVIDIA's NIXL framework with native RDMA and NVLink support. | Elastic EP serving with fault tolerance and dynamic scaling. |
mori |
MORI-EP, AMD's native all-to-all communication implementation optimized for ROCm. | AMD GPU deployments. |
| `flashinfer` | Flashinfer implementation of all-to-all. | Large-scale EP deployments. |
| `ascend_fuseep` | Ascend NPU native fused all-to-all communication. | Ascend NPU deployments. |
| `pplx` | pplx-kernels, Perplexity's NVSHMEM-based all-to-all dispatch/combine kernels. Low-latency (masked) only; targets FP8 (DeepGEMM) MoE models on Hopper. Requires NVSHMEM 3.2.5, nvshmem4py, cuda-python, and a prebuilt libpplx\_kernels.so (sm\_90a). |
Low-latency decode EP on Hopper. |
| Backend | Description | Use Cases |
|---|---|---|
| **`auto` (default)** | Automatically selects the optimal backend based on model architecture, hardware (e.g., NVIDIA architecture like Ampere, Hopper, Blackwell), quantization scheme (e.g., FP8, FP4), and runtime conditions. | General-purpose deployments; ensures compatibility and performance without user intervention. |
| `triton` | Triton-based implementation for grouped GEMMs. To achieve higher performance, it's highly recommended to create tuned configurations. | Custom kernel development or scenarios requiring high extensibility with Torch compilation support. |
| `deep_gemm` | DeepGEMM backend optimized for MoE matrix multiplications, supporting contiguous layouts for prefill and masked layouts for decode; often JIT-compiled for performance. | Large-scale EP deployments with FP8 block-wise quantization. |
| `cutlass` | CUTLASS-based backend for efficient GEMMs. | NVIDIA architectures with CUTLASS support. |
| `flashinfer_trtllm` | FlashInfer integrated with TensorRT-LLM for accelerated MoE computations, supporting FP4 communication operators and high-performance GEMMs. | Blackwell with TRT-LLM. |
flashinfer\_trtllm\_routed |
FlashInfer integrated with TensorRT-LLM for accelerated routed MoE computations, consuming SGLang-computed top-k expert assignments and weights. Compatible with flashinfer all-to-all. | Blackwell with TRT-LLM. |
| `flashinfer_cutlass` | FlashInfer combined with CUTLASS for high-performance grouped GEMMs in MoE layers, handling FP4/FP8 quantization efficiently. Compatible with flashinfer all-to-all. | Blackwell with FP4/FP8 models. |
| `flashinfer_mxfp4` | FlashInfer variant optimized for MXFP4 (mixed FP4) quantization in MoE runners, focusing on memory-efficient low-precision inference. | Low-precision models with MXFP4. |
| `flashinfer_cutedsl` | FlashInfer with a custom DSL for flexible and efficient MoE kernel generation, integrated with ModelOpt FP4 quantization. Compatible with flashinfer all-to-all. | Low-precision models with NVFP4. |
| Argument | Type / Default | Description |
|---|---|---|
--enable-hisparse |
flag; default: disabled | Enable HiSparse on the decode instance |
--hisparse-config |
JSON string | Configuration for HiSparse (see below) |
| Parameter | Type / Default | Description |
|---|---|---|
top\_k |
int | Number of topk entries |
device\_buffer\_size |
int | Number of token slots in the per-request GPU device buffer |
host\_to\_device\_ratio |
int | Ratio of logical pool size to device pool size, determining host memory capacity |
swap\_in\_block\_size |
int / 960 | CUDA thread-block size for the HiSparse swap-in kernel |
| Format | Description |
|---|---|
auto |
Default. Load safetensors if available, otherwise fall back to the PyTorch .bin format. |
safetensors |
Load weights in the safetensors format. |
pt |
Load weights in the PyTorch .bin format. |
npcache |
Load PyTorch-format weights and store a numpy cache to speed up subsequent loads. Only supports .bin checkpoints. |
dummy |
Initialize weights with random values, for profiling. |
sharded\_state |
Each tensor-parallel worker reads only its own pre-sharded shard rather than the full checkpoint, giving a fast load path for large TP models. See examples/runtime/engine/save\_sharded\_state.py for creating a sharded checkpoint. |
fastsafetensors |
Load safetensors using the fastsafetensors iterator. |
layered |
Load weights layer by layer, so a layer can be quantized before the next is loaded, lowering the peak memory envelope. |
gguf |
Load weights in the GGUF format. Auto-detected from a .gguf model path. |
bitsandbytes |
Load weights using bitsandbytes quantization. |
mistral |
Load a Mistral native-format checkpoint. Auto-detected for such checkpoints. |
flash\_rl |
Load a BF16/FP16 checkpoint with native SGLang FP8 quantization for RL training. Requires --rl-quant-profile. |
runai\_streamer |
Stream weights from SSDs, shared filesystems, or object storage. See Loading Models from Object Storage. |
remote |
Load tensors from a remote KV/filesystem connector. Auto-detected for remote URIs. |
remote\_instance |
Pull weights over the network from another running SGLang instance (the "seed") rather than from disk. Configured with the --remote-instance-weight-loader-\* flags. |
| Load format | Key | Description | Default |
|---|---|---|---|
auto / safetensors / pt / npcache |
enable\_multithread\_load (bool) |
Read weight shards with a thread pool instead of sequentially. Disabled by default when --weight-loader-prefetch-checkpoints is set (to avoid I/O oversubscription with the prefetch threads); set this to true to opt back in. |
true |
auto / safetensors / pt / npcache |
num\_threads (int) |
Number of worker threads when multithreaded loading is enabled. | 8 |
sharded\_state |
pattern (str) |
Filename pattern for per-rank shards. | model-rank-\{rank}-part-\{part}.safetensors |
fastsafetensors |
enable\_gds (bool) |
Use GPU Direct Storage. Set to false when the host does not provide the NVIDIA GPUDirect Storage kernel driver, such as in a gVisor sandbox. |
true |
bitsandbytes |
qlora\_adapter\_name\_or\_path (str) |
QLoRA adapter to apply on top of the bitsandbytes-quantized base weights. | — |
runai\_streamer |
distributed, concurrency, memory\_limit |
Streaming controls. See Loading Models from Object Storage. | See linked page |
| Flag | Description | Default |
|---|---|---|
--download-dir |
Directory used to download and cache Hugging Face model files. | HF default |
--weight-loader-disable-mmap |
Disable mmap while loading safetensors. Can help on filesystems where mmap is slow. | off |
--weight-loader-prefetch-checkpoints |
Prefetch checkpoint files into the OS page cache before loading. Each rank prefetches a fraction of the shards, cutting total network I/O on shared filesystems (NFS/Lustre) from N×checkpoint to 1×checkpoint. Recommended for models on network storage. When enabled, multi-threaded safetensors loading is disabled by default to avoid I/O oversubscription with the prefetch threads; set enable\_multithread\_load=true in --model-loader-extra-config to keep multi-threaded loading (e.g. on local NVMe where prefetch is a no-op). |
off |
--weight-loader-prefetch-num-threads |
Threads per rank for checkpoint prefetching. | 4 |
--weight-loader-drop-cache-after-load |
Call posix\_fadvise(DONTNEED) after successfully loading each shard, freeing page cache. Supported by the standard safetensors and fastsafetensors loaders. |
off |
--custom-weight-loader |
Import path(s) of a custom weight-loading function, e.g. my\_package.weight\_load\_func. |
— |
| Parameter | Type | Description | Default |
|---|---|---|---|
distributed |
bool | Enable distributed streaming for multi-GPU setups. Automatically set to true for object storage paths on CUDA-like devices. |
Auto-detected |
concurrency |
int | Number of concurrent download streams. Higher values can improve throughput for large models. | 4 |
memory\_limit |
int | Memory limit (in bytes) for the streaming buffer. | System-dependent |
| Variable | Description | Default |
|---|---|---|
| **`SGLANG_DISAGGREGATION_THREAD_POOL_SIZE`** | Controls the total number of worker threads for KVCache transfer operations per TP rank | A dynamic value calculated by int(0.75 \* os.cpu\_count()) // 8, which is limited to be larger than 4 and less than 12 to ensure efficiency and prevent thread race conditions |
| **`SGLANG_DISAGGREGATION_QUEUE_SIZE`** | Sets the number of parallel transfer queues. KVCache transfer requests from multiple decode instances will be sharded into these queues so that they can share the threads and the transfer bandwidth at the same time. If it is set to 1, then we transfer requests one by one according to fcfs strategy |
`4` |
| **`SGLANG_DISAGGREGATION_BOOTSTRAP_TIMEOUT`** | Timeout (seconds) for receiving destination KV indices during request initialization | `300` |
SGLANG\_DISAGGREGATION\_BOOTSTRAP\_ENTRY\_CLEANUP\_INTERVAL |
Interval (seconds) between cleanups of bootstrap entries | 120 |
| Variable | Description | Default |
|---|---|---|
| **`SGLANG_DISAGGREGATION_HEARTBEAT_INTERVAL`** | Interval (seconds) between health checks to prefill bootstrap servers | `5.0` |
| **`SGLANG_DISAGGREGATION_HEARTBEAT_MAX_FAILURE`** | Consecutive heartbeat failures before marking prefill server offline | `2` |
| **`SGLANG_DISAGGREGATION_WAITING_TIMEOUT`** | Timeout (seconds) for receiving KV Cache after request initialization | `300` |
| Variable | Description | Default |
|---|---|---|
SGLANG\_DISAGG\_STAGING\_BUFFER |
Enable GPU staging buffer for heterogeneous TP KV transfer | False |
SGLANG\_DISAGG\_STAGING\_POOL\_SIZE\_MB |
Decode-side ring buffer pool total size in MB | 4096 |
| Argument | Default | Description |
|---|---|---|
--disable-piecewise-cuda-graph |
False |
Disable PCG for extend/prefill. |
--enforce-piecewise-cuda-graph |
False |
Force-enable PCG, skipping all auto-disable conditions. For testing only. |
--piecewise-cuda-graph-max-tokens |
None (auto) |
Maximum token count to capture. Defaults to chunked\_prefill\_size (non-MLA) or 2048 (MLA). |
--piecewise-cuda-graph-tokens |
None (auto) |
Explicit list of token lengths to capture. Auto-generated if not set. |
--piecewise-cuda-graph-compiler |
"eager" |
Compiler backend for the captured subgraphs. Choices: eager, inductor. |
--enable-piecewise-cuda-graph |
— | Deprecated. PCG is now enabled by default. Use --enforce-piecewise-cuda-graph to skip auto-disable conditions. |
| Token range | Step size |
|---|---|
| 4 – 32 | 4 |
| 48 – 256 | 16 |
| 288 – 512 | 32 |
| 576 – 1024 | 64 |
| 1280 – 4096 | 256 |
| 4096+ | 512 |
| File | Description |
|---|---|
python/sglang/srt/model\_executor/runner\_backend/tc\_piecewise\_cuda\_graph\_backend.py |
Backend implementation: compile, capture, replay |
python/sglang/srt/compilation/compile.py |
install\_torch\_compiled trampoline |
python/sglang/srt/compilation/backend.py |
SGLangBackend, graph splitting, piecewise compilation |
python/sglang/srt/compilation/cuda\_piecewise\_backend.py |
Per-subgraph CUDA graph capture/replay |
python/sglang/srt/compilation/piecewise\_context\_manager.py |
Global context flags and ForwardContext |
python/sglang/srt/compilation/compilation\_config.py |
Capture sizes, split ops, compiler config |
python/sglang/srt/utils/custom\_op.py |
register\_custom\_op for torch.compile compatibility |
python/sglang/srt/server\_args.py |
Server arguments and auto-disable logic |
| Method | NVIDIA GPUs | AMD GPUs (MI300X/MI325X/MI350X) | Ascend NPUs (A2/A3/A5) | Notes |
|---|---|---|---|---|
fp8 |
Yes | Yes | WIP | Aiter or Triton backend on AMD |
mxfp4 |
Yes | Yes | Yes (A5) | On GPU: requires CDNA3/CDNA4 with MXFP support (uses Aiter). On Ascend NPU (A5): W4A4 MXFP4 for Qwen3 dense and MoE LLMs (MXFP4 weights + activations) — dense models support online dual-level MXFP4; offline W4A4\_MXFP4 dense and MoE checkpoints (single-level) are auto-detected via modelslim |
mxfp8 |
No | No | Yes (A5 for Diffusion, LLM Dense Linear and LLM MoE) | Ascend NPU only; online + offline MXFP8 for Diffusion models (e.g., Wan2.2), LLM Dense Linear, and LLM MoE (FusedMoE, e.g. Qwen3-30B-A3B) on A5 series; uses CANN npu\_dynamic\_mx\_quant / npu\_quant\_matmul (dense) and npu\_grouped\_matmul\_swiglu\_quant\_v2 / npu\_grouped\_matmul (MoE) kernels |
mxfp\_w4a8 |
No | No | Yes (A5) | Ascend NPU only; online W4A8 for Qwen3 dense LLM (MXFP4 weights + MXFP8 activations) on A5 series; offline W4A8\_MXFP dense and MoE checkpoints are auto-detected via modelslim |
blockwise\_int8 |
Yes | Yes | No | Triton-based, works on both platforms |
w8a8\_int8 |
Yes | Yes | No | |
w8a8\_fp8 |
Yes | Yes | No | Aiter or Triton FP8 on AMD |
awq |
Yes | Yes | Yes | Uses Triton dequantize on AMD (vs. optimized CUDA kernels on NVIDIA). Uses CANN kernels on Ascend |
gptq |
Yes | Yes | Yes | Uses Triton or vLLM kernels on AMD. Uses CANN kernels on Ascend |
compressed-tensors |
Yes | Yes | Partial | Aiter paths for FP8/MoE on AMD. Uses CANN kernels on Ascend, FP8 not supported yet |
quark |
Yes | Yes | No | AMD Quark quantization; Aiter GEMM paths on AMD |
auto-round |
Yes | Yes | Partial | Platform-agnostic (Intel auto-round). Uses CANN kernels on Ascend |
quark\_int4fp8\_moe |
No | Yes | No | AMD-only; online INT4-to-FP8 MoE quantization (CDNA3/CDNA4) |
awq\_marlin |
Yes | No | No | Marlin kernels are CUDA-only |
gptq\_marlin |
Yes | No | No | Marlin kernels are CUDA-only |
gguf |
Yes | No | Yes | CUDA kernels in sgl-kernel; Ascend uses CPU pre-dequantization at load time |
modelopt / modelopt\_fp8 |
Yes (Hopper/SM90+) | No | No | NVIDIA ModelOpt; requires NVIDIA hardware |
modelopt\_fp4 |
Yes (SM80-SM90 via Marlin; SM100+ native FP4) | No | No | NVIDIA ModelOpt; use Marlin W4A16 fallback on Ampere/Hopper and native FP4 backends on Blackwell; supports load-time BF16/FP16/FP8 MoE conversion with per-tensor FP32 activation scales |
nvfp4\_online |
Yes (Blackwell/SM100 or SM103) | No | No | Online MoE-only NVFP4 weight quantization with per-token FP32 activation scales for BF16/FP16/FP8 checkpoints; use modelopt\_fp4 for per-tensor FP32 activation scales; requires flashinfer\_trtllm or flashinfer\_trtllm\_routed |
petit\_nvfp4 |
No | Yes (MI250/MI300X/MI325X) | No | Enables NVFP4 on ROCm via Petit; use modelopt\_fp4 on NVIDIA Blackwell. Auto-selected when loading NVFP4 models on AMD. See LMSYS blog and AMD ROCm blog. |
bitsandbytes |
Yes | Experimental | No | Depends on bitsandbytes ROCm support |
modelslim |
No | No | Yes | Ascend quantization; Uses CANN kernels |
| Backend | Hardware | Description |
|---|---|---|
auto |
All | Auto-selects based on hardware |
deep\_gemm |
SM90, SM100 | JIT-compiled; enabled when DeepGEMM is installed |
flashinfer\_trtllm |
SM100 | FlashInfer TensorRT-LLM backend; optimal for low-latency |
flashinfer\_cutlass |
SM100/120 | FlashInfer CUTLASS groupwise FP8 GEMM |
flashinfer\_deepgemm |
SM90 | Uses swapAB optimization for small M dimensions in decoding |
cutlass |
SM120 | sgl-kernel CUTLASS |
triton |
All | Fallback; widely compatible |
aiter |
ROCm | AMD AITER backend |
| Backend | Hardware | Description |
|---|---|---|
auto |
SM80+ | Auto-selects: flashinfer\_cutedsl on SM100; marlin on SM80-SM90; flashinfer\_cutlass otherwise (including SM120) |
flashinfer\_cutlass |
SM100/120 | FlashInfer CUTLASS backend |
flashinfer\_cudnn |
SM100/120 (CUDA 13+, cuDNN 9.15+) | FlashInfer cuDNN backend |
flashinfer\_cutedsl |
SM100 | FlashInfer CuTe DSL backend |
flashinfer\_trtllm |
SM100 | FlashInfer TensorRT-LLM backend |
marlin |
SM80-SM90 | Weight-only W4A16 fallback for NVFP4 checkpoints |
| Model | Dataset | KV16 | KV8 (FP8 E4M3) | KV4 (FP4 E2M1) |
|---|---|---|---|---|
| Qwen3-235B-A22B | gsm8k | 0.9168 | 0.9181 | 0.9186 |
| Qwen3-235B-A22B | aime25 | 0.7733 | 0.7333 | 0.6000 |
| Qwen3-235B-A22B | gpqa\_diamond | 0.7010 | 0.6899 | 0.6778 |
| DeepSeek-R1-0528 | gsm8k | 0.9157 | 0.9154 | 0.9124 |
| DeepSeek-R1-0528 | aime25 | 0.5067 | 0.4934 | 0.4000 |
| DeepSeek-R1-0528 | gpqa\_diamond | 0.7707 | 0.7697 | 0.7273 |
| Model | Dataset | KV16 | KV8 (FP8 E4M3) | KV4 (FP4 E2M1) |
|---|---|---|---|---|
| GPT-OSS-120B | gsm8k | 0.9161 | 0.9163 | 0.9152 |
| GPT-OSS-120B | aime25 | 0.7533 | 0.7667 | 0.3533 |
| GPT-OSS-120B | gpqa\_diamond | 0.5081 | 0.5434 | 0.3202 |
| Model | Reasoning tags | Parser | Notes |
|---|---|---|---|
| [Apertus 2509 models](https://huggingface.co/swiss-ai/Apertus-8B-Instruct-2509) | `<|inner_prefix|>` … `<|inner_suffix|>` | `apertus2509` | Supports `enable_thinking` parameter |
| [DeepSeek‑R1 series](https://huggingface.co/collections/deepseek-ai/deepseek-r1-678e1e131c0169c0bc89728d) | ` |
`deepseek-r1` | Supports all variants (R1, R1-0528, R1-Distill) |
| [DeepSeek‑V3 series](https://huggingface.co/deepseek-ai/DeepSeek-V3.1) | ` |
`deepseek-v3` | Including [DeepSeek‑V3.2](https://huggingface.co/deepseek-ai/DeepSeek-V3.2-Exp). Supports `thinking` parameter |
| [Standard Qwen3 models](https://huggingface.co/collections/Qwen/qwen3-67dd247413f0e2e4f653967f) | ` |
`qwen3` | Supports `enable_thinking` parameter |
| [Qwen3-Thinking models](https://huggingface.co/Qwen/Qwen3-235B-A22B-Thinking-2507) | ` |
`qwen3` or `qwen3-thinking` | Always generates thinking content |
| [Kimi K2 Thinking](https://huggingface.co/moonshotai/Kimi-K2-Thinking) | `◁think▷` … `◁/think▷` | `kimi_k2` | Uses special thinking delimiters. Also requires `--tool-call-parser kimi_k2` for tool use. |
| [GPT OSS](https://huggingface.co/openai/gpt-oss-120b) | `<|channel|>analysis<|message|>` … `<|end|>` | `gpt-oss` | N/A |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--model-path` `--model` |
The path of the model weights. This can be a local folder or a Hugging Face repo ID. | ` None` | Type: str |
| `--tokenizer-path` | The path of the tokenizer. | ` None` | Type: str |
| `--tokenizer-mode` | Tokenizer mode. 'auto' will use the fast tokenizer if available, and 'slow' will always use the slow tokenizer. | `auto` | auto, slow |
| `--tokenizer-backend` | Tokenizer backend. 'huggingface' uses the default HuggingFace tokenizers library; 'fastokens' uses the fastokens library for faster tokenization. Requires the fastokens package to be installed. |
`huggingface` | huggingface, fastokens |
| `--tokenizer-worker-num` | The worker num of the tokenizer manager. | `1` | Type: int |
| `--skip-tokenizer-init` | If set, skip init tokenizer and pass input\_ids in generate request. | `False` | bool flag (set to enable) |
| `--load-format` | The format of the model weights to load. "auto" will try to load the weights in the safetensors format and fall back to the pytorch bin format if safetensors format is not available. "pt" will load the weights in the pytorch bin format. "safetensors" will load the weights in the safetensors format. "npcache" will load the weights in pytorch format and store a numpy cache to speed up the loading. "dummy" will initialize the weights with random values, which is mainly for profiling."gguf" will load the weights in the gguf format. "bitsandbytes" will load the weights using bitsandbytes quantization."layered" loads weights layer by layer so that one can quantize a layer before loading another to make the peak memory envelope smaller. "flash\_rl" will load the weights in flash\_rl format. "fastsafetensors" and "private" are also supported. "runai\_streamer" enables direct model loading from object storage and shared file systems. | `auto` | auto, pt, safetensors, npcache, dummy, sharded\_state, gguf, bitsandbytes, mistral, layered, flash\_rl, remote, remote\_instance, fastsafetensors, private, runai\_streamer |
| `--model-loader-extra-config` | Extra config for model loader. This will be passed to the model loader corresponding to the chosen load\_format. | `{}` | Type: str |
| `--trust-remote-code` | Whether or not to allow for custom models defined on the Hub in their own modeling files. | `False` | bool flag (set to enable) |
| `--context-length` | The model's maximum context length. Defaults to None (will use the value from the model's config.json instead). | ` None` | Type: int |
| `--is-embedding` | Whether to use a CausalLM as an embedding model. | `False` | bool flag (set to enable) |
| `--enable-multimodal` | Enable the multimodal functionality for the served model. If the model being served is not multimodal, nothing will happen. | ` None` | bool flag (set to enable) |
| `--revision` | The specific model version to use. It can be a branch name, a tag name, or a commit id. If unspecified, will use the default version. | ` None` | Type: str |
| `--model-impl` | Which implementation of the model to use. "auto" will try to use the SGLang implementation if it exists and fall back to the Transformers implementation if no SGLang implementation is available. "sglang" will use the SGLang model implementation. "transformers" will use the Transformers model implementation. | `auto` | Type: str |
| `--detokenizer-worker-num` | The worker num of the detokenizer manager. | `1` | Type: int |
| `--prefill-only-disable-kv-cache` | Skip the physical KV cache allocation for embedding-mode prefill-only workloads. Currently only valid with --is-embedding, --chunked-prefill-size=-1, --disable-radix-cache, an FA prefill backend, and non-FP4 KV cache so the fa\_skip\_kv\_cache path is active (no layer reads or writes the cache). Other prefill-only workloads such as scoring/MIS may benefit from this later once their attention paths stop using paged KV. Scheduler admission accounting is unchanged; per-layer K/V tensors are sized to (page\_size, head\_num, head\_dim) placeholders so GPU memory is not wasted. | `False` | bool flag (set to enable) |
| `--model-config-parser` | Which model-config parser to use. "auto" picks "mistral" via the is\_mistral\_model name heuristic, else "hf" (AutoConfig over config.json). Plugins can register additional parsers via @register\_model\_config\_parser. | `auto` | Type: str |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--host` | The host of the HTTP server. | `127.0.0.1` | Type: str |
| `--port` | The port of the HTTP server. | `30000` | Type: int |
| `--fastapi-root-path` | App is behind a path based routing proxy. | `""` | Type: str |
| `--grpc-mode` | If set, use gRPC server instead of HTTP server. | `False` | bool flag (set to enable) |
| `--skip-server-warmup` | If set, skip warmup. | `False` | bool flag (set to enable) |
| `--warmups` | Specify custom warmup functions (csv) to run before server starts eg. --warmups=warmup\_name1,warmup\_name2 will run the functions `warmup_name1` and `warmup_name2` specified in warmup.py before the server starts listening for requests | `None` | Type: str |
| `--nccl-port` | The port for NCCL distributed environment setup. Defaults to a random port. | `None` | Type: int |
| `--checkpoint-engine-wait-weights-before-ready` | If set, the server will wait for initial weights to be loaded via checkpoint-engine or other update methods before serving inference requests. | `False` | bool flag (set to enable) |
| `--ssl-keyfile` | The file path to the SSL key file. | `None` | Type: str |
| `--ssl-certfile` | The file path to the SSL certificate file. | `None` | Type: str |
| `--ssl-ca-certs` | The CA certificates file. | `None` | Type: str |
| `--ssl-keyfile-password` | The password to decrypt the SSL keyfile. | `None` | Type: str |
| `--enable-ssl-refresh` | Enable automatic SSL certificate hot-reloading when cert/key files change on disk. Requires --ssl-certfile and --ssl-keyfile. | `False` | bool flag (set to enable) |
| `--enable-http2` | Use Granian instead of Uvicorn as the ASGI server, enabling HTTP/1.1 and HTTP/2 auto-negotiation. Clients may use h2c (cleartext HTTP/2) or plain HTTP/1.1. Requires 'pip install sglang\[http2]'. | `False` | bool flag (set to enable) |
| `--http2-max-concurrent-streams` | Maximum number of concurrent streams advertised on each HTTP/2 connection (1 to 2^32 - 1). Only applies with --enable-http2. | `200` | Type: int |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--dtype` | Data type for model weights and activations. \* "auto" will use FP16 precision for FP32 and FP16 models, and BF16 precision for BF16 models. \* "half" for FP16. Recommended for AWQ quantization. \* "float16" is the same as "half". \* "bfloat16" for a balance between precision and range. \* "float" is shorthand for FP32 precision. \* "float32" for FP32 precision. | `auto` | auto, half, float16, bfloat16, float, float32 |
| `--quantization` | The quantization method. | `None` | awq, fp8, mxfp8, gptq, marlin, gptq\_marlin, awq\_marlin, bitsandbytes, gguf, modelopt, modelopt\_fp8, modelopt\_fp4, nvfp4\_online, modelopt\_mixed, petit\_nvfp4, w8a8\_int8, w8a8\_fp8, moe\_wna16, w4afp8, mxfp4, auto-round, compressed-tensors, modelslim, quark, quark\_int4fp8\_moe, quark\_mxfp4, mlx\_q4, mlx\_q8, unquant |
| `--quantization-param-path` | Path to the JSON file containing the KV cache scaling factors. This should generally be supplied, when KV cache dtype is FP8. Otherwise, KV cache scaling factors default to 1.0, which may cause accuracy issues. | `None` | Type: Optional\[str] |
| `--kv-cache-dtype` | Data type for kv cache storage. "auto" will use model data type. "bf16" or "bfloat16" for BF16 KV cache. "fp8\_e5m2" and "fp8\_e4m3" are supported for CUDA 11.8+. "nvfp4" selects the NVFP4 FP4 E2M1 KV cache recipe; "fp4\_mx\_block16" selects the block-size-16 FP4 E2M1 KV cache recipe. Both require CUDA 12.8+ and PyTorch 2.8.0+ | `auto` | auto, fp8\_e5m2, fp8\_e4m3, bf16, bfloat16, nvfp4, fp4\_mx\_block16 |
| `--enable-fp32-lm-head` | If set, the LM head outputs (logits) are in FP32. | `False` | bool flag (set to enable) |
| `--modelopt-quant` | The ModelOpt quantization configuration. Supported values: 'fp8', 'int4\_awq', 'w4a8\_awq', 'nvfp4', 'nvfp4\_awq'. This requires the NVIDIA Model Optimizer library to be installed: pip install nvidia-modelopt | `None` | Type: str |
| `--modelopt-checkpoint-restore-path` | Path to restore a previously saved ModelOpt quantized checkpoint. If provided, the quantization process will be skipped and the model will be loaded from this checkpoint. | `None` | Type: str |
| `--modelopt-checkpoint-save-path` | Path to save the ModelOpt quantized checkpoint after quantization. This allows reusing the quantized model in future runs. | `None` | Type: str |
| `--modelopt-export-path` | Path to export the quantized model in HuggingFace format after ModelOpt quantization. The exported model can then be used directly with SGLang for inference. If not provided, the model will not be exported. | `None` | Type: str |
| `--quantize-and-serve` | Quantize the model with ModelOpt and immediately serve it without exporting. This is useful for development and prototyping. For production, it's recommended to use separate quantization and deployment steps. | `False` | bool flag (set to enable) |
| `--rl-quant-profile` | Path to the FlashRL quantization profile. Required when using --load-format flash\_rl. | `None` | Type: str |
| `--enable-quant-communications` | Enable INT8 quantization of TP communications (Supported only for NPU for Qwen3 series). | `False` | bool flag (set to enable) |
| `--enable-tf32-matmul` | Enable float32 matmuls to use TensorFloat32 precision for better performance (via torch.set\_float32\_matmul\_precision). CUDA only. Automatically enabled for MiniMax-M2 and GLM-4 models. | `False` | bool flag (set to enable) |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--mem-fraction-static` | The fraction of the memory used for static allocation (model weights and KV cache memory pool). Use a smaller value if you see out-of-memory errors. When unset, it is computed as `(GPU memory - reserved memory) / GPU memory`, defaulting to `0.88` if GPU memory cannot be detected. | `None` | Type: float |
| `--max-running-requests` | The maximum number of running requests. | `None` | Type: int |
| `--max-queued-requests` | The maximum number of queued requests. This option is ignored when using disaggregation-mode. | `None` | Type: int |
| `--max-total-tokens` | The maximum number of tokens in the memory pool. If not specified, it will be automatically calculated based on the memory usage fraction. This option is typically used for development and debugging purposes. | `None` | Type: int |
| `--chunked-prefill-size` | The maximum number of tokens in a chunk for the chunked prefill. Setting this to -1 means disabling chunked prefill. | `None` | Type: int |
| `--prefill-max-requests` | The maximum number of requests in a prefill batch. If not specified, there is no limit. | `None` | Type: int |
| `--enable-dynamic-chunking` | Enable dynamic chunk size adjustment for pipeline parallelism. When enabled, chunk sizes are dynamically calculated based on fitted function to maintain consistent execution time across chunks. | `False` | bool flag (set to enable) |
| `--max-prefill-tokens` | The maximum number of tokens in a prefill batch. The real bound will be the maximum of this value and the model's maximum context length. | `16384` | Type: int |
| `--schedule-policy` | The scheduling policy of the requests. | `fcfs` | lpm, random, fcfs, dfs-weight, lof, priority, routing-key |
| `--enable-priority-scheduling` | Enable priority scheduling. Requests with higher priority integer values will be scheduled first by default. | `False` | bool flag (set to enable) |
| `--abort-on-priority-when-disabled` | If set, abort requests that specify a priority when priority scheduling is disabled. | `False` | bool flag (set to enable) |
| `--schedule-low-priority-values-first` | If specified with --enable-priority-scheduling, the scheduler will schedule requests with lower priority integer values first. | `False` | bool flag (set to enable) |
| `--priority-scheduling-preemption-threshold` | Minimum difference in priorities for an incoming request to have to preempt running request(s). | `10` | Type: int |
| `--schedule-conservativeness` | How conservative the schedule policy is. A larger value means more conservative scheduling. Use a larger value if you see requests being retracted frequently. | `1.0` | Type: float |
| `--page-size` | The number of tokens in a page. | `1` | Type: int |
| `--enable-page-major-kv-layout` | Enable the page-major KV layout: lay out the Mamba state and full/SWA KV caches in a page-granularity envelope (page is the outermost axis, layer-major within a page) instead of the default per-layer (layer-major) layout. Requires the Triton attention / linear-attn / Mamba backends (`--attention-backend triton`, and for hybrid models `--linear-attn-backend triton --mamba-backend triton`). | `False` | bool flag (set to enable) |
| `--enable-unified-memory` | For hybrid Mamba/GDN and hybrid SWA models, replace the statically-partitioned pools (full-attention KV + SWA/Mamba conv/SSM state) with a single byte buffer split dynamically between the sub-pools, so KV-vs-state capacity flexes with the workload instead of being fixed at startup. Implies `--enable-page-major-kv-layout`. Requires the Triton attention / linear-attn / Mamba backends; monolithic (decode) cuda-graph capture only; not yet compatible with PD disaggregation or speculative decoding. | `False` | bool flag (set to enable) |
| `--swa-full-tokens-ratio` | The ratio of SWA layer KV tokens / full layer KV tokens, regardless of the number of swa:full layers. It should be between 0 and 1. E.g. 0.5 means if each swa layer has 50 tokens, then each full layer has 100 tokens. | `0.8` | Type: float |
| `--disable-hybrid-swa-memory` | Disable the hybrid SWA memory. | `False` | bool flag (set to enable) |
| `--radix-eviction-policy` | The eviction policy of radix trees. 'lru' stands for Least Recently Used, 'lfu' stands for Least Frequently Used. | `lru` | lru, lfu, slru, priority |
| `--enable-prefill-delayer` | Enable prefill delayer for DP attention to reduce idle time. | `False` | bool flag (set to enable) |
| `--prefill-delayer-max-delay-passes` | Maximum forward passes to delay prefill. | `30` | Type: int |
| `--prefill-delayer-token-usage-low-watermark` | Token usage low watermark for prefill delayer. | `None` | Type: float |
| `--prefill-delayer-queue-min-ratio` | Opt-in to the adaptive queue-based delay trigger (independent of the slot-based one). Defers prefill until the waiting queue reaches `min(running_req * ratio, max_prefill_bs)` so small fragments batch into a larger prefill. Unset keeps the original slot-only behavior. Typical: `0.1`–`0.5`. | `None` | Type: float |
| `--prefill-delayer-max-delay-ms` | Wall-clock cap (ms) on a single queue-trigger delay; once exceeded, prefill is force-released to bound worst-case TTFT. Only consulted when `--prefill-delayer-queue-min-ratio` is set. Typical: `1000`–`5000`. | `None` | Type: float |
| `--prefill-delayer-forward-passes-buckets` | Custom buckets for prefill delayer forward passes histogram. 0 and max\_delay\_passes-1 will be auto-added. | `None` | List\[float] |
| `--prefill-delayer-wait-seconds-buckets` | Custom buckets for prefill delayer wait seconds histogram. 0 will be auto-added. | `None` | List\[float] |
| `--disable-priority-preemption` | Disable priority scheduling preemption. | `False` | bool flag (set to enable) |
| `--default-priority-value` | Default priority for requests without explicit priority. | `None` | Type: int |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--device` | The device to use ('cuda', 'xpu', 'hpu', 'npu', 'cpu'). Defaults to auto-detection if not specified. | `None` | Type: str |
| `--tensor-parallel-size` `--tp-size` |
The tensor parallelism size. | `1` | Type: int |
| `--pipeline-parallel-size` `--pp-size` |
The pipeline parallelism size. | `1` | Type: int |
| `--attention-context-parallel-size` `--attn-cp-size` |
The attention context parallelism size. | `1` | Type: int |
| `--dcp-size` `--decode-context-parallel-size` |
The decode context parallelism size. See Decode Context Parallelism. | `1` | Type: int |
| `--dcp-comm-backend` | Communication backend for the DCP attention reduction: AllGather + ReduceScatter, fused NCCL All-to-All, or FlashInfer MNNVL All-to-All. | `ag_rs` | ag\_rs, a2a, fi\_a2a |
| `--dcp-replicate-q-proj` | For MLA DCP with the a2a/fi\_a2a backend: replicate the Q projection so each DCP rank computes the full-head query locally. Use --no-dcp-replicate-q-proj to disable the model-specific default. |
None |
bool flag (set to enable) |
| `--moe-data-parallel-size` `--moe-dp-size` |
The moe data parallelism size. | `1` | Type: int |
| `--pp-max-micro-batch-size` | The maximum micro batch size in pipeline parallelism. | None |
Type: int |
| `--pp-async-batch-depth` | The async batch depth of pipeline parallelism. | `0` | Type: int |
| `--stream-interval` | The interval (or buffer size) for streaming in terms of the token length. A smaller value makes streaming smoother, while a larger value makes the throughput higher | `1` | Type: int |
| `--incremental-streaming-output` | Whether to output as a sequence of disjoint segments. | `False` | bool flag (set to enable) |
| `--random-seed` | The random seed. | None |
Type: int |
| `--mlx-enable-sampling` | MLX backend only: sample decode tokens (temperature / top-k / top-p / min-p) instead of greedy argmax. Sampling runs inside the lazy MLX graph, so it works with the overlap scheduler; first tokens from prefill/extend are sampled too. Greedy requests keep exact argmax behavior. Also enables on the MLX path: grammar vocab masks and custom logit processors (these break decode chaining per step; custom processors run on pure-decode steps only), logit\_bias, output logprobs (sampled token / top-k / token\_ids; prompt input logprobs are not computed), NaN sanitization (SGLANG\_SANITIZE\_NAN\_LOGITS), and per-request sampling\_seed under --enable-deterministic-inference (deterministic within MLX only). Penalties are not applied. | `False` | bool flag (set to enable) |
| `--constrained-json-whitespace-pattern` | (outlines and llguidance backends only) Regex pattern for syntactic whitespaces allowed in JSON constrained output. For example, to allow the model to generate consecutive whitespaces, set the pattern to \[\n\t ]\* | None |
Type: str |
| `--constrained-json-disable-any-whitespace` | (xgrammar and llguidance backends only) Enforce compact representation in JSON constrained output. | `False` | bool flag (set to enable) |
| `--watchdog-timeout` | Set watchdog timeout in seconds. If a forward batch takes longer than this, the server will crash to prevent hanging. | `300` | Type: float |
| `--soft-watchdog-timeout` | Set soft watchdog timeout in seconds. If a forward batch takes longer than this, the server will dump information for debugging. | `None` | Type: float |
| `--dist-timeout` | Set timeout for torch.distributed initialization. | `None` | Type: int |
| `--download-dir` | Model download directory for huggingface. | None |
Type: str |
| `--model-checksum` | Model file integrity verification. If provided without value, uses model-path as HF repo ID. Otherwise, provide checksums JSON file path or HuggingFace repo ID. | None |
Type: str |
| `--base-gpu-id` | The base GPU ID to start allocating GPUs from. Useful when running multiple instances on the same machine. | `0` | Type: int |
| `--gpu-id-step` | The delta between consecutive GPU IDs that are used. For example, setting it to 2 will use GPU 0,2,4,... | `1` | Type: int |
| `--sleep-on-idle` | Reduce CPU usage when sglang is idle. | `False` | bool flag (set to enable) |
| `--custom-sigquit-handler` | Register a custom sigquit handler so you can do additional cleanup after the server is shutdown. This is only available for Engine, not for CLI. | `None` | Type: str |
| `--batch-notify-size` | Number of streaming notifications to batch before yielding to the event loop. Reduces asyncio wakeup overhead under high concurrency. | `16` | Type: int |
| `--stream-response-default-include-usage` | Include usage in every streaming response (even when stream\_options is not specified). | `False` | bool flag (set to enable) |
| `--stream-output` | \[Deprecated] Use --incremental-streaming-output instead. | — | Type: str |
| `--enable-streaming-session` | Enable streaming session mode and StreamingSession wrapper. | `False` | bool flag (set to enable) |
| `--load-snapshot-publish-interval` | Publish load snapshot to shared memory every N decode iterations. Prefill and idle always publish immediately. | `15` | Type: int |
| `--use-ray` | Use Ray actors for scheduler process management. | `False` | bool flag (set to enable) |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--log-level` | The logging level of all loggers. | `info` | Type: str |
| `--log-level-http` | The logging level of HTTP server. If not set, reuse --log-level by default. | `None` | Type: str |
| `--log-requests` | Log metadata, inputs, outputs of all requests. The verbosity is decided by --log-requests-level | `False` | bool flag (set to enable) |
| `--log-requests-level` | 0: Log metadata (no sampling parameters). 1: Log metadata and sampling parameters. 2: Log metadata, sampling parameters and partial input/output. 3: Log every input/output. | `2` | 0, 1, 2, 3 |
| `--log-requests-format` | Format for request logging: 'text' (human-readable) or 'json' (structured) | `text` | text, json |
| `--log-requests-target` | Target(s) for request logging: 'stdout' and/or directory path(s) for file output. Can specify multiple targets, e.g., '--log-requests-target stdout /my/path'. | `None` | List\[str] |
| `--uvicorn-access-log-exclude-prefixes` | Exclude uvicorn access logs whose request path starts with any of these prefixes. Defaults to empty (disabled). | `[]` | List\[str] |
| `--crash-dump-folder` | Folder for crash diagnostics. Stores completed requests retained by the crash-dump buffer plus in-flight requests and, on NVIDIA CUDA, configures device coredumps under this folder. Existing CUDA coredump environment variables take precedence. If not specified, this option does not enable request crash dumping or set CUDA coredump defaults. | `None` | Type: str |
| `--show-time-cost` | Show time cost of custom marks. | `False` | bool flag (set to enable) |
| `--enable-metrics` | Enable log prometheus metrics. | `False` | bool flag (set to enable) |
| `--enable-mfu-metrics` | Enable estimated MFU-related prometheus metrics. | `False` | bool flag (set to enable) |
| `--enable-metrics-for-all-schedulers` | Enable --enable-metrics-for-all-schedulers when you want schedulers on all TP ranks (not just TP 0) to record request metrics separately. This is especially useful when dp\_attention is enabled, as otherwise all metrics appear to come from TP 0. | `False` | bool flag (set to enable) |
| `--tokenizer-metrics-custom-labels-header` | Specify the HTTP header for passing custom labels for tokenizer metrics. | `x-custom-labels` | Type: str |
| `--tokenizer-metrics-allowed-custom-labels` | The custom labels allowed for tokenizer metrics. The labels are specified via a dict in '--tokenizer-metrics-custom-labels-header' field in HTTP requests, e.g., \{'label1': 'value1', 'label2': 'value2'} is allowed if '--tokenizer-metrics-allowed-custom-labels label1 label2' is set. | `None` | List\[str] |
| `--bucket-time-to-first-token` | The buckets of time to first token, specified as a list of floats. | `None` | List\[float] |
| `--bucket-inter-token-latency` | The buckets of inter-token latency, specified as a list of floats. | `None` | List\[float] |
| `--bucket-e2e-request-latency` | The buckets of end-to-end request latency, specified as a list of floats. | None |
List\[float] |
| `--collect-tokens-histogram` | Collect prompt/generation tokens histogram. | False |
bool flag (set to enable) |
| `--prompt-tokens-buckets` | The buckets rule of prompt tokens. Supports 3 rule types: 'default' uses predefined buckets; 'tse \ |
`None` | List\[str] |
| `--generation-tokens-buckets` | The buckets rule for generation tokens histogram. Supports 3 rule types: 'default' uses predefined buckets; 'tse \ |
None |
List\[str] |
| `--gc-warning-threshold-secs` | The threshold for long GC warning. If a GC takes longer than this, a warning will be logged. Set to 0 to disable. | `0.0` | Type: float |
| `--decode-log-interval` | The log interval of decode batch. | `40` | Type: int |
| `--enable-request-time-stats-logging` | Enable per request time stats logging | `False` | bool flag (set to enable) |
| `--kv-events-config` | Config in json format for NVIDIA dynamo KV event publishing. Publishing will be enabled if this flag is used. | None |
Type: str |
| `--enable-trace` | Enable opentelemetry trace | `False` | bool flag (set to enable) |
| `--trace-modules` | Select the components to trace. Available options are 'request' and 'mooncake'. Format: \ |
`request` | Type: str |
| `--otlp-traces-endpoint` | Config opentelemetry collector endpoint if --enable-trace is set. format: \ |
`localhost:4317` | Type: str |
| `--grpc-http-sidecar-port` | Port for the HTTP sidecar server in gRPC mode (--grpc-mode). Serves Prometheus metrics and profiling endpoints. Defaults to --port + 1. Not used in HTTP mode. | `None` | Type: int |
| `--extra-metric-labels` | The custom labels for metrics. e.g. '\{"label1": "value1", "label2": "value2"}' | `None` | Type: str |
| `--enable-forward-pass-metrics` | Enable per-iteration forward pass metrics via ZMQ IPC. External consumers (e.g. Dynamo planner) subscribe to the IPC endpoint exposed in server\_args.forward\_pass\_metrics\_ipc\_name. | `False` | bool flag (set to enable) |
| `--forward-pass-metrics-worker-id` | — | `""` | Type: str |
| `--forward-pass-metrics-ipc-name` | — | `None` | Type: str |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--export-metrics-to-file` | Export performance metrics for each request to local file (e.g. for forwarding to external systems). | `False` | bool flag (set to enable) |
| `--export-metrics-to-file-dir` | Directory path for writing performance metrics files (required when --export-metrics-to-file is enabled). | `None` | Type: str |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--api-key` | Set API key of the server. It is also used in the OpenAI API compatible server. | `None` | Type: str |
| `--admin-api-key` | Set admin API key for administrative/control endpoints (e.g., weights update, cache flush, /server\_info). Endpoints marked as admin-only require Authorization: Bearer \ when this is set. |
`None` | Type: str |
| `--served-model-name` | Override the model name returned by the v1/models endpoint in OpenAI API server. | `None` | Type: str |
| `--weight-version` | Version identifier for the model weights. Defaults to 'default' if not specified. | `default` | Type: str |
| `--chat-template` | The builtin chat template name or the path of the chat template file. This is only used for OpenAI-compatible API server. | `None` | Type: str |
| `--hf-chat-template-name` | When the HuggingFace tokenizer has multiple chat templates (e.g., 'default', 'tool\_use', 'rag'), specify which named template to use. If not set, the first available template is used. | `None` | Type: str |
| `--completion-template` | The builtin completion template name or the path of the completion template file. This is only used for OpenAI-compatible API server. only for code completion currently. | `None` | Type: str |
| `--file-storage-path` | The path of the file storage in backend. | `sglang_storage` | Type: str |
| `--enable-cache-report` | Return number of cached tokens in usage.prompt\_tokens\_details for each openai request. | `False` | bool flag (set to enable) |
| `--reasoning-parser` | Specify the parser for reasoning models. Supported parsers: \[deepseek-r1, deepseek-v3, glm45, gpt-oss, kimi, qwen3, qwen3-thinking, step3]. | `None` | deepseek-r1, deepseek-v3, glm45, gpt-oss, kimi, qwen3, qwen3-thinking, step3 |
| `--tool-call-parser` | Specify the parser for handling tool-call interactions. Supported parsers: \[deepseekv3, deepseekv31, glm, glm45, glm47, gpt-oss, kimi\_k2, llama3, mistral, pythonic, qwen, qwen25, qwen3\_coder, step3]. | `None` | deepseekv3, deepseekv31, glm, glm45, glm47, gpt-oss, kimi\_k2, llama3, mistral, pythonic, qwen, qwen25, qwen3\_coder, step3, gigachat3 |
| `--tool-server` | Either 'demo' or a comma-separated list of tool server urls to use for the model. If not specified, no external tool server will be used. Native GPT-OSS `web_search` can still be enabled with `EXA_API_KEY`. | `None` | Type: str |
| `--sampling-defaults` | Where to get default sampling parameters. 'openai' uses SGLang/OpenAI defaults (temperature=1.0, top\_p=1.0, etc.). 'model' uses the model's generation\_config.json to get the recommended sampling parameters if available. Default is 'model'. | `model` | openai, model |
| `--strip-thinking-cache` | Skip caching reasoning-model output (thinking + answer) in the radix tree on finish; keep only the prompt prefix. Opt-in: changes cache contents. | `False` | bool flag (set to enable) |
| `--enable-strict-thinking` | Enable strict token filtering during the thinking phase. Blocks model-specific excluded tokens (e.g., tool call markers) during reasoning. Requires a grammar backend that supports token filtering. | `False` | bool flag (set to enable) |
| `--asr-max-buffer-seconds` | Maximum seconds of PCM audio the streaming ASR WebSocket handler will accumulate before closing the session with a buffer\_overflow error. Guards against OOM when a client streams audio faster than inference can consume it. Default 60s. | `60` | Type: int |
| `--asr-max-concurrent-sessions` | Maximum number of concurrent realtime ASR WebSocket sessions served by /v1/realtime. New connections beyond this cap are accepted, sent an error\{code:too\_many\_sessions} frame, and closed. Default 32. | `32` | Type: int |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--data-parallel-size` `--dp-size` |
The data parallelism size. | `1` | Type: int |
| `--load-balance-method` | The load balancing strategy for data parallelism. The `total_tokens` algorithm can only be used when DP attention is applied. This algorithm performs load balancing based on the real-time token load of the DP workers. | `auto` | auto, round\_robin, follow\_bootstrap\_room, total\_requests, total\_tokens |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--dist-init-addr` `--nccl-init-addr` |
The host address for initializing distributed backend (e.g., `192.168.0.2:25000`). | ` None` | Type: str |
| `--nnodes` | The number of nodes. | `1` | Type: int |
| `--node-rank` | The node rank. | `0` | Type: int |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--json-model-override-args` | A dictionary in JSON string format used to override default model configurations. | `{}` | Type: str |
| `--preferred-sampling-params` | json-formatted sampling settings that will be returned in /get\_model\_info | `None` | Type: str |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--enable-lora` | Enable LoRA support for the model. This argument is automatically set to `True` if `--lora-paths` is provided for backward compatibility. | `False` | Bool flag (set to enable) |
| `--enable-lora-overlap-loading` | Enable asynchronous LoRA weight loading in order to overlap H2D transfers with GPU compute. This should be enabled if you find that your LoRA workloads are bottlenecked by adapter weight loading, for example when frequently loading large LoRA adapters. | `False` | Bool flag (set to enable) |
| `--max-lora-rank` | The maximum LoRA rank that should be supported. If not specified, it will be automatically inferred from the adapters provided in --lora-paths. This argument is needed when you expect to dynamically load adapters of larger LoRA rank after server startup. |
`None` | Type: int |
| `--lora-target-modules` | The union set of all target modules where LoRA should be applied (e.g., q\_proj, k\_proj, gate\_proj). If not specified, it will be automatically inferred from the adapters provided in --lora-paths. You can also set it to all to enable LoRA for all supported modules; note this may introduce minor performance overhead. |
`None` | q\_proj, k\_proj, v\_proj, o\_proj, gate\_proj, up\_proj, down\_proj, qkv\_proj, gate\_up\_proj, all |
| `--lora-paths` | The list of LoRA adapters to load. Each adapter must be specified in one of the following formats: \ | \ | JSON with schema \{"lora\_name": str, "lora\_path": str, "pinned": bool}. |
`None` | Type: List\[str] / JSON objects |
| `--max-loras-per-batch` | Maximum number of adapters for a running batch, including base-only requests. | `8` | Type: int |
| `--max-loaded-loras` | If specified, limits the maximum number of LoRA adapters loaded in CPU memory at a time. Must be ≥ --max-loras-per-batch. |
`None` | Type: int |
| `--lora-eviction-policy` | LoRA adapter eviction policy when the GPU memory pool is full. | `lru` | lru, fifo |
| `--lora-backend` | Choose the kernel backend for multi-LoRA serving. | `csgmv` | triton, csgmv, ascend, torch\_native |
| `--max-lora-chunk-size` | Maximum chunk size for the ChunkedSGMV LoRA backend. Only used when --lora-backend is csgmv. Larger values may improve performance. |
`16` | 16, 32, 64, 128 |
| `--lora-drain-wait-threshold` | When any LoRA adapter request waits longer than this threshold (in seconds), the scheduler will selectively drain one running adapter to make room. This mitigates extreme tail latency under high or skewed workloads by preventing a small set of adapters from monopolizing batch slots. Set to 0 to disable draining (default). | `0.0` | Type: float |
| `--experts-shared-outer-loras` | Force shared outer LoRA mode for MoE models. When set, w1/w3 lora\_A and w2 lora\_B are shared across experts (expert\_dim=1). Use --no-experts-shared-outer-loras to force disable. By default this is auto-detected from adapter weights. | `None` | Type: str |
| `--lora-use-virtual-experts` | Enable virtual expert computation for MoE models. When set, the model will use virtual expert computation. | `False` | bool flag (set to enable) |
| `--lora-strict-loading` | Enable strict loading for LoRA adapters. When set, mismatched or missing keys in the adapter weights will raise an error. | `False` | Type: str |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--attention-backend` | Choose the kernels for attention layers. | `None` | triton, torch\_native, flex\_attention, dsa, nsa, dsv4, compressed, cutlass\_mla, fa3, fa4, flashinfer, flashmla, trtllm\_mla, cutedsl\_mla, tokenspeed\_mla, trtllm\_mha, dual\_chunk\_flash\_attn, aiter, wave, intel\_amx, ascend, intel\_xpu |
| `--prefill-attention-backend` | Choose the kernels for prefill attention layers (have priority over --attention-backend). | `None` | triton, torch\_native, flex\_attention, dsa, nsa, dsv4, compressed, cutlass\_mla, fa3, fa4, flashinfer, flashmla, trtllm\_mla, cutedsl\_mla, tokenspeed\_mla, trtllm\_mha, dual\_chunk\_flash\_attn, aiter, wave, intel\_amx, ascend, intel\_xpu |
| `--decode-attention-backend` | Choose the kernels for decode attention layers (have priority over --attention-backend). | `None` | triton, torch\_native, flex\_attention, dsa, nsa, dsv4, compressed, cutlass\_mla, fa3, fa4, flashinfer, flashmla, trtllm\_mla, cutedsl\_mla, tokenspeed\_mla, trtllm\_mha, dual\_chunk\_flash\_attn, aiter, wave, intel\_amx, ascend, intel\_xpu |
| `--sampling-backend` | Choose the kernels for sampling layers. | `None` | flashinfer, pytorch, ascend |
| `--grammar-backend` | Choose the backend for grammar-guided decoding. | `None` | xgrammar, outlines, llguidance, none |
| `--mm-attention-backend` | Set multimodal attention backend. | `None` | sdpa, fa3, fa4, triton\_attn, ascend\_attn, aiter\_attn, flashinfer\_cudnn, amx\_attn, xpu\_attn |
| `--dsa-prefill-backend` | DSA backend for the prefill stage (overrides `--attention-backend` when running DeepSeek DSA-style attention). | Auto (hardware-dependent) | flashmla\_sparse, flashmla\_sparse\_q8, flashmla\_kv, flashmla\_auto, fa3, tilelang, aiter, trtllm |
| `--dsa-decode-backend` | DSA backend for the decode stage when running DeepSeek DSA-style attention. Overrides `--attention-backend` for decoding. | Auto (hardware-dependent) | flashmla\_sparse, flashmla\_kv, flashmla\_auto, fa3, tilelang, aiter, trtllm |
| `--dsa-topk-backend` | Choose the DSA indexer top-k backend. The `torch` backend currently requires `SGLANG_DSA_FUSE_TOPK=false`. | `sgl-kernel` | sgl-kernel, torch, flashinfer |
| `--enable-deepseek-v4-fp4-indexer` | Enable the experimental FP4 C4 indexer path for DeepSeek V4. When unset, SGLang keeps the default DeepSeek V4 indexer path. Requires SM100 GPUs with DeepGEMM FP4 indexer support. | `False` | bool flag (set to enable) |
| `--fp8-gemm-backend` | Choose the runner backend for Blockwise FP8 GEMM operations. For MXFP8 dense GEMM, auto selects flashinfer\_cutedsl when FlashInfer reports support (currently SM100/SM103), and otherwise selects flashinfer\_cutlass on supported Blackwell GPUs. Options also include 'deep\_gemm' (JIT-compiled), 'flashinfer\_trtllm' (FlashInfer TRTLLM backend; SM100/SM103 only), 'flashinfer\_cutlass' (FlashInfer CUTLASS backend), 'flashinfer\_cutedsl' (FlashInfer CuTe DSL MXFP8 backend; SM100/SM103 only), 'flashinfer\_deepgemm' (Hopper SM90 only, uses swapAB optimization for small M dimensions in decoding), 'cutlass' (optimal for SM120 GPUs), 'triton' (fallback, widely compatible), and 'aiter' (ROCm only). |
`auto` | auto, deep\_gemm, flashinfer\_trtllm, flashinfer\_cutlass, flashinfer\_cutedsl, flashinfer\_deepgemm, cutlass, triton, aiter |
| `--fp4-gemm-backend` | Choose the runner backend for NVFP4 GEMM operations. Options: 'auto' (default; selects flashinfer\_cutedsl on SM100, marlin on SM80-SM90, flashinfer\_cutlass otherwise (including SM120)), 'flashinfer\_cutlass' (FlashInfer CUTLASS backend), 'flashinfer\_cudnn' (FlashInfer cuDNN backend, optimal on CUDA 13+ with cuDNN 9.15+), 'flashinfer\_cutedsl' (FlashInfer CuTe DSL backend), 'flashinfer\_trtllm' (FlashInfer TensorRT-LLM backend, requires different weight preparation with shuffling), 'marlin' (weight-only W4A16 fallback for SM80-SM90). Requires FlashInfer to be installed. |
`auto` | auto, flashinfer\_cudnn, flashinfer\_cutedsl, flashinfer\_cutlass, flashinfer\_trtllm, marlin |
| `--bf16-gemm-backend` | Choose the backend for unquantized BF16 GEMM operations. Options: auto (default; selects cutedsl on SM10x GPUs, except deterministic inference selects torch; otherwise uses cuBLAS via torch.nn.functional.linear), cutedsl (SGLang JIT CuTe DSL TGV BF16 GEMM on SM10x; dispatches between the CuTe DSL kernel and cuBLAS), torch (always uses cuBLAS via torch.nn.functional.linear). |
`auto` | auto, cutedsl, torch |
| `--disable-flashinfer-autotune` | Flashinfer autotune is enabled by default. Set this flag to disable the autotune. | `False` | bool flag (set to enable) |
| `--flashinfer-autotune-skip-ops` | FlashInfer custom-op identifiers to skip during autotuning. See FlashInfer's autotuning documentation. Skipped ops use the heuristic fallback. SGLang temporarily skips mxfp8\_gemm by default due to an IMA. |
`None` | string |
| `--radix-cache-backend` | Name of a radix-cache backend previously registered via register\_radix\_cache\_backend. Omit this flag to use the built-in default cache selection chain. | `None` | Type: str |
| `--nsa-prefill-backend` | \[Deprecated] Use --dsa-prefill-backend instead. | Auto | flashmla\_sparse, flashmla\_kv, flashmla\_auto, fa3, tilelang, aiter, trtllm |
| `--nsa-decode-backend` | \[Deprecated] Use --dsa-decode-backend instead. | Auto | flashmla\_sparse, flashmla\_kv, flashmla\_auto, fa3, tilelang, aiter, trtllm |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--speculative-algorithm` | Speculative algorithm. | `None` | `EAGLE`, `EAGLE3`, `NEXTN`, `STANDALONE`, `NGRAM` |
| `--speculative-draft-model-path` `--speculative-draft-model` |
The path of the draft model weights. This can be a local folder or a Hugging Face repo ID. | `None` | Type: str |
| `--speculative-draft-model-revision` | The specific draft model version to use. It can be a branch name, a tag name, or a commit id. If unspecified, will use the default version. | `None` | Type: str |
| `--speculative-draft-load-format` | The format of the draft model weights to load. If not specified, will use the same format as `--load-format`. Use 'dummy' to initialize draft model weights with random values for profiling. | `None` | auto, pt, safetensors, npcache, dummy, sharded\_state, gguf, bitsandbytes, mistral, layered, flash\_rl, remote, remote\_instance, fastsafetensors, private, runai\_streamer |
| `--speculative-num-steps` | The number of steps sampled from draft model in Speculative Decoding. | `None` | Type: int |
| `--speculative-eagle-topk` | The number of tokens sampled from the draft model in eagle2 each step. | `None` | Type: int |
| `--speculative-num-draft-tokens` | The number of tokens sampled from the draft model in Speculative Decoding. | `None` | Type: int |
| `--speculative-accept-threshold-single` | Accept a draft token if its probability in the target model is greater than this threshold. | `1.0` | Type: float |
| `--speculative-accept-threshold-acc` | The accept probability of a draft token is raised from its target probability p to min(1, p / threshold\_acc). | `1.0` | Type: float |
| `--speculative-token-map` | The path of the draft model's small vocab table. | `None` | Type: str |
| `--speculative-attention-mode` | Attention backend for speculative decoding operations (both target verify and draft extend). Can be one of 'prefill' (default) or 'decode'. | `prefill` | prefill, decode |
| `--speculative-draft-attention-backend` | Attention backend for speculative decoding drafting. | `None` | Same as attention backend options |
| `--speculative-moe-runner-backend` | MOE backend for EAGLE speculative decoding, see `--moe-runner-backend` for options. Same as moe runner backend if unset. | `None` | auto, deep\_gemm, triton, triton\_kernel, flashinfer\_trtllm, experimental\_sgl\_trtllm, flashinfer\_trtllm\_routed, flashinfer\_cutlass, flashinfer\_mxfp4, flashinfer\_cutedsl, cutlass, aiter, marlin |
| `--speculative-moe-a2a-backend` | MOE A2A backend for EAGLE speculative decoding, see `--moe-a2a-backend` for options. Same as moe a2a backend if unset. | `None` | none, deepep, mooncake, nixl, mori, ascend\_fuseep, flashinfer, megamoe, pplx |
| `--speculative-draft-model-quantization` | The quantization method for speculative model. | `None` | Same as `--quantization` options |
| `--speculative-dflash-block-size` | DFLASH only. Block size (verify window length). Alias of --speculative-num-draft-tokens for DFLASH. | `None` | Type: int |
| `--speculative-draft-window-size` | Sliding window size for the draft model. Honored by Llama EAGLE-3 (`LlamaForCausalLMEagle3`) and DFLASH only; other EAGLE-3 backends (e.g. MLA-based drafters) silently ignore it. For Llama EAGLE-3, the drafter only attends to the most recent N keys (verifier hidden states + its own outputs); the verifier is unaffected. For DFLASH, the draft worker keeps a recent target-token window in its local KV cache (paged backends may retain up to one extra page on the left for alignment). Default is full attention/context. | `None` | Type: int |
| `--speculative-dflash-draft-window-size` | — | — | Type: int |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--speculative-ngram-min-bfs-breadth` | The minimum breadth for BFS (Breadth-First Search) in ngram speculative decoding. | `1` | Type: int |
| `--speculative-ngram-max-bfs-breadth` | The maximum breadth for BFS (Breadth-First Search) in ngram speculative decoding. | `10` | Type: int |
| `--speculative-ngram-match-type` | Ngram tree-building mode. BFS selects recency-based expansion and PROB selects frequency-based expansion. This setting is forwarded to the ngram cache implementation. |
`BFS` | BFS, PROB |
| `--speculative-ngram-max-trie-depth` | Maximum suffix length stored and matched by the ngram trie. | `18` | Type: int |
| `--speculative-ngram-capacity` | The cache capacity for ngram speculative decoding. | 10000000 |
Type: int |
| `--speculative-ngram-external-corpus-path` | Path to an external JSONL corpus to pre-load into SAM at startup. Additional corpora can be added at runtime via POST /add\_external\_corpus. | `None` | Type: str |
| `--speculative-ngram-external-sam-budget` | Number of draft nodes reserved for the external SAM subtree in ngram speculative decoding. | `0` | Type: int |
| `--speculative-ngram-external-corpus-max-tokens` | Fail startup if the tokenized external ngram corpus exceeds this many tokens. Tune this based on your CPU memory budget. | `10000000` | Type: int |
| `--speculative-adaptive` | Enable adaptive speculative decoding that dynamically adjusts num\_steps based on acceptance rate. | `False` | bool flag (set to enable) |
| `--speculative-adaptive-config` | Path to a JSON config file for adaptive speculative decoding tuning knobs. | `None` | Type: str |
| `--speculative-skip-dp-mlp-sync` | Skip the extra MLP sync that the scheduler performs before merging a new batch when speculative decoding + DP attention are both enabled. | `False` | bool flag (set to enable) |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--enable-multi-layer-eagle` | Enable multi-layer Eagle speculative decoding. | `False` | bool flag (set to enable) |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--expert-parallel-size` `--ep-size` `--ep` |
The expert parallelism size. | `1` | Type: int |
| `--moe-a2a-backend` | Select the backend for all-to-all communication for expert parallelism. | `none` | none, deepep, mooncake, nixl, mori, ascend\_fuseep, flashinfer, megamoe, pplx |
| `--moe-runner-backend` | Choose the runner backend for MoE. | `auto` | auto, deep\_gemm, triton, triton\_kernel, flashinfer\_trtllm, experimental\_sgl\_trtllm, flashinfer\_trtllm\_routed, flashinfer\_cutlass, flashinfer\_mxfp4, flashinfer\_cutedsl, cutlass, aiter, marlin |
| `--flashinfer-mxfp4-moe-precision` | Choose the computation precision of flashinfer mxfp4 moe | `default` | default, bf16 |
| `--enable-flashinfer-allreduce-fusion` | Enable FlashInfer allreduce fusion with Residual RMSNorm. | `False` | bool flag (set to enable) |
| `--enable-aiter-allreduce-fusion` | Enable aiter allreduce fusion with Residual RMSNorm. | `False` | bool flag (set to enable) |
| `--deepep-mode` | Select the mode when enable DeepEP MoE, could be normal, low\_latency or auto. Default is auto, which means low\_latency for decode batch and normal for prefill batch. |
`auto` | normal, low\_latency, auto |
| `--deepep-dispatcher-output-dtype` | Select DeepEP dispather output dtype, could be bf16, fp8, int8 (only Ascend A2/A3 NPU), nvfp4 or auto. Default is auto, which follows a priority order (server argument → deprecated env var → input\_global\_scale check → dispatcher\_output\_dtype from quant\_config → flashinfer/cutlass backend → NPU BF16 default → GPU FP8 default). |
`auto` | auto, bf16, fp8, int8, nvfp4 |
| `--ep-num-redundant-experts` | Allocate this number of redundant experts in expert parallel. | `0` | Type: int |
| `--ep-dispatch-algorithm` | The algorithm to choose ranks for redundant experts in expert parallel. | None |
Type: str |
| `--init-expert-location` | Initial location of EP experts. | `trivial` | Type: str |
| `--enable-eplb` | Enable EPLB algorithm | `False` | bool flag (set to enable) |
| `--eplb-algorithm` | Chosen EPLB algorithm | `auto` | Type: str |
| `--eplb-rebalance-num-iterations` | Number of iterations to automatically trigger a EPLB re-balance. | `1000` | Type: int |
| `--eplb-rebalance-layers-per-chunk` | Number of layers to rebalance per forward pass. | None |
Type: int |
| `--eplb-min-rebalancing-utilization-threshold` | Minimum threshold for GPU average utilization to trigger EPLB rebalancing. Must be in the range \[0.0, 1.0]. | `1.0` | Type: float |
| `--expert-distribution-recorder-mode` | Mode of expert distribution recorder. | ` None` | Type: str |
| `--expert-distribution-recorder-buffer-size` | Circular buffer size of expert distribution recorder. Set to -1 to denote infinite buffer. | None |
Type: int |
| `--expert-balancedness-report-mode` | Where to report expert balancedness. | off |
off, server\_log, prometheus, both |
| `--deepep-config` | Tuned DeepEP config suitable for your own cluster. It can be either a string with JSON content or a file path. | ` None` | Type: str |
| `--moe-dense-tp-size` | TP size for MoE dense MLP layers. This flag is useful when, with large TP size, there are errors caused by weights in MLP layers having dimension smaller than the min dimension GEMM supports. | ` none` | Type: int |
| `--elastic-ep-backend` | Specify the collective communication backend for elastic EP. Currently supports 'mooncake'. | ` None` | none, mooncake, nixl |
| `--enable-elastic-expert-backup` | Enable elastic EP backend to backup expert weights in DRAM feature. Currently supports 'mooncake'. | `False` | bool flag (set to enable) |
| `--mooncake-ib-device` | The InfiniBand devices for Mooncake Backend transfer, accepts multiple comma-separated devices (e.g., --mooncake-ib-device mlx5\_0,mlx5\_1). Default is None, which triggers automatic device detection when Mooncake Backend is enabled. | ` None` | Type: str |
| `--enable-waterfill` | Enable Waterfill: dispatch the fused shared expert as an extra routed expert slot to the least-loaded EP rank. Supports DeepEP and MegaMOE MoE A2A backends, implicitly enables shared-expert fusion, and supports `--deepep-mode auto`, `normal`, or `low_latency` when used with DeepEP. Use `auto` or `low_latency` for production DeepEP decode so CUDA graph remains enabled. Supported on DeepSeek-V3/R1 with EP >= 2. By default, Waterfill uses the static local-batch path; set `SGLANG_DISABLE_STATIC_WATERFILL=1` to force dynamic Waterfill with runtime EP all-reduce. | `False` | bool flag (set to enable) |
| `--elastic-ep-rejoin` | Indicates that this process is a relaunched elastic EP rank that should rejoin an existing process group during rank recovery. | `False` | bool flag (set to enable) |
| `--flashinfer-allreduce-fusion-backend` | Enable FlashInfer allreduce fusion and choose backend. Defaults to auto. 'auto': choose mnnvl on SM90 single-node systems and SM100/SM103 single-node or multi-node systems; choose trtllm otherwise. 'trtllm': available on single-node systems only. 'mnnvl': available on SM90 single-node systems and SM100/SM103 single-node or multi-node systems via MNNVL fabric. Fuses allreduce with Residual + RMSNorm for supported MoE models. | `None` | auto, trtllm, mnnvl |
| `--enforce-disable-flashinfer-allreduce-fusion` | Enforce disable FlashInfer allreduce fusion. | `False` | bool flag (set to enable) |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--max-mamba-cache-size` | The maximum size of the mamba cache. | `None` | Type: int |
| `--mamba-ssm-dtype` | The data type of the SSM states in mamba cache. If not set, read from the model config. | Auto (from model config) | float32, bfloat16, float16 |
| `--enable-mamba-cache-stochastic-rounding` | Enable stochastic rounding when writing FP16 Mamba SSM cache states. Requires --mamba-ssm-dtype float16 and CUDA. With --mamba-backend triton, requires SM100. |
`False` | Type: bool |
| `--mamba-cache-philox-rounds` | Number of Philox rounds to use for stochastic rounding of FP16 Mamba SSM cache writes. Triton uses the Triton default when set to 0; FlashInfer uses 10 rounds when set to 0. | `0` | Type: int |
| `--mamba-full-memory-ratio` | The ratio of mamba state memory to full kv cache memory. | `0.9` | Type: float |
| `--mamba-radix-cache-strategy` | The strategy to use for mamba scheduler. auto currently defaults to no\_buffer. 1. no\_buffer does not support overlap scheduler due to not allocating extra mamba state buffers. Branching point caching support is feasible but not implemented. 2. extra\_buffer supports overlap schedule by allocating extra mamba state buffers to track mamba state for caching (mamba state usage per running req becomes 2x for non-spec; 1+(1/(2+speculative\_num\_draft\_tokens))x for spec dec (e.g. 1.16x if speculative\_num\_draft\_tokens==4)). 2a. extra\_buffer is strictly better for non-KV-cache-bound cases; for KV-cache-bound cases, the tradeoff depends on whether enabling overlap outweighs reduced max running requests. 2b. mamba caching at radix cache branching point is strictly better than non-branch but requires kernel support, currently only extra\_buffer supports branching. 3. extra\_buffer\_lazy lowers extra\_buffer's slot cost by allocating one track slot per request instead of two; the second slot is allocated on demand at track-interval boundaries (for speculative decoding it is reserved ahead of each verify window and committed only for accepted boundary crossings). Compatible with speculative decoding (EAGLE/NGRAM/DSPARK/DFLASH); not supported under PD disaggregation. |
`auto` | auto, no\_buffer, extra\_buffer, extra\_buffer\_lazy |
| `--mamba-track-interval` | The interval (in tokens) to track the mamba state during decode. Only used when --mamba-radix-cache-strategy is extra\_buffer. Must be divisible by page\_size if set, and must be >= speculative\_num\_draft\_tokens when using speculative decoding. |
`256` | Type: int |
| `--enable-int8-mamba-checkpoint` | Store radix-cached linear-attn (mamba) states in int8 (separate checkpoint pool) for \~2x cached-prefix capacity at fixed memory. | `False` | bool flag (set to enable) |
| `--int8-mamba-ckpt-size` | Number of int8 mamba checkpoint slots (default: 2x the active mamba pool size). | `None` | Type: int |
| `--mamba-backend` | Choose the kernel backend for Mamba SSM operations. Default is 'triton'. Options: 'triton' (default), 'flashinfer' (requires FlashInfer with Mamba support). | `triton` | triton, flashinfer |
| `--linear-attn-backend` | The default kernel backend for linear attention (GDN/KDA). Can be overridden per-mode by --linear-attn-decode-backend and --linear-attn-prefill-backend. | `triton` | triton, cutedsl, flashinfer |
| `--linear-attn-decode-backend` | Override the kernel backend for linear attention decode. If not set, uses --linear-attn-backend. | `None` | triton, cutedsl, flashinfer |
| `--linear-attn-prefill-backend` | Override the kernel backend for linear attention prefill/extend. If not set, uses --linear-attn-backend. | `None` | triton, cutedsl, flashinfer |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--enable-hierarchical-cache` | Enable hierarchical cache | `False` | bool flag (set to enable) |
| `--hicache-ratio` | The ratio of the size of host KV cache memory pool to the size of device pool. | `2.0` | Type: float |
| `--hicache-size` | The size of host KV cache memory pool in gigabytes, which will override the hicache\_ratio if set. | `0` | Type: int |
| `--hicache-write-policy` | The write policy of hierarchical cache. | `write_through` | write\_back, write\_through, write\_through\_selective |
| `--hicache-io-backend` | The IO backend for KV cache transfer between CPU and GPU | `kernel` | direct, kernel, kernel\_ascend |
| `--hicache-mem-layout` | The layout of host memory pool for hierarchical cache. | `page_first` | layer\_first, page\_first, page\_first\_direct, page\_first\_kv\_split, page\_head |
| `--hicache-storage-backend` | The storage backend for hierarchical KV cache. Built-in backends: file, mooncake, hf3fs, nixl, aibrix. For dynamic backend, use --hicache-storage-backend-extra-config to specify: backend\_name (custom name), module\_path (Python module path), class\_name (backend class name). | `None` | file, mooncake, hf3fs, nixl, aibrix, dynamic, eic, simm |
| `--hicache-storage-prefetch-policy` | Control when prefetching from the storage backend should stop. | `timeout` | best\_effort, wait\_complete, timeout |
| `--hicache-storage-backend-extra-config` | A dictionary in JSON string format, or a string starting with a `@` followed by a config file in JSON/YAML/TOML format, containing extra configuration for the storage backend. | `None` | Type: str |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--hisparse-config` `--hierarchical-sparse-attention-extra-config` |
A dictionary in JSON string format for hierarchical sparse attention configuration. Required fields: `algorithm` (str), `backend` (str). All other fields are algorithm-specific and passed to the algorithm constructor. | `None` | Type: str |
| `--enable-hisparse` | Enable hierarchical sparse attention | `False` | bool flag (set to enable) |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--enable-lmcache` | Using LMCache as an alternative hierarchical cache solution | `False` | bool flag (set to enable) |
| `--lmcache-config-file` | Path to the LMCache YAML configuration file | `None` | Type: str |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--kt-weight-path` | \[ktransformers parameter] The path of the quantized expert weights for amx kernel. A local folder. | `None` | Type: str |
| `--kt-method` | \[ktransformers parameter] Quantization formats for CPU execution. | `AMXINT4` | Type: str |
| `--kt-cpuinfer` | \[ktransformers parameter] The number of CPUInfer threads. | `None` | Type: int |
| `--kt-threadpool-count` | \[ktransformers parameter] One-to-one with the number of NUMA nodes (one thread pool per NUMA). | `2` | Type: int |
| `--kt-num-gpu-experts` | \[ktransformers parameter] The number of GPU experts. | `None` | Type: int |
| `--kt-max-deferred-experts-per-token` | \[ktransformers parameter] Maximum number of experts deferred to CPU per token. All MoE layers except the final one use this value; the final layer always uses 0. | `None` | Type: int |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--dllm-algorithm` | The diffusion LLM algorithm, such as LowConfidence. | `None` | Type: str |
| `--dllm-algorithm-config` | The diffusion LLM algorithm configurations. Must be a YAML file. | `None` | Type: str |
| `--dllm-fdfo` | First-Done-First-Out (FDFO) scheduling lets completed requests leave the batch immediately instead of waiting for slower requests, eliminating head-of-line blocking. Enabled by default; pass `--no-dllm-fdfo` to fall back to synchronous lockstep scheduling. Works with any dLLM algorithm. | `True` | Type: bool |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--cpu-offload-gb` | How many GBs of RAM to reserve for CPU offloading. | `0` | Type: int |
| `--offload-group-size` | Number of layers per group in offloading. | `-1` | Type: int |
| `--offload-num-in-group` | Number of layers to be offloaded within a group. | `1` | Type: int |
| `--offload-prefetch-step` | Steps to prefetch in offloading. | `1` | Type: int |
| `--offload-mode` | Mode of offloading. | `cpu` | Type: str |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--enable-mis` | Enable Multi-Item Scoring optimization. Combines query and multiple items into a single sequence for efficient batch processing. Requires --attention-backend flashinfer; auto-disables CUDA graph, radix cache, and chunked prefill. | `False` | bool flag (set to enable) |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--disable-radix-cache` | Disable RadixAttention for prefix caching. | `False` | bool flag (set to enable) |
| `--cuda-graph-config` | Canonical per-phase CUDA graph settings as JSON, e.g. . JSON wins over the per-phase --cuda-graph-\* convenience flags and over the legacy flags. Allowed backends: full, breakable, tc\_piecewise, disabled (full is decode-only). |
`None` | Type: JSON (dict-of-dicts) |
| `--cuda-graph-backend-decode` | Backend for the decode phase. Folds into cuda\_graph\_config\[decode].backend. |
`None` | full, breakable, tc\_piecewise, disabled |
| `--cuda-graph-backend-prefill` | Backend for the prefill phase. Folds into cuda\_graph\_config\[prefill].backend. |
`None` | breakable, tc\_piecewise, disabled |
| `--cuda-graph-max-bs-decode` | Maximum batch size captured for the decode CUDA graph. | `None` | Type: int |
| `--cuda-graph-max-bs-prefill` | Maximum batch size captured for the prefill CUDA graph. | `None` | Type: int |
| `--cuda-graph-bs-decode` | Explicit list of batch sizes to capture for the decode CUDA graph. | `None` | List\[int] |
| `--cuda-graph-bs-prefill` | Explicit list of batch sizes to capture for the prefill CUDA graph. | `None` | List\[int] |
| `--cuda-graph-tc-compiler` | Compiler used by the tc\_piecewise backend (only the prefill phase consumes it today). |
`None` | eager, inductor |
| `--disable-cuda-graph-padding` | Disable cuda graph when padding is needed. Still uses cuda graph when padding is not needed. | `False` | bool flag (set to enable) |
| `--enable-profile-cuda-graph` | Enable profiling of cuda graph capture. | `False` | bool flag (set to enable) |
| `--debug-cuda-graph` | Eager-mode CUDA graph via the breakable backend: graph breaks let every op run eagerly while still going through the capture/replay path. Useful for debugging capture/replay issues. | `False` | bool flag (set to enable) |
| `--enable-cudagraph-gc` | Enable garbage collection during CUDA graph capture. If disabled (default), GC is frozen during capture to speed up the process. | `False` | bool flag (set to enable) |
| `--enable-layerwise-nvtx-marker` | Enable layerwise NVTX profiling annotations for the model. This adds NVTX markers to every layer for detailed per-layer performance analysis with Nsight Systems. | `False` | bool flag (set to enable) |
| `--enable-nccl-nvls` | Enable NCCL NVLS for prefill heavy requests when available. | `False` | bool flag (set to enable) |
| `--enable-symm-mem` | Enable NCCL symmetric memory for fast collectives. | `False` | bool flag (set to enable) |
| `--disable-flashinfer-cutlass-moe-fp4-allgather` | Disables quantize before all-gather for flashinfer cutlass moe. | `False` | bool flag (set to enable) |
| `--enable-tokenizer-batch-encode` | Enable batch tokenization for improved performance when processing multiple text inputs. Do not use with image inputs, pre-tokenized input\_ids, or input\_embeds. | `False` | bool flag (set to enable) |
| `--disable-tokenizer-batch-decode` | Disable batch decoding when decoding multiple completions. | `False` | bool flag (set to enable) |
| `--disable-outlines-disk-cache` | Disable disk cache of outlines to avoid possible crashes related to file system or high concurrency. | `False` | bool flag (set to enable) |
| `--disable-custom-all-reduce` | Disable the custom all-reduce kernel and fall back to NCCL. | `False` | bool flag (set to enable) |
| `--enable-mscclpp` | Enable using mscclpp for small messages for all-reduce kernel and fall back to NCCL. | `False` | bool flag (set to enable) |
| `--enable-torch-symm-mem` | Enable using torch symm mem for all-reduce kernel and fall back to NCCL. Only supports CUDA device SM90 and above. SM90 supports world size 4, 6, 8. SM10 supports world size 6, 8. | `False` | bool flag (set to enable) |
| `--disable-overlap-schedule` | Disable the overlap scheduler, which overlaps the CPU scheduler with GPU model worker. | `False` | bool flag (set to enable) |
| `--enable-mixed-chunk` | Enabling mixing prefill and decode in a batch when using chunked prefill. | `False` | bool flag (set to enable) |
| `--enable-dp-attention` | Enabling data parallelism for attention and tensor parallelism for FFN. The dp size should be equal to the tp size. Currently DeepSeek-V2 and Qwen 2/3 MoE models are supported. | `False` | bool flag (set to enable) |
| `--enable-dp-lm-head` | Enable vocabulary parallel across the attention TP group to avoid all-gather across DP groups, optimizing performance under DP attention. | `False` | bool flag (set to enable) |
| `--enable-two-batch-overlap` | Enabling two micro batches to overlap. | `False` | bool flag (set to enable) |
| `--enable-single-batch-overlap` | Let computation and communication overlap within one micro batch. | `False` | bool flag (set to enable) |
| `--tbo-token-distribution-threshold` | The threshold of token distribution between two batches in micro-batch-overlap, determines whether to two-batch-overlap or two-chunk-overlap. Set to 0 denote disable two-chunk-overlap. | `0.48` | Type: float |
| `--enable-torch-compile` | Optimize the model with torch.compile. Experimental feature. | `False` | bool flag (set to enable) |
| `--enable-torch-compile-debug-mode` | Enable debug mode for torch compile. | `False` | bool flag (set to enable) |
| `--torch-compile-max-bs` | Set the maximum batch size when using torch compile. | `32` | Type: int |
| `--cuda-graph-max-bs-decode` | Deprecated alias for --cuda-graph-max-bs-decode. |
`None` | Type: int |
| `--cuda-graph-bs` | Deprecated alias for --cuda-graph-bs-decode. |
`None` | List\[int] |
| `--disable-cuda-graph` | Deprecated. Use --cuda-graph-backend-decode=disabled and/or --cuda-graph-backend-prefill=disabled. |
False |
bool flag (set to enable) |
| `--enable-breakable-cuda-graph` | Deprecated alias for --cuda-graph-backend-prefill=breakable. |
False |
bool flag (set to enable) |
| `--disable-prefill-cuda-graph` | Disable the prefill-phase CUDA graph. Convenience for --cuda-graph-backend-prefill=disabled. |
`False` | bool flag (set to enable) |
| `--disable-decode-cuda-graph` | Disable the decode-phase CUDA graph. Convenience for --cuda-graph-backend-decode=disabled. |
`False` | bool flag (set to enable) |
| `--disable-piecewise-cuda-graph` | Deprecated alias for --cuda-graph-backend-prefill=disabled. |
False |
bool flag (set to enable) |
| `--enforce-piecewise-cuda-graph` | Deprecated alias for --cuda-graph-backend-prefill=tc\_piecewise. Explicitly setting the prefill backend now skips the auto-disable cascade automatically. |
False |
bool flag (set to enable) |
| `--piecewise-cuda-graph-tokens` | Deprecated alias for --cuda-graph-bs-prefill. |
`None` | List\[int] |
| `--piecewise-cuda-graph-compiler` | Deprecated alias for --cuda-graph-tc-compiler. |
eager |
eager, inductor |
| `--piecewise-cuda-graph-max-tokens` | Deprecated alias for --cuda-graph-max-bs-prefill. |
4096 |
Type: int |
| `--enable-p2p-check` | Enable P2P check for GPU access, otherwise the p2p access is allowed by default. | `False` | bool flag (set to enable) |
| `--triton-attention-reduce-in-fp32` | Cast the intermediate attention results to fp32 to avoid possible crashes related to fp16. This only affects Triton attention kernels. | `False` | bool flag (set to enable) |
| `--triton-attention-num-kv-splits` | The number of KV splits in flash decoding Triton kernel. Larger value is better in longer context scenarios. The default value is 8. | `8` | Type: int |
| `--triton-attention-split-tile-size` | The size of split KV tile in flash decoding Triton kernel. Used for deterministic inference. | `None` | Type: int |
| `--num-continuous-decode-steps` | Run multiple continuous decoding steps to reduce scheduling overhead. This can potentially increase throughput but may also increase time-to-first-token latency. The default value is 1, meaning only run one decoding step at a time. | `1` | Type: int |
| `--delete-ckpt-after-loading` | Delete the model checkpoint after loading the model. | `False` | bool flag (set to enable) |
| `--enable-memory-saver` | Allow saving memory using release\_memory\_occupation and resume\_memory\_occupation | `False` | bool flag (set to enable) |
| `--enable-weights-cpu-backup` | Save model weights to CPU memory during release\_weights\_occupation and resume\_weights\_occupation | `False` | bool flag (set to enable) |
| `--enable-draft-weights-cpu-backup` | Save draft model weights to CPU memory during release\_weights\_occupation and resume\_weights\_occupation | `False` | bool flag (set to enable) |
| `--allow-auto-truncate` | Allow automatically truncating requests that exceed the maximum input length instead of returning an error. | `False` | bool flag (set to enable) |
| `--enable-custom-logit-processor` | Enable users to pass custom logit processors to the server (disabled by default for security) | `False` | bool flag (set to enable) |
| `--flashinfer-mla-disable-ragged` | Not using ragged prefill wrapper when running flashinfer mla | `False` | bool flag (set to enable) |
| `--disable-shared-experts-fusion` | Disable shared experts fusion optimization for deepseek v3/r1. | `False` | bool flag (set to enable) |
| `--disable-chunked-prefix-cache` | Disable chunked prefix cache feature for deepseek, which should save overhead for short sequences. | `False` | bool flag (set to enable) |
| `--image-processor-backend` | Image processor backend. `auto` lets Transformers select the best available backend. | `auto` | `auto`, `torchvision`, `pil` |
| `--disable-fast-image-processor` | Deprecated. Use `--image-processor-backend=pil` instead. | `False` | bool flag (set to enable) |
| `--keep-mm-feature-on-device` | Keep multimodal feature tensors on device after processing to save D2H copy. | `False` | bool flag (set to enable) |
| `--enable-return-hidden-states` | Enable returning hidden states with responses. | `False` | bool flag (set to enable) |
| `--enable-return-routed-experts` | Enable returning routed experts of each layer with responses. | `False` | bool flag (set to enable) |
| `--scheduler-recv-interval` | The interval to poll requests in scheduler. Can be set to >1 to reduce the overhead of this. | `1` | Type: int |
| `--numa-node` | Sets the numa node for the subprocesses. i-th element corresponds to i-th subprocess. | `None` | List\[int] |
| `--enable-deterministic-inference` | Enable deterministic inference mode with batch invariant ops. | `False` | bool flag (set to enable) |
| `--rl-on-policy-target` | The training system that SGLang needs to match for true on-policy. | `None` | fsdp |
| `--enable-attn-tp-input-scattered` | Allow input of attention to be scattered when only using tensor parallelism, to reduce the computational load of operations such as qkv latent. | `False` | bool flag (set to enable) |
| `--enable-prefill-cp` | Enable context parallelism for the prefill phase. Select the layout with --cp-strategy. |
`False` | bool flag (set to enable) |
| `--cp-strategy` | Sharding strategy for prefill CP. zigzag is the former in-seq-split mode; interleave is the former round-robin-split mode. |
None |
zigzag, interleave |
| `--enable-fused-qk-norm-rope` | Enable fused qk normalization and rope rotary embedding. | `False` | bool flag (set to enable) |
| `--enable-precise-embedding-interpolation` | Enable corner alignment for resize of embeddings grid to ensure more accurate(but slower) evaluation of interpolated embedding values. | `False` | bool flag (set to enable) |
| `--kv-canary` | KV cache canary mode. 'none' disables the canary (default). 'log' prints them while the server keeps running (production-safe). 'raise' fails the server on the first detected mismatch (CI lane). | `none` | none, log, raise |
| `--kv-canary-real-data` | Check the real KV-cache in the canary. 'none' (default) disables the feature. 'partial' checks the first 16 bytes of each real-KV slot. 'all' checks the full real-KV slot. | `none` | Type: str |
| `--kv-canary-sweep-interval` | Every N forward steps, run a full-pool sweep. | `0` | Type: int |
| `--pre-warm-nccl` | Pre-warm NCCL/RCCL communicators during startup to reduce P99 TTFT cold-start latency. Default: enabled for AMD/HIP (RCCL), disabled for NVIDIA/CUDA (NCCL). | `False` | bool flag (set to enable) |
| `--enable-dp-attention-local-control-broadcast` | With DP-attention, send control messages to every DP group leader and broadcast within attn\_tp\_group instead of the full tp\_group. Eliminates a costly all-ranks gloo sync on every scheduler iteration. | `False` | bool flag (set to enable) |
| `--enforce-shared-experts-fusion` | Enforce shared experts fusion even when it would normally be disabled (e.g. under DeepEP). Mutually exclusive with --disable-shared-experts-fusion. | `False` | bool flag (set to enable) |
| `--enable-return-indexer-topk` | Enable returning indexer topk indices of layers with indexer with responses. | `False` | bool flag (set to enable) |
| `--disable-attn-tp-gather` | Disable scheduler-side attn\_tp\_gather (the upstream SP path that pads num\_tokens to attn\_tp\_size and pre-allocates a gathered buffer). Use for models that manage SP scatter/gather at the model level (e.g., perform their own all\_gather/reduce\_scatter inside attention) and do not consume the upstream gathered\_buffer. Without this, the cuda graph runner pads num\_tokens to attn\_tp\_size, which can cause kernel autotuners to select wrong-sized variants at small batches. | `False` | bool flag (set to enable) |
| `--enable-dsa-prefill-context-parallel` | \[Deprecated] Use --enable-prefill-cp instead. | — | Type: str |
| `--enable-nsa-prefill-context-parallel` | \[Deprecated] Use --enable-prefill-cp instead. | — | Type: str |
| `--enable-prefill-context-parallel` | \[Deprecated] Use --enable-prefill-cp instead. | — | Type: str |
| `--dsa-prefill-cp-mode` | \[Deprecated] Use --cp-strategy \{zigzag,interleave} instead. 'in-seq-split' maps to 'zigzag'; 'round-robin-split' maps to 'interleave'. | `round-robin-split` | in-seq-split, round-robin-split |
| `--nsa-prefill-cp-mode` | \[Deprecated] Use --cp-strategy instead. | Auto | in-seq-split, round-robin-split |
| `--prefill-cp-mode` | \[Deprecated] Use --cp-strategy \{zigzag,interleave} instead. 'in-seq-split' maps to 'zigzag'. | `in-seq-split` | in-seq-split |
| `--enable-fused-moe-sum-all-reduce` | Enable fused moe triton and sum all reduce. | `False` | bool flag (set to enable) |
| `--gc-threshold` | Set the garbage collection thresholds (the collection frequency). Accepts 1 to 3 integers. | — | Type: int (one or more) |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--enable-dynamic-batch-tokenizer` | Enable async dynamic batch tokenizer for improved performance when multiple requests arrive concurrently. | `False` | bool flag (set to enable) |
| `--dynamic-batch-tokenizer-batch-size` | \[Only used if --enable-dynamic-batch-tokenizer is set] Maximum batch size for dynamic batch tokenizer. | `32` | Type: int |
| `--dynamic-batch-tokenizer-batch-timeout` | \[Only used if --enable-dynamic-batch-tokenizer is set] Timeout in seconds for batching tokenization requests. | `0.002` | Type: float |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--debug-tensor-dump-output-folder` | The output folder for dumping tensors. | `None` | Type: str |
| `--debug-tensor-dump-layers` | The layer ids to dump. Dump all layers if not specified. | `None` | Type: JSON list |
| `--debug-tensor-dump-input-file` | The input filename for dumping tensors | `None` | Type: str |
| `--debug-tensor-dump-inject` | Inject the outputs from jax as the input of every layer. | `False` | Type: str |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--disaggregation-mode` | Only used for PD disaggregation. "prefill" for prefill-only server, and "decode" for decode-only server. If not specified, it is not PD disaggregated | `null` | null, prefill, decode |
| `--disaggregation-transfer-backend` | The backend for disaggregation transfer. Default is mooncake. | `mooncake` | mooncake, nixl, ascend, fake, mori, mooncake\_tcp |
| `--disaggregation-bootstrap-port` | Bootstrap server port on the prefill server. Default is 8998. | `8998` | Type: int |
| `--disaggregation-ib-device` | The InfiniBand devices for disaggregation transfer, accepts single device (e.g., --disaggregation-ib-device mlx5\_0) or multiple comma-separated devices (e.g., --disaggregation-ib-device mlx5\_0,mlx5\_1). Default is None, which triggers automatic device detection when mooncake backend is enabled. | None |
Type: str |
| `--disaggregation-decode-enable-offload-kvcache` | Enable async KV cache offloading on decode server (PD mode). | `False` | bool flag (set to enable) |
| `--num-reserved-decode-tokens` | Number of decode tokens that will have memory reserved when adding new request to the running batch. | `512` | Type: int |
| `--disaggregation-decode-polling-interval` | The interval to poll requests in decode server. Can be set to >1 to reduce the overhead of this. | `1` | Type: int |
| `--disaggregation-decode-enable-radix-cache` | Enable radix cache on decode server (PD mode). Caches KV prefixes to avoid redundant transfers. Incompatible with --enable-hisparse, speculative decoding, and --disaggregation-transfer-backend fake. | `False` | bool flag (set to enable) |
| `--optimistic-prefill-retries` | Number of optimistic prefill retries that will skip the bootstrap wait. | `0` | Type: int |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--encoder-only` | For MLLM with an encoder, launch an encoder-only server | `False` | bool flag (set to enable) |
| `--language-only` | For VLM, load weights for the language model only. | `False` | bool flag (set to enable) |
| `--encoder-transfer-backend` | The backend for encoder disaggregation transfer. Default is zmq\_to\_scheduler. | `zmq_to_scheduler` | zmq\_to\_scheduler, zmq\_to\_tokenizer, mooncake |
| `--encoder-urls` | List of encoder server urls. | `[]` | Type: JSON list |
| `--encoder-bootstrap-port` | Port for the EncoderBootstrapServer that runs in the language-only tokenizer manager process. Encoders register here, and language-only receivers fetch the current URL list from here. | `8997` | Type: int |
| `--encoder-register-urls` | One or more EncoderBootstrapServer URLs to register this encoder with on startup, for dynamic encoder discovery. Example: --encoder-register-urls [http://prefill0:8997](http://prefill0:8997) [http://prefill1:8997](http://prefill1:8997). Used with --encoder-only servers. | `[]` | Type: str (one or more) |
| `--enable-adaptive-dispatch-to-encoder` | When enabled, adaptively dispatch: multi-image requests go to encoder in language\_only epd mode, single-image requests are processed locally. | `False` | bool flag (set to enable) |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--custom-weight-loader` | The custom dataloader which used to update the model. Should be set with a valid import path, such as my\_package.weight\_load\_func | None |
List\[str] |
| `--weight-loader-disable-mmap` | Disable mmap while loading weight using safetensors. | `False` | bool flag (set to enable) |
| `--weight-loader-prefetch-checkpoints` | Prefetch checkpoint files into OS page cache before loading. Each rank prefetches a fraction of the shards in a background thread, reducing total network I/O on shared filesystems (NFS/Lustre) from N\*checkpoint to 1\*checkpoint. Recommended for models on network storage. When enabled, multi-threaded safetensors loading is disabled by default to avoid I/O oversubscription with the prefetch threads; set `enable_multithread_load=true` in `--model-loader-extra-config` to keep multi-threaded loading (e.g. on local NVMe where prefetch is a no-op). | `False` | bool flag (set to enable) |
| `--weight-loader-prefetch-num-threads` | Number of threads per rank for checkpoint prefetching. | `4` | Type: int |
| `--remote-instance-weight-loader-seed-instance-ip` | The ip of the seed instance for loading weights from remote instance. | None |
Type: str |
| `--remote-instance-weight-loader-seed-instance-service-port` | The service port of the seed instance for loading weights from remote instance. | None |
Type: int |
| `--remote-instance-weight-loader-send-weights-group-ports` | The communication group ports for loading weights from remote instance. | None |
Type: JSON list |
| `--remote-instance-weight-loader-backend` | The backend for loading weights from remote instance. Can be 'transfer\_engine', 'nccl', or 'modelexpress'. Default is 'nccl'. | `nccl` | transfer\_engine, nccl, modelexpress |
| `--remote-instance-weight-loader-start-seed-via-transfer-engine` | Start seed server via transfer engine backend for remote instance weight loader. | `False` | bool flag (set to enable) |
| `--weight-loader-drop-cache-after-load` | Call posix\_fadvise(DONTNEED) on each safetensors shard after loading it. | `False` | bool flag (set to enable) |
| `--engine-info-bootstrap-port` | Port for the engine info bootstrap server. Default is 6789. Must be set explicitly when running multiple instances on the same node. | `6789` | Type: int |
| `--modelexpress-config` | JSON config for ModelExpress P2P weight loading. Keys: "url" (optional gRPC host:port override), "transport" ("nixl" or "transfer\_engine"). Example: '\{"url": "localhost:8001", "transport": "nixl"}' | `None` | Type: str |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--enable-pdmux` | Enable PD-Multiplexing, PD running on greenctx stream. | `False` | bool flag (set to enable) |
| `--pdmux-config-path` | The path of the PD-Multiplexing config file. | `None` | Type: str |
| `--sm-group-num` | Number of sm partition groups. | `8` | Type: int |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--config` | Read CLI options from a config file. Must be a YAML file with configuration options. | `None` | Type: str |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--enable-broadcast-mm-inputs-process` | Enable broadcast mm-inputs process in scheduler. | `False` | bool flag (set to enable) |
| `--mm-process-config` | Multimodal preprocessing config, a json config contains keys: image, video, audio. |
\{} |
Type: JSON / Dict |
| `--allowed-media-domains` | Restrict client-supplied HTTP(S) media URLs and redirect destinations to these exact hostnames. | Unrestricted | Space-separated hostnames |
| `--media-url-max-file-size-mb` | Maximum streamed size in MiB for one remote media download. Set to 0 to disable the limit. | `64` | Type: int |
| `--mm-enable-dp-encoder` | Enabling data parallelism for mm encoder. The dp size will be set to the tp size automatically. | `False` | bool flag (set to enable) |
| `--limit-mm-data-per-request` | Limit the number of multimodal inputs per request. e.g. '\{"image": 1, "video": 1, "audio": 1}' | `None` | Type: JSON / Dict |
| `--enable-mm-global-cache` | Enable Mooncake-backed global multimodal embedding cache on encoder servers so repeated images can reuse cached ViT embeddings instead of recomputing them. | `False` | bool flag (set to enable) |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--decrypted-config-file` | The path of the decrypted config file. | `None` | Type: str |
| `--decrypted-draft-config-file` | The path of the decrypted draft config file. | `None` | Type: str |
| `--enable-prefix-mm-cache` | Enable prefix multimodal cache. Currently only supports mm-only. | `False` | bool flag (set to enable) |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--forward-hooks` | JSON-formatted list of forward hook specifications. Each element must include `target_modules` (list of glob patterns matched against `model.named_modules()` names) and `hook_factory` (Python import path to a factory, e.g. `my_package.hooks:make_hook`). An optional `name` field is used for logging, and an optional `config` object is passed as a `dict` to the factory. | `None` | Type: JSON list |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--msprobe-dump-config` | The path of the JSON configuration file for msProbe. If specified, enables msProbe dump. | `None` | Type: str |
| Argument | Description | Defaults | Options |
|---|---|---|---|
| `--prefill-round-robin-balance` | Note: Note: --prefill-round-robin-balance is deprecated now. | `None` | N/A |
| `--hybrid-kvcache-ratio` | Mix ratio in \[0,1] between uniform and hybrid kv buffers (0.0 = pure uniform: swa\_size / full\_size = 1)(1.0 = pure hybrid: swa\_size / full\_size = local\_attention\_size / context\_length) | `None` | Optional\[float] |
| Method | Path | Description |
|---|---|---|
| `POST` | `/generate` | SGLang generate API |
| `POST` | `/v1/chat/completions` | OpenAI-compatible chat completions (streaming/tool calls) |
| `POST` | `/v1/completions` | OpenAI-compatible text completions |
| `POST` | `/v1/embeddings` | Embedding generation (HTTP and gRPC) |
| `POST` | `/v1/rerank`, `/rerank` | Reranking requests |
| `POST` | `/v1/classify` | Text classification |
| Method | Path | Description |
|---|---|---|
| `POST` | `/v1/tokenize` | Tokenize text to token IDs (single or batch) |
| `POST` | `/v1/detokenize` | Convert token IDs back to text (single or batch) |
| `POST` | `/v1/tokenizers` | Register a new tokenizer (async, returns job status) |
| `GET` | `/v1/tokenizers` | List all registered tokenizers |
| `GET` | `/v1/tokenizers/{id}` | Get tokenizer info by UUID |
| `GET` | `/v1/tokenizers/{id}/status` | Check async tokenizer loading status |
| `DELETE` | `/v1/tokenizers/{id}` | Remove a tokenizer from the registry |
| Method | Path | Description |
|---|---|---|
| `POST` | `/parse/reasoning` | Separate reasoning (`<think>`) from normal text |
| `POST` | `/parse/function_call` | Parse function/tool calls from text |
| Field | Description |
|---|---|
| `label` | Predicted class label (from model's `id2label` config, or `LABEL_N` fallback) |
| `probs` | Probability distribution over all classes (softmax of logits) |
| `num_classes` | Number of classification classes |
| Method | Path | Description |
|---|---|---|
| `POST` | `/v1/responses` | Create background responses (agentic loops) |
| `GET` | `/v1/responses/{id}` | Retrieve stored response |
| `POST` | `/v1/responses/{id}/cancel` | Cancel background response |
| `DELETE` | `/v1/responses/{id}` | Delete response |
| `GET` | `/v1/responses/{id}/input_items` | List response input items |
| `POST` | `/v1/conversations` | Create conversation |
| `GET` | `/v1/conversations/{id}` | Get conversation |
| `POST` | `/v1/conversations/{id}` | Update conversation |
| `DELETE` | `/v1/conversations/{id}` | Delete conversation |
| `GET` | `/v1/conversations/{id}/items` | List conversation items |
| `POST` | `/v1/conversations/{id}/items` | Add items to conversation |
| `GET` | `/v1/conversations/{id}/items/{item_id}` | Get conversation item |
| `DELETE` | `/v1/conversations/{id}/items/{item_id}` | Delete conversation item |
| Method | Path | Description |
|---|---|---|
| `POST` | `/workers` | Queue worker registration (returns 202 Accepted) |
| `GET` | `/workers` | List workers with health, load, and policy metadata |
| `GET` | `/workers/{worker_id}` | Inspect specific worker or job queue entry |
| `PUT` | `/workers/{worker_id}` | Queue worker update |
| `DELETE` | `/workers/{worker_id}` | Queue worker removal |
| Method | Path | Description |
|---|---|---|
| `GET` | `/liveness` | Health check (always returns OK) |
| `GET` | `/readiness` | Readiness check (checks healthy worker availability) |
| `GET` | `/health` | Alias for liveness |
| `GET` | `/health_generate` | Health generate test |
| `GET` | `/engine_metrics` | Engine-level metrics from workers |
| `GET` | `/v1/models` | List available models |
| `GET` | `/get_model_info` | Get model information |
| `GET` | `/get_server_info` | Get server information |
| `POST` | `/flush_cache` | Clear all caches |
| `GET` | `/get_loads` | Get all worker loads |
| `POST` | `/wasm` | Upload WASM module |
| `GET` | `/wasm` | List WASM modules |
| `DELETE` | `/wasm/{module_uuid}` | Remove WASM module |
| Policy | Description | Usage |
|---|---|---|
| `random` | Uniform random selection | `--policy random` |
| `round_robin` | Cycles through workers in order | `--policy round_robin` |
| `power_of_two` | Samples two workers and picks the lighter one | `--policy power_of_two` |
| `cache_aware` | Combines cache locality with load balancing (default) | `--policy cache_aware` |
| `bucket` | Divides workers into load buckets with dynamic boundaries | `--policy bucket` |
| Parameter | Default | Description |
|---|---|---|
| `--cache-threshold` | 0.3 | Minimum prefix match ratio for cache hit |
| `--balance-abs-threshold` | 64 | Absolute load difference before rebalancing |
| `--balance-rel-threshold` | 1.5 | Relative load ratio before rebalancing |
| `--eviction-interval-secs` | 120 | Cache eviction cadence in seconds |
| `--max-tree-size` | 67108864 | Maximum nodes in cache tree |
| Parameter | Default | Description |
|---|---|---|
| `--pool-idle-timeout-secs` | 50 | Idle timeout in seconds for pooled upstream HTTP connections. Can also be set with `SMG_POOL_IDLE_TIMEOUT_SECS`. |
| `--connect-timeout-secs` | 10 | Timeout in seconds for new upstream HTTP connections. Can also be set with `SMG_CONNECT_TIMEOUT_SECS`. |
| `--pool-max-idle-per-host` | 500 | Maximum idle upstream HTTP connections to keep per host. Can also be set with `SMG_POOL_MAX_IDLE_PER_HOST`. |
| `--tcp-keepalive-secs` | 30 | TCP keepalive idle time in seconds for upstream HTTP connections. Can also be set with `SMG_TCP_KEEPALIVE_SECS`. |
| Parameter | Default | Description |
|---|---|---|
| `--retry-max-retries` | 5 | Maximum retry attempts |
| `--retry-initial-backoff-ms` | 50 | Initial backoff duration (ms) |
| `--retry-max-backoff-ms` | 5000 | Maximum backoff duration (ms) |
| `--retry-backoff-multiplier` | 2.0 | Exponential backoff multiplier |
| `--retry-jitter-factor` | 0.1 | Random jitter factor (0.0-1.0) |
| `--disable-retries` | false | Disable retries entirely |
| Parameter | Default | Description |
|---|---|---|
| `--cb-failure-threshold` | 5 | Consecutive failures to open circuit |
| `--cb-success-threshold` | 2 | Successes to close from half-open |
| `--cb-timeout-duration-secs` | 30 | Time before half-open attempt |
| `--cb-window-duration-secs` | 60 | Failure counting window |
| `--disable-circuit-breaker` | false | Disable circuit breaker |
| Parser ID | Model Family | Think Tokens |
|---|---|---|
| `deepseek-r1` | DeepSeek-R1 | `<think>...</think>` (initial reasoning) |
| `qwen3` | Qwen-3 | `<think>...</think>` |
| `qwen3-thinking` | Qwen-3 Thinking | `<think>...</think>` (initial reasoning) |
| `kimi` | Kimi K2 | Unicode think tokens |
| `glm45` | GLM-4.5/4.6/4.7 | `<think>...</think>` |
| `step3` | Step-3 | `<think>...</think>` |
| `minimax` | MiniMax | `<think>...</think>` |
| Parser | Format | Description |
|---|---|---|
| `json` | JSON | Standard JSON tool calls |
| `python` | Pythonic | Python function call syntax |
| `xml` | XML | XML-formatted tool calls |
| Cache | Type | Description |
|---|---|---|
| L0 | Exact match | Whole-string caching for repeated prompts |
| L1 | Prefix match | Prefix boundary matching for incremental prompts |
| Transport | Description |
|---|---|
| STDIO | Local process execution |
| SSE | Server-Sent Events (HTTP) |
| Streamable | Bidirectional streaming |
| Backend | Description | Usage |
|---|---|---|
| `memory` | In-memory storage (default) | `--history-backend memory` |
| `none` | No persistence | `--history-backend none` |
| `oracle` | Oracle Autonomous Database | `--history-backend oracle` |
| `postgres` | PostgreSQL Database | `--history-backend postgres` |
| `redis` | Redis | `--history-backend redis` |
| Attach Point | When Executed | Use Cases |
|---|---|---|
| `OnRequest` | Before forwarding to workers | Auth, rate limiting, request modification |
| `OnResponse` | After receiving worker response | Logging, response modification, error handling |
| Action | Description |
|---|---|
| `Continue` | Proceed without modification |
| `Reject(status)` | Reject request with HTTP status code |
| `Modify(...)` | Modify headers, body, or status |
| Example | Description |
|---|---|
| `auth/` | API key authentication for protected routes |
| `rate_limit/` | Per-client rate limiting (requests/minute) |
| `logging/` | Request tracking headers and response modification |
| Parameter | Default | Description |
|---|---|---|
| `max_memory_pages` | 1024 (64MB) | Maximum WASM memory |
| `max_execution_time_ms` | 1000 | Execution timeout |
| `max_stack_size` | 1MB | Stack size limit |
| `module_cache_size` | 10 | Cached modules per worker |
| Example | Description |
|---|---|
| `simple/` | Non-streaming chat completion |
| `streaming/` | Streaming chat completion with SSE |
| `oai_server/` | Full OpenAI-compatible HTTP server |
| Feature | Python | Go |
|---|---|---|
| **Primary Use** | Gateway server launcher | gRPC client library |
| **CLI Support** | Full CLI (smg, sglang-router) | Library only |
| **K8s Discovery** | Native support | N/A (client library) |
| **PD Mode** | Built-in | N/A (client library) |
| Parameter | Description |
|---|---|
| `--tls-cert-path` | Path to server certificate (PEM format) |
| `--tls-key-path` | Path to server private key (PEM format) |
| Parameter | Description |
|---|---|
| `--client-cert-path` | Path to client certificate for mTLS (PEM format) |
| `--client-key-path` | Path to client private key for mTLS (PEM format) |
| `--ca-cert-path` | Path to CA certificate for verifying worker TLS (PEM format, repeatable) |
| Layer | Prefix | Metrics |
|---|---|---|
| HTTP | `smg_http_*` | `requests_total`, `request_duration_seconds`, `responses_total`, `connections_active`, `rate_limit_total` |
| Router | `smg_router_*` | `requests_total`, `request_duration_seconds`, `request_errors_total`, `stage_duration_seconds`, `upstream_responses_total` |
| Inference | `smg_router_*` | `ttft_seconds`, `tpot_seconds`, `tokens_total`, `generation_duration_seconds` |
| Worker | `smg_worker_*` | `pool_size`, `connections_active`, `requests_active`, `health_checks_total`, `selection_total`, `errors_total` |
| Circuit Breaker | `smg_worker_cb_*` | `state`, `transitions_total`, `outcomes_total`, `consecutive_failures`, `consecutive_successes` |
| Retry | `smg_worker_*` | `retries_total`, `retries_exhausted_total`, `retry_backoff_seconds` |
| Discovery | `smg_discovery_*` | `registrations_total`, `deregistrations_total`, `sync_duration_seconds`, `workers_discovered` |
| MCP | `smg_mcp_*` | `tool_calls_total`, `tool_duration_seconds`, `servers_active`, `tool_iterations_total` |
| Database | `smg_db_*` | `operations_total`, `operation_duration_seconds`, `connections_active`, `items_stored` |
| Metric | Type | Description |
|---|---|---|
| `smg_router_ttft_seconds` | Histogram | Time to first token |
| `smg_router_tpot_seconds` | Histogram | Time per output token |
| `smg_router_tokens_total` | Counter | Total tokens (input/output) |
| `smg_router_generation_duration_seconds` | Histogram | End-to-end generation time |
| Component | Shared Across Replicas | Impact |
|---|---|---|
| Worker Registry | No (independent) | Each replica discovers workers independently |
| Radix Cache Tree | No (independent) | Cache hits may decrease by 10-20% |
| Circuit Breaker State | No (independent) | Each replica tracks failures independently |
| Rate Limiting | No (independent) | Limits apply per-replica, not globally |
| Parameter | Recommendation | Reason |
|---|---|---|
| `--policy` | `cache_aware` | Best for repeated prompts, \~30% latency reduction |
| `--max-concurrent-requests` | 2-4x worker count | Prevent overload while maximizing throughput |
| `--queue-size` | 2x max-concurrent | Buffer for burst traffic |
| `--request-timeout-secs` | Based on max generation length | Prevent stuck requests |
| Parameter | Type | Default | Description |
|---|---|---|---|
| `--host` | str | 127.0.0.1 | Router host |
| `--port` | int | 30000 | Router port |
| `--worker-urls` | list | \[] | Worker URLs (HTTP or gRPC) |
| `--policy` | str | cache\_aware | Routing policy |
| `--max-concurrent-requests` | int | -1 | Concurrency limit (-1 disables) |
| `--request-timeout-secs` | int | 600 | Request timeout |
| `--max-payload-size` | int | 256MB | Maximum request payload |
| Parameter | Type | Default | Description |
|---|---|---|---|
| `--pd-disaggregation` | flag | false | Enable PD mode |
| `--prefill` | list | \[] | Prefill URLs + optional bootstrap ports |
| `--decode` | list | \[] | Decode URLs |
| `--prefill-policy` | str | None | Override policy for prefill nodes |
| `--decode-policy` | str | None | Override policy for decode nodes |
| `--worker-startup-timeout-secs` | int | 600 | Worker init timeout |
| Parameter | Type | Description |
|---|---|---|
| `--service-discovery` | flag | Enable discovery |
| `--selector` | list | Label selectors (key=value) |
| `--prefill-selector` / `--decode-selector` | list | PD mode selectors |
| `--service-discovery-namespace` | str | Namespace to watch |
| `--service-discovery-port` | int | Worker port (default 80) |
| `--bootstrap-port-annotation` | str | Annotation for bootstrap ports |
| Parameter | Type | Description |
|---|---|---|
| `--tls-cert-path` | str | Server certificate for gateway HTTPS (PEM) |
| `--tls-key-path` | str | Server private key for gateway HTTPS (PEM) |
| `--client-cert-path` | str | Client certificate for worker mTLS (PEM) |
| `--client-key-path` | str | Client private key for worker mTLS (PEM) |
| `--ca-cert-path` | str | CA certificate for verifying workers (PEM, repeatable) |
| Field | Description | Defaults | Options |
|---|---|---|---|
| `tags` | Which memory regions to release. If omitted, all are released. | `None` | Type: list\[str], values: `kv_cache`, `weights` |
| Field | Description | Defaults | Options |
|---|---|---|---|
| `tags` | Which memory regions to resume. If omitted, all are resumed. | `None` | Type: list\[str], values: `kv_cache`, `weights` |
| Field | Description | Defaults | Options |
|---|---|---|---|
| `model_path` | The model path with the new weights. | Required | Type: str |
| `load_format` | The format to load the weights. | `None` | Type: str |
| `abort_all_requests` | Abort all running requests before update. | `False` | Type: bool |
| `weight_version` | Optional weight version label tracked by the server. | `None` | Type: str |
| `is_async` | Perform weight load asynchronously. | `False` | Type: bool |
| `torch_empty_cache` | Empty torch cache. | `False` | Type: bool |
| `keep_pause` | Keep scheduler paused after update. | `False` | Type: bool |
| `recapture_cuda_graph` | Recapture CUDA graphs after update. | `False` | Type: bool |
| `token_step` | Trainer step id for rollout bookkeeping. | `0` | Type: int |
| `flush_cache` | Flush KV cache after update. | `True` | Type: bool |
| Field | Description | Defaults | Options |
|---|---|---|---|
| `success` | Whether the update succeeded. | - | Type: bool |
| `message` | Status / error message. | - | Type: str |
| `num_paused_requests` | Number of paused requests during update. | `0` | Type: int |
| Field | Description | Defaults | Options |
|---|---|---|---|
model\_path |
The model path with the new weights. | Required | Type: str |
flush\_cache |
Flush TeaCache state after update. | True |
Type: bool |
target\_modules |
List of module names to update (e.g. \["transformer"]). If omitted, all nn.Module components are updated. |
None |
Type: list\[str] |
| Field | Description | Defaults | Options |
|---|---|---|---|
success |
Whether the update succeeded. | - | Type: bool |
message |
Status / error message. | - | Type: str |
| Field | Description | Defaults | Options |
|---|---|---|---|
serialized\_named\_tensors |
Per-TP serialized tensor payloads. | Required | Type: list\[str|bytes] |
load\_format |
Optional load format selector. | None |
None, direct, flattened\_bucket, or a custom loader path string |
flush\_cache |
Flush KV cache after update. | True |
Type: bool |
abort\_all\_requests |
Abort all running requests before update. | False |
Type: bool |
weight\_version |
Optional version label tracked by the server. | None |
Type: str |
| Field | Description | Defaults | Options |
|---|---|---|---|
| `master_address` | Group master address. | Required | Type: str |
| `master_port` | Group master port. | Required | Type: int |
| `rank_offset` | Offset for local rank mapping. | Required | Type: int |
| `world_size` | Total world size. | Required | Type: int |
| `group_name` | Group name. | `weight_update_group` | Type: str |
| `backend` | Communication backend. | `nccl` | Type: str |
| Field | Description | Defaults | Options |
|---|---|---|---|
| `names` | Parameter names to update. | Required | Type: list\[str] |
| `dtypes` | Dtype strings for each parameter. | Required | Type: list\[str] |
| `shapes` | Tensor shapes. | Required | Type: list\[list\[int]] |
| `group_name` | Group name. | `weight_update_group` | Type: str |
| `flush_cache` | Flush KV cache after update. | `True` | Type: bool |
| `abort_all_requests` | Abort all running requests before update. | `False` | Type: bool |
| `weight_version` | Optional version label. | `None` | Type: str |
| `load_format` | Optional format selector. | `None` | `None` or `flattened_bucket` |
| Field | Description | Defaults | Options |
|---|---|---|---|
| `group_name` | Group name. | `weight_update_group` | Type: str |
| Field | Description | Defaults | Options |
|---|---|---|---|
| `mode` | Pause mode. | `abort` | `abort`, `retract`, `in_place` |
| Method | Draft source | Separate draft model? | How to enable | Notes / constraints |
|---|---|---|---|---|
| EAGLE-2 | EAGLE draft model (feature drafting + tree) | Typically yes | --speculative-algorithm EAGLE + --speculative-draft-model-path ... |
Tune --speculative-num-steps, --speculative-eagle-topk, --speculative-num-draft-tokens |
EAGLE-2 + torch.compile |
Same as EAGLE-2 | Typically yes | Add --enable-torch-compile (optionally --torch-compile-max-bs) |
Benefit varies by hardware/model; benchmark to verify |
| EAGLE-2 + FR-Spec | Same as EAGLE-2 + token subset | Typically yes | Add --speculative-token-map ... |
Reduces lm\_head overhead with high-frequency token vocab |
| EAGLE-3 | EAGLE3 draft model | Yes | --speculative-algorithm EAGLE3 + --speculative-draft-model-path ... |
Best throughput in the benchmark below |
| MTP | Built-in multi-token heads (model-specific) | Often no | See Multi Token Prediction section | Uses speculative workflow; draft path may be auto-handled for some models |
| DFLASH | DFlash draft model (linear block verification) | Yes | --speculative-algorithm DFLASH + --speculative-draft-model-path ... |
No --enable-dp-attention; pp\_size == 1; disables overlap scheduler & mixed chunked prefill |
| STANDALONE | Smaller draft LLM (token-level) | Yes | --speculative-algorithm STANDALONE + --speculative-draft-model-path ... |
Does not support --enable-dp-attention |
| NGRAM | Ngram cache from previous tokens | No | --speculative-algorithm NGRAM |
CUDA-only; no --enable-dp-attention; disables overlap scheduler & mixed chunked prefill |
| Method | Throughput (tokens/s) |
|---|---|
| SGLang (w/o speculative, 1x H100) | 158.34 tokens/s |
| SGLang + EAGLE-2 (1x H100) | 244.10 tokens/s |
| SGLang + EAGLE-3 (1x H100) | 373.25 tokens/s |
| Parameter | Description | Default |
|---|---|---|
--speculative-draft-model-path |
Draft model path/weights. Typically required for EAGLE/EAGLE3 and STANDALONE. For some MTP-enabled models, this can be omitted. | None |
--speculative-num-steps |
Depth of autoregressive drafting. Increases speculation range but risks rejection cascades. | Auto (5 for Llama/Grok; 3 for many other models) |
--speculative-eagle-topk |
Branching factor per step. Improves candidate diversity and acceptance rate, but increases memory/compute consumption. | Auto (4 for Llama/Grok; 1 for many other models) |
--speculative-num-draft-tokens |
Maximum parallel verification capacity. Allows deeper tree evaluation but increases GPU memory usage. | Auto (8 for Llama/Grok; 4 for many other models). If topk=1, it is adjusted to num\_steps + 1. |
--speculative-accept-threshold-single |
Acceptance threshold for single-token verification. Lower values accept more aggressively. | 1.0 |
--speculative-accept-threshold-acc |
Accumulated acceptance threshold across steps. | 1.0 |
--speculative-attention-mode |
Attention mode for speculative operations (prefill or decode), affecting both target verification and draft extension. |
"prefill" |
--speculative-draft-attention-backend |
Override attention backend for the draft model. | None (same as target) |
--speculative-draft-model-quantization |
Quantization method for the draft model. Use "unquant" to force no quantization even when the target model is quantized. |
Same as target model |
--speculative-draft-model-revision |
Specific revision/commit of the draft model to load. | None (auto-set to "main" when --speculative-draft-model-path is set and revision is omitted) |
--speculative-draft-load-format |
Load format for the draft model weights. | None |
| Parameter | Description | Default |
|---|---|---|
--speculative-draft-model-path |
Required DFlash draft model path/weights. | None |
--speculative-num-draft-tokens |
DFlash verify block size. | Inferred from draft config, otherwise 16 |
--speculative-dflash-block-size |
Alias of --speculative-num-draft-tokens for DFlash. |
None |
--speculative-dflash-draft-window-size |
Draft KV sliding-window size. Must be >= speculative-num-draft-tokens when set. |
None |
| Parameter | Description | Default |
|---|---|---|
--speculative-draft-model-path |
Draft model weights (smaller than the target model). | None |
--speculative-num-steps |
Draft depth (how many steps the draft model runs autoregressively). | 3 (auto default for STANDALONE) |
--speculative-eagle-topk |
Branching factor (token candidates per step). | 1 (auto default for STANDALONE) |
--speculative-num-draft-tokens |
Verification capacity. | 4 (auto default for STANDALONE) |
--speculative-draft-model-quantization |
Quantization for the draft model. Use "unquant" to disable quantization on the draft even when the target is quantized. |
Same as target |
| Parameter | Description | Default |
|---|---|---|
--speculative-num-draft-tokens |
Number of draft tokens verified per step. If omitted, defaults to min(--speculative-ngram-max-trie-depth, 12). |
12 (with default ngram settings) |
--speculative-ngram-min-bfs-breadth |
Minimum BFS breadth. | 1 |
--speculative-ngram-max-bfs-breadth |
Maximum BFS breadth. | 10 |
--speculative-ngram-match-type |
Ngram tree-building mode: "BFS" for recency-based expansion or "PROB" for frequency-based expansion. |
"BFS" |
--speculative-ngram-max-trie-depth |
Maximum suffix length stored and matched by the ngram trie. | 18 |
--speculative-ngram-capacity |
Cache capacity (number of entries). | 10,000,000 |
| Parameter | Type | Default | Description |
|---|---|---|---|
--speculative-algorithm |
str |
None |
Algorithm to use: DFLASH, EAGLE, EAGLE3, STANDALONE, NGRAM, NEXTN (alias of EAGLE) |
--speculative-draft-model-path |
str |
None |
Path to the draft model weights |
--speculative-draft-model-revision |
str |
None |
Specific revision/commit of the draft model ("main" is auto-used when draft path is set and revision is omitted) |
--speculative-draft-load-format |
str |
None |
Load format for draft model weights |
--speculative-num-steps |
int |
None (auto-chosen when omitted) |
Autoregressive drafting depth |
--speculative-eagle-topk |
int |
None (auto-chosen when omitted) |
Branching factor per drafting step |
--speculative-num-draft-tokens |
int |
None (auto-chosen when omitted) |
Maximum number of draft tokens for verification |
--speculative-dflash-block-size |
int |
None |
DFlash-only alias of --speculative-num-draft-tokens |
--speculative-dflash-draft-window-size |
int |
None |
DFlash-only draft KV sliding-window size |
--speculative-accept-threshold-single |
float |
1.0 |
Single-token acceptance threshold |
--speculative-accept-threshold-acc |
float |
1.0 |
Accumulated acceptance threshold |
--speculative-token-map |
str |
None |
Path to FR-Spec high-frequency token map |
--speculative-attention-mode |
str |
"prefill" |
Attention mode for speculative operations ("prefill" or "decode") |
--speculative-draft-attention-backend |
str |
None |
Override attention backend for the draft model |
--speculative-moe-runner-backend |
str |
None |
MoE runner backend for the draft model |
--speculative-moe-a2a-backend |
str |
None |
MoE all-to-all backend for the draft model |
--speculative-draft-model-quantization |
str |
Same as target | Quantization for the draft model ("unquant" to disable) |
| Parameter | Type | Default | Description |
|---|---|---|---|
--speculative-ngram-min-bfs-breadth |
int |
1 |
Minimum BFS breadth |
--speculative-ngram-max-bfs-breadth |
int |
10 |
Maximum BFS breadth |
--speculative-ngram-match-type |
str |
"BFS" |
Ngram tree-building mode: "BFS" for recency-based expansion or "PROB" for frequency-based expansion |
--speculative-ngram-max-trie-depth |
int |
18 |
Maximum suffix length stored and matched by the ngram trie |
--speculative-ngram-capacity |
int |
10,000,000 |
Cache capacity |
| Variable | Default | Description |
|---|---|---|
SGLANG\_NGRAM\_FORCE\_GREEDY\_VERIFY |
False |
Force greedy verification for ngram decoding |
| Parameter | Description |
|---|---|
--enable-multi-layer-eagle |
Enable multi-layer EAGLE (auto-enabled for MiMoV2 and Step3p5 models) |
--enable-torch-compile |
Enable torch.compile for kernel-level optimizations |
--torch-compile-max-bs |
Maximum batch size for torch.compile |
| Endpoint | Method | Description |
|---|---|---|
| `/` | GET, HEAD | Health check for Ollama CLI |
| `/api/tags` | GET | List available models |
| `/api/chat` | POST | Chat completions (streaming & non-streaming) |
| `/api/generate` | POST | Text generation (streaming & non-streaming) |
| `/api/show` | POST | Model information |
| Component | Purpose |
|---|---|
| **Ollama API** | Familiar CLI/API that developers already know |
| **SGLang Backend** | High-performance inference engine |
| **Smart Router** | Intelligent routing - fast local for simple tasks, powerful remote for complex tasks |
| Model Family | Chat Template Parameter | Reasoning Parser | Notes |
|---|---|---|---|
| DeepSeek-R1 (R1, R1-0528, R1-Distill) | `enable_thinking` | `--reasoning-parser deepseek-r1` | Standard reasoning models |
| DeepSeek-V3.1 | `thinking` | `--reasoning-parser deepseek-v3` | Hybrid model (thinking/non-thinking modes) |
| Qwen3 (standard) | `enable_thinking` | `--reasoning-parser qwen3` | Hybrid model (thinking/non-thinking modes) |
| Qwen3-Thinking | N/A (always enabled) | `--reasoning-parser qwen3-thinking` | Always generates reasoning |
| Kimi | N/A (always enabled) | `--reasoning-parser kimi` | Kimi thinking models |
| Gpt-Oss | N/A (always enabled) | `--reasoning-parser gpt-oss` | Gpt-Oss thinking models |
| Argument | Type/Default | Description |
|---|---|---|
| text | `Optional[Union[List[str], str]] = None` | The input prompt. Can be a single prompt or a batch of prompts. |
| input\_ids | `Optional[Union[List[List[int]], List[int]]] = None` | The token IDs for text; one can specify either text or input\_ids. |
| input\_embeds | `Optional[Union[List[List[List[float]]], List[List[float]]]] = None` | The embeddings for input\_ids; one can specify either text, input\_ids, or input\_embeds. |
| image\_data | `Optional[Union[List[List[ImageDataItem]], List[ImageDataItem], ImageDataItem]] = None` | The image input. Supports three formats: (1) **Raw images**: PIL Image, file path, URL, or base64 string; (2) **Processor output**: Dict with `format: "processor_output"` containing HuggingFace processor outputs; (3) **Precomputed embeddings**: Dict with `format: "precomputed_embedding"` and `feature` containing pre-calculated visual embeddings. Can be a single image, list of images, or list of lists of images. See [Multimodal Input Formats](#multimodal) for details. |
| audio\_data | `Optional[Union[List[AudioDataItem], AudioDataItem]] = None` | The audio input. Can be a file name, URL, or base64 encoded string. |
| sampling\_params | `Optional[Union[List[Dict], Dict]] = None` | The sampling parameters as described in the sections below. |
| rid | `Optional[Union[List[str], str]] = None` | The request ID. |
| return\_logprob | `Optional[Union[List[bool], bool]] = None` | Whether to return log probabilities for tokens. |
| logprob\_start\_len | `Optional[Union[List[int], int]] = None` | If return\_logprob, the start location in the prompt for returning logprobs. Default is "-1", which returns logprobs for output tokens only. |
| top\_logprobs\_num | `Optional[Union[List[int], int]] = None` | If return\_logprob, the number of top logprobs to return at each position. |
| token\_ids\_logprob | `Optional[Union[List[List[int]], List[int]]] = None` | If return\_logprob, the token IDs to return logprob for. |
| return\_text\_in\_logprobs | `bool = False` | Whether to detokenize tokens in text in the returned logprobs. |
| stream | `bool = False` | Whether to stream output. |
| lora\_path | `Optional[Union[List[Optional[str]], Optional[str]]] = None` | The path to the LoRA. |
| custom\_logit\_processor | `Optional[Union[List[Optional[str]], str]] = None` | Custom logit processor for advanced sampling control. Must be a serialized instance of `CustomLogitProcessor` using its `to_str()` method. For usage see below. |
| return\_hidden\_states | `Union[List[bool], bool] = False` | Whether to return hidden states. |
| return\_routed\_experts | `bool = False` | Whether to return routed experts for MoE models. Requires `--enable-return-routed-experts` server flag. With the default `routed_experts_start_len=0`, returns the full available sequence `[0, seqlen - 1)` because RL workflows need routed experts for the full sequence. The result is base64-encoded int32 expert IDs as a flattened array with logical shape `[num_tokens, num_layers, top_k]`. |
| routed\_experts\_start\_len | `int = 0` | If `return_routed_experts`, the absolute start position for returned routed-experts rows. `0` preserves the default full sequence; set it to an accumulated prefix length to return only `[routed_experts_start_len, seqlen - 1)`. For example, in multi-turn RL rollouts, routed experts for tokens from previous turns have already been collected, so setting this value avoids unnecessary transfer that cause bottlenecks. Must be in `[0, prompt_tokens]`. |
| Argument | Type/Default | Description |
|---|---|---|
| max\_new\_tokens | `int = 128` | The maximum output length measured in tokens. |
| stop | `Optional[Union[str, List[str]]] = None` | One or multiple [stop words](https://platform.openai.com/docs/api-reference/chat/create#chat-create-stop). Generation will stop if one of these words is sampled. |
| stop\_token\_ids | `Optional[List[int]] = None` | Provide stop words in the form of token IDs. Generation will stop if one of these token IDs is sampled. |
| stop\_regex | `Optional[Union[str, List[str]]] = None` | Stop when hitting any of the regex patterns in this list |
| temperature | `float (model default; fallback 1.0)` | [Temperature](https://platform.openai.com/docs/api-reference/chat/create#chat-create-temperature) when sampling the next token. `temperature = 0` corresponds to greedy sampling, a higher temperature leads to more diversity. |
| top\_p | `float (model default; fallback 1.0)` | [Top-p](https://platform.openai.com/docs/api-reference/chat/create#chat-create-top_p) selects tokens from the smallest sorted set whose cumulative probability exceeds `top_p`. When `top_p = 1`, this reduces to unrestricted sampling from all tokens. |
| top\_k | `int (model default; fallback -1)` | [Top-k](https://developer.nvidia.com/blog/how-to-get-better-outputs-from-your-large-language-model/#predictability_vs_creativity) randomly selects from the `k` highest-probability tokens. |
| min\_p | `float (model default; fallback 0.0)` | [Min-p](https://github.com/huggingface/transformers/issues/27670) samples from tokens with probability larger than `min_p * highest_token_probability`. |
| Argument | Type/Default | Description |
|---|---|---|
| frequency\_penalty | `float = 0.0` | Penalizes tokens based on their frequency in generation so far. Must be between `-2` and `2` where negative numbers encourage repeatment of tokens and positive number encourages sampling of new tokens. The scaling of penalization grows linearly with each appearance of a token. |
| presence\_penalty | `float = 0.0` | Penalizes tokens if they appeared in the generation so far. Must be between `-2` and `2` where negative numbers encourage repeatment of tokens and positive number encourages sampling of new tokens. The scaling of the penalization is constant if a token occurred. |
| repetition\_penalty | `float = 1.0` | Scales the logits of previously generated tokens to discourage (values > 1) or encourage (values \< 1) repetition. Valid range is `(0, 2]`; `1.0` leaves probabilities unchanged. |
| min\_new\_tokens | `int = 0` | Forces the model to generate at least `min_new_tokens` until a stop word or EOS token is sampled. Note that this might lead to unintended behavior, for example, if the distribution is highly skewed towards these tokens. |
| Argument | Type/Default | Description |
|---|---|---|
| json\_schema | `Optional[str] = None` | JSON schema for structured outputs. |
| regex | `Optional[str] = None` | Regex for structured outputs. |
| ebnf | `Optional[str] = None` | EBNF for structured outputs. |
| structural\_tag | `Optional[str] = None` | The structal tag for structured outputs. |
| Argument | Type/Default | Description |
|---|---|---|
| n | `int = 1` | Specifies the number of output sequences to generate per request. (Generating multiple outputs in one request (n > 1) is discouraged; repeating the same prompts several times offers better control and efficiency.) |
| ignore\_eos | `bool = False` | Don't stop generation when EOS token is sampled. |
| skip\_special\_tokens | `bool = True` | Remove special tokens during decoding. |
| spaces\_between\_special\_tokens | `bool = True` | Whether or not to add spaces between special tokens during detokenization. |
| no\_stop\_trim | `bool = False` | Don't trim stop words or EOS token from the generated text. |
| custom\_params | `Optional[List[Optional[Dict[str, Any]]]] = None` | Used when employing `CustomLogitProcessor`. For usage, see below. |
| Tool | HTTP Server | Scheduler | Use Case |
|---|---|---|---|
bench\_serving |
Yes (async HTTP client to a running server) | Yes (indirectly, via server) | Realistic online serving benchmarks with latency metrics (TTFT, TPOT, ITL) |
bench\_one\_batch\_server |
Yes (sends HTTP requests to a running server) | Yes (indirectly, via server) | End-to-end single-batch latency including HTTP and scheduler overhead |
bench\_offline\_throughput |
No | Yes (directly uses Engine in-process) |
Maximum throughput measurement without HTTP overhead |
bench\_one\_batch |
No | No (directly calls ModelRunner) |
Kernel-level latency profiling of a single static batch |
| Header | Namespace | Purpose |
|---|---|---|
utils.h |
host |
Host-side essentials: RuntimeCheck, CHECK\_HOST(cond) \<\< ..., Panic, div\_ceil, irange |
utils.cuh |
device / host |
Type aliases (fp16\_t, bf16\_t, ...), SGL\_DEVICE macro, PDL helpers, LaunchKernel, RuntimeDeviceCheck, CHECK\_CUDA(expr) \<\< ... |
source\_location.h |
(global) | Portable std::source\_location wrapper for error reporting |
runtime.cuh |
host::runtime |
CUDA runtime queries: get\_blocks\_per\_sm, get\_sm\_count, get\_cc\_major, get\_runtime\_version, get\_available\_dynamic\_smem\_per\_block |
| Header | Namespace | Purpose |
|---|---|---|
tensor.h |
host |
TensorMatcher, SymbolicSize, SymbolicDType, SymbolicDevice |
| Header | Namespace | Purpose |
|---|---|---|
math.cuh |
device::math |
max, min, abs, sqrt, rsqrt, exp, sin, cos, constants |
type.cuh |
(global) / device |
DTypeTrait\, packed\_t\, device::cast\ |
| Header | Namespace | Purpose |
|---|---|---|
vec.cuh |
device |
AlignedVector\ - vectorized load/store (up to 128-bit; 256-bit requires Blackwell GPUs) |
tile.cuh |
device::tile |
Memory\ - cooperative tiled memory I/O (thread/warp/CTA) |
| Header | Namespace | Purpose |
|---|---|---|
warp.cuh |
device::warp |
reduce\ (SUM/MAX/MIN, grouped or inter-group) and reduce\_sum / reduce\_max / reduce\_min wrappers via \_\_shfl\_xor\_sync |
cta.cuh |
device::cta |
reduce\_max across warps via shared memory |
atomic.cuh |
device::atomic |
max - atomic float max (CUDA + ROCm fallback) |
| Header | Namespace | Purpose |
|---|---|---|
impl/norm.cuh |
host::norm / device::norm |
RMSNorm building blocks (warp & CTA paths, StorageType) |
sglang.yaml>}>
```yaml Config theme={null}
# sglang.yaml
envs:
HF_TOKEN: null
resources:
image_id: docker:lmsysorg/sglang:latest
accelerators: A100
ports: 30000
run: |
conda deactivate
python3 -m sglang.launch_server \
--model-path meta-llama/Llama-3.1-8B-Instruct \
--host 0.0.0.0 \
--port 30000
```
build-and-push.sh>}>
```bash Command theme={null}
#!/bin/bash
AWS_ACCOUNT="| Parameter | Description |
|---|---|
Backend |
The serving backend under test (e.g., sglang, vllm). |
Traffic request rate |
Request generation rate in req/s. inf means maximum rate (concurrency-bounded). trace indicates trace timestamp mode. A fixed value enforces constant inter-arrival time. |
Max request concurrency |
Maximum number of concurrent requests from the client side. Displays not set when unspecified. |
| Parameter | Description | Format Specification |
|---|---|---|
Successful requests | Total number of successfully completed requests (HTTP 200, no generation errors). | Integer, no decimal places |
Benchmark duration (s) | Total elapsed time from first request sent to last response fully received (seconds). | 2 decimal places |
Total input tokens | Total number of input (prompt) tokens across all requests, counted by server-side tokenizer. | Integer, no decimal places |
Total input text tokens | Same as Total input tokens. For multimodal inputs, this may differ. | Integer, no decimal places |
Total generated tokens | Total number of output tokens actually generated by the server (server-side tokenizer count). | Integer, no decimal places |
Total generated tokens (retokenized) | Output text re-tokenized by the client using its own tokenizer. A large discrepancy indicates tokenizer mismatch or special tokens in output. | Integer, no decimal places |
Request throughput (req/s) | Number of successful requests processed per second. Formula: Successful requests / Benchmark duration (s). | 2 decimal places |
Input token throughput (tok/s) | Number of input tokens processed per second. Formula: Total input tokens / Benchmark duration (s). | 2 decimal places |
Output token throughput (tok/s) | Number of output tokens generated per second. Formula: Total generated tokens / Benchmark duration (s). | 2 decimal places |
Peak output token throughput (tok/s) | Observed instantaneous peak output token generation rate during the test (computed over a sliding window). | 2 decimal places |
Peak concurrent requests | Maximum number of requests being processed simultaneously on the server side. May exceed client-side Max request concurrency due to queueing. | Integer, no decimal places |
Total token throughput (tok/s) | Sum of input and output token throughputs. Formula: Input token throughput + Output token throughput. | 2 decimal places |
Concurrency | Average number of concurrent requests during the test (Little's Law). Formula: Sum of all E2E latencies / Benchmark duration. | 2 decimal places |
| Statistic | Description | Format |
|---|---|---|
Mean E2E Latency (ms) | Arithmetic mean | 2 decimal places |
Median E2E Latency (ms) | 50th percentile | 2 decimal places |
P90 E2E Latency (ms) | 90th percentile (90% of requests have latency ≤ this value) | 2 decimal places |
P99 E2E Latency (ms) | 99th percentile | 2 decimal places |
| Statistic | Description | Format |
|---|---|---|
Mean TTFT (ms) | Arithmetic mean | 2 decimal places |
Median TTFT (ms) | 50th percentile | 2 decimal places |
P99 TTFT (ms) | 99th percentile | 2 decimal places |
(E2E Latency - TTFT) / (Number of output tokens - 1)
| Statistic | Description | Format |
|---|---|---|
Mean TPOT (ms) | Arithmetic mean | 2 decimal places |
Median TPOT (ms) | 50th percentile | 2 decimal places |
P99 TPOT (ms) | 99th percentile | 2 decimal places |
| Statistic | Description | Format |
|---|---|---|
Mean ITL (ms) | Average inter-token interval | 2 decimal places |
Median ITL (ms) | 50th percentile inter-token interval | 2 decimal places |
P95 ITL (ms) | 95th percentile (used to detect stalls) | 2 decimal places |
P99 ITL (ms) | 99th percentile | 2 decimal places |
Max ITL (ms) | Maximum observed inter-token interval; useful for identifying severe blocking events | 2 decimal places |
| Component | Version | Obtain Method |
|---|---|---|
| HDK | 25.5.2 | link |
| CANN | 9.0.0 | Obtain Images |
| TorchNPU | 26.0.0 | link |
| MemFabric | 1.0.8 | `pip install memfabric-hybrid==1.0.8` |
| Triton | 3.2.1.dev20260530 | `pip install triton-ascend==3.2.1.dev20260530 \` `--extra-index-url=https://mirrors.huaweicloud.com/ascend/repos/pypi/nightly \` `--trusted-host mirrors.huaweicloud.com` |
| SGLang NPU Kernel | 2026.05.01.post3 | link |
| MemFabric-zbal | 1.1.1 | `pip install memfabric-zbal==1.1.1` |