Speculative Decoding with SGLang
Using Speculative Decoding with the SGLang backend.
For cross-backend documentation, see Speculative Decoding Overview.
Prerequisites
- SGLang container or a local SGLang install. See the SGLang Backend guide.
- One GPU for aggregated serving, two for disaggregated serving
Quick Start: Qwen3-8B + EAGLE3
This guide deploys Qwen/Qwen3-8B with the Tengyunw/qwen3_8b_eagle3 EAGLE3 draft model.
Step 1: Start Infrastructure Services
Step 2: Run Aggregated Speculative Decoding
Step 3: Test the Deployment
Step 4: Check the Speculative Decoding Metrics
The worker exposes sglang:spec_* metrics on its system port:
See the SGLang metrics documentation for metric definitions.
Disaggregated Serving with KV-Aware Routing
Pass the same speculative decoding flags to the prefill and decode workers, and start the frontend with --router-mode kv:
Once the workers are ready, send the request from Step 3. Speculation runs on the decode worker, so read its metrics on port 8082.
Limitations
- Only EAGLE3 is validated end to end