SGLang Presets
32,768-Token RAG & Document Synthesis SGLang Preset
Prevent KV pool exhaustion when long retrieval contexts and multi-turn document chats hit 16k-32k tokens per request.
32k Context · --chunked-prefill-size 4096 · fp8_e5m2 KV
Why Chunked Prefill Is Non-Negotiable at 32k
Prefilling a 32,768-token document in one forward pass allocates multi-gigabyte temporary attention tensors. Chunking at 4096 caps peak memory while interleaving active decode users.
Tuning --max-running-requests
Bounding max_running_requests prevents SGLang from admitting too many 32k requests simultaneously and thrashing cached document prefixes.
Measured Thresholds & SGLang Flag Matrix
| Flag / Parameter | Recommended Value | VRAM Impact |
|---|---|---|
| Target Context Window | 32,768 tokens | High KV pressure per concurrent user |
| --kv-cache-dtype | fp8_e5m2 | Cuts 32k KV footprint nearly in half |
| --chunked-prefill-size | 4096 | 8 prefill slices avoid 10 GB logit spike |
| --max-running-requests | 16 - 24 | Protects Radix tree from constant eviction |