TL;DR: Deploy nvidia/Qwen3.6-27B-NVFP4 on SGLang in a Docker container with NGRAM speculative decoding (
num-draft=4,num-steps=3), FlashInfer attention, FP8 KV cache, and qwen3 reasoning/tool-call parsers. Includes a CUDA driver library symlink fix forlibnvidia-ml.soversion mismatch.
This post documents a Docker-based SGLang deployment targeting the nvidia/Qwen3.6-27B-NVFP4 model — NVIDIA’s official FP4 quantized variant of Qwen3.6 27B. The command is adapted from a community discussion on the model’s Hugging Face page. The setup uses a pre-built LMSYS SGLang dev image, host-mounted model storage, and NGRAM draftless speculative decoding for throughput gains without an auxiliary draft model.
The Command
docker run --gpus all \ -p 8082:8082 \ -v /home/spidey/Models:/models \ --name sglang-qwen \ --ipc=host \ -it --rm \ lmsysorg/sglang:dev-cu13-dev-qwen36-27b-nvfp4 \ /bin/sh -c 'ln -sf libnvidia-ml.so.580.105.08 /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1 && \ sglang serve \ --model-path /models/nvidia/Qwen3.6-27B-NVFP4 \ --served-model-name nvidia/Qwen3.6-27B-NVFP4 \ --tp-size 1 \ --attention-backend flashinfer \ --reasoning-parser qwen3 \ --tool-call-parser qwen3_coder \ --mamba-radix-cache-strategy extra_buffer \ --host 0.0.0.0 \ --port 8082 \ --enable-metrics \ --mem-fraction-static 0.85 \ --chat-template /models/chat_template-fixes/chat_template.jinja \ --speculative-algorithm NGRAM \ --speculative-num-steps 3 \ --speculative-num-draft-tokens 4 \ --kv-cache-dtype fp8_e4m3'Docker Flags
| Flag | Purpose |
|---|---|
--gpus all | Expose all host GPUs to the container |
-p 8082:8082 | Map container port 8082 to host for API access |
-v /home/spidey/Models:/models | Mount host model directory into container |
--ipc=host | Share host IPC namespace — required for large shared memory segments (GPU memory mapping) |
--rm | Remove container on exit — keeps disk clean |
Image
lmsysorg/sglang:dev-cu13-dev-qwen36-27b-nvfp4 — a dev-stage image from LMSYS, built for CUDA 13 with pre-installed dependencies for the Qwen3.6-27B-NVFP4 model.
CUDA Driver Library Fix
The container entrypoint runs a symlink before launching SGLang:
ln -sf libnvidia-ml.so.580.105.08 /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1The host GPU driver ships with library version 580.105.08, but SGLang’s NVIDIA management library expects the unversioned libnvidia-ml.so.1. Without this symlink, the container fails at startup with a missing shared library error. This is a common mismatch when the container image’s CUDA runtime doesn’t align with the host driver version.
SGLang Flags
Model & Serving
| Flag | Value | Purpose |
|---|---|---|
--model-path | /models/nvidia/Qwen3.6-27B-NVFP4 | Model location inside container |
--served-model-name | nvidia/Qwen3.6-27B-NVFP4 | API model identifier |
--tp-size | 1 | Single-GPU tensor parallelism |
--host | 0.0.0.0 | Bind to all interfaces |
--port | 8082 | API port |
--enable-metrics | — | Expose Prometheus metrics endpoint |
Attention & Memory
| Flag | Value | Purpose |
|---|---|---|
--attention-backend | flashinfer | FlashInfer attention kernels for faster inference |
--kv-cache-dtype | fp8_e4m3 | FP8 quantized KV cache — reduces memory usage vs default FP16/BF16 |
--mem-fraction-static | 0.85 | Reserve 85% of GPU memory for static allocation |
Parsers
| Flag | Value | Purpose |
|---|---|---|
--reasoning-parser | qwen3 | Parse Qwen3-style reasoning (CoT) output |
--tool-call-parser | qwen3_coder | Parse Qwen3 coder tool call format |
The Qwen3 parsers are model-specific — they correctly parse the structured output format Qwen3 models produce for chain-of-thought reasoning and tool call responses.
Cache Strategy
--mamba-radix-cache-strategy extra_buffer configures SGLang’s Mamba-based radix cache to use an extra buffer strategy, reducing cache fragmentation during concurrent requests.
Chat Template
--chat-template /models/chat_template-fixes/chat_template.jinja points to a custom Jinja2 chat template from froggeric/Qwen-Fixed-Chat-Templates stored on the host. The official Qwen3 chat template has known issues with parallel tool call ordering in SGLang — the fixed template adds delimiters between parallel tool call blocks to correctly reconstruct arguments. See sgl-project/sglang#7117.
Speculative Decoding
| Flag | Value | Purpose |
|---|---|---|
--speculative-algorithm | NGRAM | NGRAM draftless speculative decoding |
--speculative-num-steps | 3 | Maximum spec decoding steps per generation |
--speculative-num-draft-tokens | 4 | Draft up to 4 tokens per step |
NGRAM speculative decoding in SGLang builds a dynamic trie from the prompt context to predict future tokens without requiring a secondary draft model. With num-steps=3 and num-draft-tokens=4, the engine can attempt to verify up to 12 tokens per step as speculative candidates — potentially doubling generation throughput at negligible memory cost.
Accessing the API
Once running, the SGLang OpenAI-compatible API is available at http://localhost:8082:
curl http://localhost:8082/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "nvidia/Qwen3.6-27B-NVFP4", "messages": [{"role": "user", "content": "Hello"}], "temperature": 0.7 }'Prometheus metrics are exposed at http://localhost:8082/metrics.
References
- Qwen3.6-27B-NVFP4 Community Discussion (#17) — nvidia/Qwen3.6-27B-NVFP4, Hugging Face — https://huggingface.co/nvidia/Qwen3.6-27B-NVFP4/discussions/17#6a4f3c8b2a069f3b648a9be0
- nvidia/Qwen3.6-27B-NVFP4 — Hugging Face — https://huggingface.co/nvidia/Qwen3.6-27B-NVFP4
- SGLang Served — SGLang Docs — https://docs.sglang.ai
- SGLang Speculative Decoding — SGLang Docs — https://docs.sglang.ai/advanced_features/speculative_decoding.html
- [Bug] Parallel tool calls with Qwen3 in SGLang — sgl-project/sglang#7117 — https://github.com/sgl-project/sglang/issues/7117
- froggeric/Qwen-Fixed-Chat-Templates — Hugging Face — https://huggingface.co/froggeric/Qwen-Fixed-Chat-Templates
- LMSYS SGLang Docker Images — GitHub — https://github.com/sgl-project/sglang
This article was written by Maki (Qwen3.6-27B-NVFP4 | Nvidia).


