TL;DR: Qwen3.6-27B FP8 fits on RTX 5090 (32 GB) with ~54 tok/s baseline. The Ex0bit EAGLE-3 drafter pushes this to ~183 tok/s (1.97×) on BF16 — the fastest single-GPU coding agent path. Qwen3.6-35B-A3B FP8 exceeds 32 GB and needs CPU offload or NVFP4.
Why Qwen3.6 for Local Coding
Qwen3.6-27B scores 77.2% on SWE-bench Verified, outperforming Claude 4.5 Opus on Terminal-Bench. The 35B-A3B MoE variant adds agentic coding capabilities with tool calling and repository-level reasoning. Both support 262K context and native MTP (Multi-Token Prediction) for speculative decoding via SGLang.
For local coding agents, the 27B dense variant is the sweet spot on a single RTX 5090. The 35B-A3B MoE requires careful memory management.
Hardware Reality Check
| Model | Precision | Weight VRAM | KV Cache (headroom) | Fits on 5090? |
|---|---|---|---|---|
| Qwen3.6-27B | BF16 | ~54 GB | — | No |
| Qwen3.6-27B | FP8 | ~27 GB | ~5 GB | Yes, tight |
| Qwen3.6-27B | NVFP4 | ~14 GB | ~18 GB | Yes, comfortable |
| Qwen3.6-35B-A3B | BF16 | ~70 GB | — | No |
| Qwen3.6-35B-A3B | FP8 | ~35 GB | OOM | No (needs offload) |
| Qwen3.6-35B-A3B | NVFP4 | ~17.5 GB | ~14.5 GB | Yes |
Setup SGLang with uv
uv is the fastest way to get SGLang running — it resolves and caches deps in seconds:
# 1. Create isolated environmentuv venv .sglang --python 3.12source .sglang/bin/activate
# 2. Install SGLang with all extras (FlashInfer, ModelOpt, etc.)uv pip install "sglang[all]>=0.5.12" --prerelease=allow
# 3. Verify installationpython3 -m sglang.check_envPre-requisites:
- CUDA 12.9 or 13.0 — verify with
nvcc --version. RTX 5090 needs CUDA 12.8+ minimum. - CUDA_HOME — set if missing:
export CUDA_HOME=/usr/local/cuda - FlashInfer — installed automatically via
[all]extras. Requires sm75+ (RTX 5090 is sm_120, fully supported). - ModelOpt — for NVFP4, install separately:
uv pip install nvidia-modelopt accelerate
Skip [all] extras if you don’t need ModelOpt or speculative decoding — the base sglang package is ~2 GB smaller:
uv pip install "sglang>=0.5.12" --prerelease=allowDeploying Qwen3.6-27B-FP8
sglang serve \ --model-path Qwen/Qwen3.6-27B-FP8 \ --quantization fp8 \ --reasoning-parser qwen3 \ --tool-call-parser qwen3_coder \ --speculative-algorithm EAGLE \ --speculative-num-steps 3 \ --speculative-eagle-topk 1 \ --speculative-num-draft-tokens 4 \ --mem-fraction-static 0.85 \ --max-running-requests 128 \ --cuda-graph-max-bs 256 \ --chunked-prefill-size 8192 \ --schedule-conservativeness 0.5 \ --host 0.0.0.0 \ --port 30000Flag Breakdown for Coding Workloads
| Flag | Value | Why |
|---|---|---|
--model-path | Qwen/Qwen3.6-27B-FP8 | FP8 cuts weight VRAM to 27 GB |
--mem-fraction-static | 0.85 | Reserves ~5 GB for activations/CUDA graphs |
--max-running-requests | 128 | Balance concurrency vs KV cache pressure |
--cuda-graph-max-bs | 256 | Graph capture for batch 256; lower than defaults to save VRAM |
--chunked-prefill-size | 8192 | Splits long code contexts into manageable chunks |
--schedule-conservativeness | 0.5 | Admit requests aggressively; watch for OOM |
--speculative-algorithm EAGLE | MTP | Native speculative decoding via MTP heads |
Deploying NVFP4 (Blackwell-native, Experimental)
NVFP4 drops weights to ~14 GB, leaving ~18 GB for KV cache. Requires --quantization modelopt to load the pre-quantized checkpoint correctly.
sglang serve \ --model-path nvidia/Qwen3.6-27B-NVFP4 \ --quantization modelopt \ --mem-fraction-static 0.92 \ --max-running-requests 256 \ --cuda-graph-max-bs 512 \ --host 0.0.0.0 \ --port 3000035B-A3B on RTX 5090
Qwen3.6-35B-A3B FP8 weights (~35 GB) exceed the 5090’s 32 GB. Two paths exist:
Path 1: CPU Offload
sglang serve \ --model-path Qwen/Qwen3.6-35B-A3B-FP8 \ --quantization fp8 \ --cpu-offload-gb 8 \ --mem-fraction-static 0.9 \ --reasoning-parser qwen3 \ --tool-call-parser qwen3_coderOffloads ~8 GB to system RAM. Expect 20–40% speed penalty on layers that spill.
Path 2: NVFP4 (Experimental)
Official nvidia/Qwen3.6-35B-A3B-NVFP4 (~22 GB) fits entirely on the 5090:
sglang serve \ --model-path nvidia/Qwen3.6-35B-A3B-NVFP4 \ --quantization modelopt \ --mem-fraction-static 0.90 \ --max-running-requests 192 \ --reasoning-parser qwen3 \ --tool-call-parser qwen3_coderSpeculative Decoding: MTP vs EAGLE-3 Drafter
Qwen3.6 ships with mtp.safetensors — native Multi-Token Prediction heads. SGLang uses these via the EAGLE algorithm for built-in speculative decoding. For deeper speedup, the community Ex0bit EAGLE-3 drafter trains a separate draft model tuned for long-horizon coding work.
| Configuration | Decode Speed | Speedup |
|---|---|---|
| Qwen3.6-27B BF16, no spec | ~54–93 tok/s | baseline |
| Qwen3.6-27B BF16 + MTP | ~80–120 tok/s | 1.4–1.8× |
| Qwen3.6-27B BF16 + Ex0bit EAGLE-3 | ~183 tok/s | 1.97× |
Native MTP (No Patch Required)
Qwen3.6’s built-in MTP heads work out of the box:
sglang serve \ --model-path Qwen/Qwen3.6-27B-FP8 \ --quantization fp8 \ --speculative-algorithm EAGLE \ --speculative-num-steps 3 \ --speculative-eagle-topk 1 \ --speculative-num-draft-tokens 4MTP speedup depends on the task. Coding with high token repetition (boilerplate, imports) benefits more than creative writing. Accept length of ~2–3 means each target forward pass verifies 2–3 tokens instead of 1.
Ex0bit EAGLE-3 Drafter (Recommended)
Ex0bit/Qwen3.6-27B-PRISM-EAGLE3 is a 0.6B trainable draft head validated on both Qwen/Qwen3.6-27B (stock) and its PRISM-PRO variant. The compressed variant (32K vocab, 1.1 GB) is recommended for serving.
Setup (SGLang ≥ 0.5.12):
# 1. Clone and patch SGLang for EAGLE-3 on Qwen3.6huggingface-cli download Ex0bit/Qwen3.6-27B-PRISM-EAGLE3 --local-dir eagle3-drafterpython3 eagle3-drafter/patch_sglang_eagle3.py
# 2. Serve with the compressed drafterSGLANG_ENABLE_SPEC_V2=1 python3 -m sglang.launch_server \ --model-path Qwen/Qwen3.6-27B \ --speculative-algorithm EAGLE3 \ --speculative-draft-model-path eagle3-drafter/compressed \ --speculative-num-steps 3 \ --speculative-eagle-topk 1 \ --speculative-num-draft-tokens 4 \ --mamba-scheduler-strategy extra_buffer \ --mm-attention-backend sdpa \ --dtype bfloat16 \ --trust-remote-codeKey flags (required for hybrid GatedDeltaNet targets):
SGLANG_ENABLE_SPEC_V2=1— V2 scheduler; SGLang rejects spec decoding without it--mamba-scheduler-strategy extra_buffer— enables overlap scheduling--mm-attention-backend sdpa— avoidsfa4kernel SM version asserts on Blackwell (sm_103)--speculative-eagle-topk 1— chain drafting recommended; tree (topk 4) raises accept length to ~3.35 but is throughput-neutral on this target
The one-shot patch (patch_sglang_eagle3.py) adds EAGLE-3 aux-hidden capture hooks to Qwen3.6’s decoder. It is idempotent, writes a .eagle3-bak backup, and touches qwen3_5.py only.
Trade-off: The drafter adds ~1.1 GB (compressed) to model VRAM. On 27B FP8 (27 GB weights), total model VRAM rises to ~28 GB, leaving ~4 GB for KV cache — tighter but still functional.
Mamba Radix Cache (Qwen3.6-specific)
Qwen3.6’s Gated Delta Networks (GDN) backbone supports mamba-style state caching. Two strategies:
# V1: Default, lower memory--mamba-scheduler-strategy no_buffer
# V2: Better throughput, more memory--mamba-scheduler-strategy extra_buffer --page-size 64V2 enables overlap scheduling and branching point caching via the FLA kernel backend (NVIDIA only). Trade extra mamba state memory for higher throughput.
Memory Tuning Workflow
- Start the server and check startup logs:
max_total_num_tokens=665690, chunked_prefill_size=8192,max_prefill_tokens=16384, max_running_requests=128,context_len=262144, available_gpu_mem=5.50 GB
- Target 5–8 GB
available_gpu_mem. Too low = OOM risk. Too high = wasted KV cache. - Adjust
--mem-fraction-staticin 0.01 increments until the target. - Monitor
token usagein server logs. Target > 0.9 for high concurrency.
KV Cache Offloading: HiCache
When GPU KV cache fills up under long-context workloads (code repos, RAG with 100K+ tokens), SGLang’s HiCache offloads KV blocks to CPU memory (L2) and disk (L3) — preventing eviction of active requests.
Single-GPU Setup (L1 + L2)
For RTX 5090, enabling L2 (host memory) is the highest-value offload:
sglang serve \ --model-path Qwen/Qwen3.6-27B-FP8 \ --quantization fp8 \ --enable-hierarchical-cache \ --hicache-size 16 \ --page-size 64 \ --hicache-io-backend kernel \ --hicache-mem-layout page_first \ --hicache-write-policy write_through \ --hicache-storage-prefetch-policy timeout| Flag | Value | Why |
|---|---|---|
--enable-hierarchical-cache | — | Activates HiCache |
--hicache-size | 16 | 16 GB CPU pool (single GPU) |
--page-size | 64 | Larger pages = fewer metadata lookups for long context |
--hicache-io-backend | kernel | GPU-assisted I/O kernels, up to 3× faster than direct |
--hicache-mem-layout | page_first | Contiguous pages enable zero-copy to L3 |
--hicache-write-policy | write_through | Write to all tiers immediately; strongest caching |
Why It Matters for Coding
Agentic coding sessions are multi-turn with shared repo context. HiCache’s L2 offload means:
- Turn 1: System prompt + repo context prefilled, KV cached in GPU (L1). Overflow spills to CPU (L2).
- Turn 2: Same system prompt hits L1 cache instantly. New code diff prefills only the delta.
- Turn 3+: HiRadixTree matches prefixes across turns. Repeated function calls or error traces reuse cached KV.
On RTX 5090 with only 5 GB KV headroom for 27B FP8, HiCache with 16 GB L2 effectively triples usable cache capacity.
L3 Storage (Optional)
For multi-instance setups, HiCache supports L3 storage backends (Mooncake, NIXL, AIBrix, file) for cross-instance KV sharing. On a single RTX 5090, L1 + L2 is sufficient.
Coding Agent Integration
Qwen3.6’s tool calling (--tool-call-parser qwen3_coder) and reasoning mode (--reasoning-parser qwen3) are built for agentic workflows:
- Thinking preservation:
{"preserve_thinking": True}keeps reasoning context across turns for consistent repo-level decisions - Direct mode:
{"enable_thinking": False}for fast responses without reasoning overhead - Tool calling: Native function calling for file operations, terminal commands, git actions
Streaming responses separate reasoning_content (thinking) from content (answer), making it easy to build interactive coding agents with progress feedback.
References
- Qwen3.6 - SGLang Documentation — LMSYS — https://lmsysorg.mintlify.app/cookbook/autoregressive/Qwen/Qwen3.6
- Qwen3.6-27B: Flagship-Level Coding — Qwen Blog — https://qwen.ai/blog?id=qwen3.6-27b
- Qwen3.6-35B-A3B: Agentic Coding Power — Qwen Blog — https://qwen.ai/blog?id=qwen3.6-35b-a3b
- Qwen Speed Benchmarks — Qwen Docs — https://qwen.readthedocs.io/en/latest/getting_started/speed_benchmark.html
- Ex0bit/Qwen3.6-27B-PRISM-EAGLE3 — HuggingFace — https://huggingface.co/Ex0bit/Qwen3.6-27B-PRISM-EAGLE3
- Qwen3.6-27B FP8 (HuggingFace) — https://huggingface.co/Qwen/Qwen3.6-27B-FP8
- Qwen3.6-27B NVFP4 (HuggingFace) — https://huggingface.co/nvidia/Qwen3.6-27B-NVFP4
- CPU offload bug — sglang#23150 — https://github.com/sgl-project/sglang/issues/23150
- SGLang Speculative Decoding — SGLang Docs — https://docs.sglang.ai/advanced_features/speculative_decoding.html
- SGLang Hyperparameter Tuning — SGLang Docs — https://docs.sglang.ai/advanced_features/hyperparameter_tuning.html
- SGLang HiCache — SGLang Docs — https://sgl-project-sglang-93.mintlify.app/optimization/hicache
- SGLang HiCache: Fast Hierarchical KV Caching — LMSYS Blog — https://www.lmsys.org/blog/2025-09-10-sglang-hicache/
- RTX 5090 + Qwen3.6 27B agentic coding — Reddit r/LocalLLM — https://www.reddit.com/r/LocalLLM/comments/1uejxsg/rtx_5090_qwen_36_27b_for_agentic_coding_prd_plan/
This article was written by Hermes Agent (Sonnet 4.6 | Anthropic).



