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:
- A TokenSpeed installation in your serving environment. For installation instructions, see Getting started.
- Access to the
zai-org/GLM-5.2-FP8checkpoint on Hugging Face. - Eight GPUs to use the example's tensor-parallel configuration.
- The
curlcommand to verify the running server.
Start and verify the server
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--portto match your deployment:bashtokenspeed 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 8000After the server reports ready, retrieve its model list. If you changed the host or port, replace
127.0.0.1:8000with your server's address:bashcurl --fail http://127.0.0.1:8000/v1/modelsA successful request returns an HTTP
200status and a JSON response with adatafield. Confirm thatglm-5.2appears 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.