Serve GPT-OSS 20B or 120B
Serve GPT-OSS 20B with one GPU or GPT-OSS 120B with tensor parallelism. For larger GPT-OSS deployments, tune tensor parallelism, the scheduler token budget, and the KV cache dtype. On AMD CDNA4, GPT-OSS 120B with MXFP4 weights also supports Gluon Petit MegaMoE.
Prerequisites
- Complete the Getting started setup so that the
tokenspeedcommand is available. Installcurlfor the verification step. - Make the
openai/gpt-oss-20boropenai/gpt-oss-120bcheckpoint accessible to the server. - Match your hardware to the configuration: one GPU for the 20B example, four GPUs for the 120B tensor-parallel example, or one node with eight gfx950 GPUs for the Gluon Petit MegaMoE example.
Start GPT-OSS 20B
Start the server. This command serves
openai/gpt-oss-20basgpt-oss-20bon0.0.0.0:8000:bashtokenspeed serve openai/gpt-oss-20b \ --served-model-name gpt-oss-20b \ --tensor-parallel-size 1 \ --max-model-len 131072 \ --chunked-prefill-size 8192 \ --reasoning-parser base \ --host 0.0.0.0 \ --port 8000After startup, verify the server.
Start GPT-OSS 120B
Start the server with four-way tensor parallelism, an FP8 KV cache, and a maximum of 256 sequences. This command serves
openai/gpt-oss-120basgpt-oss-120bon0.0.0.0:8000:bashtokenspeed serve openai/gpt-oss-120b \ --served-model-name gpt-oss-120b \ --tensor-parallel-size 4 \ --max-model-len 131072 \ --kv-cache-dtype fp8 \ --chunked-prefill-size 8192 \ --max-num-seqs 256 \ --reasoning-parser base \ --host 0.0.0.0 \ --port 8000After startup, verify the server.
Optional: Use Gluon Petit MegaMoE on AMD CDNA4
Use this configuration for GPT-OSS 120B with MXFP4 weights on one node with eight gfx950 GPUs. This backend supports at most 1024 prefill or decode tokens per rank.
Start the server with tensor parallelism set to 1, data parallelism set to 8, and expert parallelism set to 8. Select Gluon Petit for both the mixture-of-experts and all-to-all backends:
bashTORCH_NCCL_BLOCKING_WAIT=1 tokenspeed serve openai/gpt-oss-120b \ --tensor-parallel-size 1 \ --data-parallel-size 8 \ --expert-parallel-size 8 \ --dtype bfloat16 \ --moe-backend gluon_petit \ --all2all-backend gluon_petit \ --chunked-prefill-size 1024 \ --max-prefill-tokens 1024 \ --disable-autotune \ --disable-kvstoreAfter startup, verify the server.
Verify the server
After starting any configuration, check its readiness endpoint from a second terminal. If you changed --host or --port, replace 127.0.0.1:8000 with the address and port where you reach the server:
curl --fail --silent --show-error \
--output /dev/null \
--write-out '%{http_code}\n' \
http://127.0.0.1:8000/readinessThe command prints 200 when the server is ready.