Skip to content

GLM5 / GLM5.2 ​

Use this recipe to serve GLM5 or GLM5.2. The example serves the GLM5.2 FP8 checkpoint on eight GPUs with tensor parallelism and expert parallelism.

GLM5 launches usually need remote code, long context, expert parallelism, FP8 KV cache, and the TRTLLM MoE backend.

Prerequisites ​

Before you start the server, prepare the following:

Start and verify the server ​

  1. Start TokenSpeed with the GLM5.2 FP8 checkpoint. The command enables remote code, configures a maximum context length of 262,144 tokens, and exposes the server on port 8000. No placeholder substitutions are required. Change --served-model-name, --host, or --port to match your deployment:

    bash
    tokenspeed serve zai-org/GLM-5.2-FP8 \
      --served-model-name glm-5.2 \
      --trust-remote-code \
      --tensor-parallel-size 8 \
      --enable-expert-parallel \
      --moe-backend flashinfer_trtllm \
      --kv-cache-dtype fp8 \
      --max-model-len 262144 \
      --chunked-prefill-size 8192 \
      --max-num-seqs 128 \
      --host 0.0.0.0 \
      --port 8000
  2. After the server reports ready, retrieve its model list. If you changed the host or port, replace 127.0.0.1:8000 with your server's address:

    bash
    curl --fail http://127.0.0.1:8000/v1/models

    A successful request returns an HTTP 200 status and a JSON response with a data field. Confirm that glm-5.2 appears in the model list.

Optional: Configure the reasoning parser ​

TokenSpeed defaults the reasoning parser to glm45. To override this default, pass an explicit --reasoning-parser value.

Optional: Integrate a custom attention backend ​

GLM5 DeepSeek Sparse Attention prefill planning reuses the host-side request lengths and the packed page/row plan across full-indexer layers. When you integrate a custom attention backend, keep the scheduler-provided CPU length mirrors populated to avoid device synchronization in this path.

TokenSpeed documentation