Skip to content

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 tokenspeed command is available. Install curl for the verification step.
  • Make the openai/gpt-oss-20b or openai/gpt-oss-120b checkpoint 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 ​

  1. Start the server. This command serves openai/gpt-oss-20b as gpt-oss-20b on 0.0.0.0:8000:

    bash
    tokenspeed 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 8000
  2. After startup, verify the server.

Start GPT-OSS 120B ​

  1. Start the server with four-way tensor parallelism, an FP8 KV cache, and a maximum of 256 sequences. This command serves openai/gpt-oss-120b as gpt-oss-120b on 0.0.0.0:8000:

    bash
    tokenspeed 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 8000
  2. After 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.

  1. 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:

    bash
    TORCH_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-kvstore
  2. After 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:

bash
curl --fail --silent --show-error \
  --output /dev/null \
  --write-out '%{http_code}\n' \
  http://127.0.0.1:8000/readiness

The command prints 200 when the server is ready.

TokenSpeed documentation