Views
No views yet
openai/gpt-oss-20b.
openai/gpt-oss-20b.uv pip install "git+https://github.com/sgl-project/sglang.git@refs/pull/20547/head#subdirectory=python"1# Optional: enable schedule overlapping (experimental, may not be stable)
2# export SGLANG_ENABLE_SPEC_V2=1
3# export SGLANG_ENABLE_DFLASH_SPEC_V2=1
4# export SGLANG_ENABLE_OVERLAP_PLAN_STREAM=1
5
6python -m sglang.launch_server \
7 --model-path openai/gpt-oss-20b \
8 --speculative-algorithm DFLASH \
9 --speculative-draft-model-path z-lab/gpt-oss-20b-DFlash \
10 --tp-size 1 \
11 --dtype bfloat16 \
12 --attention-backend fa3 \
13 --mem-fraction-static 0.75 \
14 --trust-remote-code1from openai import OpenAI
2
3client = OpenAI(base_url="http://localhost:30000/v1", api_key="EMPTY")
4
5response = client.chat.completions.create(
6 model="openai/gpt-oss-20b",
7 messages=[{"role": "user", "content": "Write a quicksort in Python."}],
8 max_tokens=2048,
9 temperature=0.0,
10)
11print(response.choices[0].message.content)1uv pip install vllm
2uv pip install -U vllm --torch-backend=auto --extra-index-url https://wheels.vllm.ai/nightly1vllm serve openai/gpt-oss-20b \
2 --speculative-config '{"method": "dflash", "model": "z-lab/gpt-oss-20b-DFlash", "num_speculative_tokens": 7}' \
3 --attention-backend flash_attn \
4 --max-num-batched-tokens 327681from openai import OpenAI
2
3client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
4
5response = client.chat.completions.create(
6 model="openai/gpt-oss-20b",
7 messages=[{"role": "user", "content": "Write a quicksort in Python."}],
8 max_tokens=2048,
9 temperature=0.0,
10)
11print(response.choices[0].message.content)--speculative-num-draft-tokens arguments when launch the server.| Math500 | GSM8K | HumanEval | MT-Bench | |
|---|---|---|---|---|
| Accept Len | 5.1 | 4.7 | 4.3 | 4.2 |
| conc=1 | 2.2× | 2.0× | 2.0× | 1.9× |
| conc=4 | 2.1× | 2.0× | 2.1× | 2.0× |
| conc=8 | 2.2× | 2.0× | 2.2× | 2.0× |
| conc=16 | 1.9× | 1.8× | 2.1× | 1.9× |
| conc=32 | 1.8× | 1.7× | 1.9× | 1.7× |
1@misc{chen2026dflash,
2 title = {DFlash: Block Diffusion for Flash Speculative Decoding},
3 author = {Chen, Jian and Liang, Yesheng and Liu, Zhijian},
4 year = {2026},
5 eprint = {2602.06036},
6 archivePrefix = {arXiv},
7 primaryClass = {cs.CL},
8 url = {https://arxiv.org/abs/2602.06036}
9}