1. Model Introduction
Available Models:- BF16 (Full precision): zai-org/GLM-5.1
- FP8 (8-bit quantized): zai-org/GLM-5.1-FP8
- NVFP4 (4-bit quantized): nvidia/GLM-5.1-NVFP4
2. SGLang Installation
Please refer to the official SGLang installation guide for installation instructions.3. Model Deployment
This section provides deployment configurations optimized for different hardware platforms and use cases.3.1 Basic Configuration
Interactive Command Generator: Use the configuration selector below to automatically generate the appropriate deployment command for your hardware platform, quantization method, and capabilities. SGLang supports serving GLM-5.1 on NVIDIA H100, H200, B300, GB300, and AMD MI300X/MI325X/MI355X GPUs.3.2 Configuration Tips
- Speculative decoding (MTP) can significantly reduce latency for interactive use cases.
- DP Attention: Enables data parallel attention for higher throughput under high concurrency. Note that DP attention trades off low-concurrency latency for high-concurrency throughput — disable it if your workload is latency-sensitive with few concurrent requests.
- The
--mem-fraction-staticflag is recommended for optimal memory utilization, adjust it based on your hardware and workload.
| Hardware | NVFP4 | FP8 | BF16 | MXFP4 |
|---|---|---|---|---|
| H100 | — | tp=16 | — | — |
| H200 | — | tp=8 | — | — |
| B300 | tp=8 | — | — | — |
| GB300 | tp=4 | — | — | — |
| MI300X/MI325X | — | tp=8 | tp=8 | — |
| MI355X | — | tp=8 | tp=8 | tp=4 |
- H100 and H200: FP8 is the recommended deployment path.
- B300 and GB300: NVFP4 is the recommended deployment path. Use
nvidia/GLM-5.1-NVFP4with--quantization modelopt_fp4. Usetp=8on B300 andtp=4on GB300. The CUDA 13 image variant is required for B300 and GB300. - AMD GPUs: BF16 and FP8 checkpoints run on MI300X/MI325X/MI355X at tp=8. On MI355X (gfx950), the MXFP4 checkpoint
amd/GLM-5.1-MXFP4is also supported at tp=4 with--kv-cache-dtype fp8_e4m3. All AMD paths pass--dsa-prefill-backend tilelang --dsa-decode-backend tilelang,--chunked-prefill-size 131072, and--watchdog-timeout 1200(20 minutes for weight loading). FP8 uses approximately half the memory of BF16 (~89 GB/GPU vs ~175 GB/GPU). EAGLE speculative decoding is supported on AMD GPUs: MI300X/MI325X (gfx942) and MI355X (gfx950), but it requires--disable-custom-all-reduce— the aiter custom all-reduce kernel deadlocks during EAGLE verify at high concurrency, so without this flag the server will hang. - For other configuration tips (MTP, DSA kernel, Context Parallel, HiSparse, NVFP4, Index Cache), see the DeepSeek-V3.2 cookbook page. GLM-5.1 and DeepSeek-V3.2 share the same model structure, so the optimization techniques are common.
- Use
--json-model-override-args '{"index_topk_pattern": "FFSFSSSFSSFFFSSSFFFSFSSSSSSFFSFFSFFSSFFFFFFSFFFFFSFFSSSSSSFSFFFSFSSSFSFFSFFSSS"}'to enable the IndexCache method for GLM-5.1. This can improve serving efficiency with only a small accuracy loss. If you are running rigorous accuracy evaluations, do not enable this feature.
4. Model Invocation
Deploy GLM-5.1 with the following command (FP8 on H200, all features enabled):Command
4.1 B300/GB300 (NVFP4) Server Command
B300
Command
GB300
Command
4.2 MI300X/MI325X/MI355X (ROCm) Server Command
The following ROCm commands are additional options for AMD GPUs and do not replace the NVIDIA instructions above.MXFP4 (MI355X / gfx950)
On MI355X (gfx950), setSGLANG_DSA_TRITON_PREFILL=1 to enable a faster Triton attention kernel for the prefill phase (opt-in, off by default). Keep --dsa-prefill-backend tilelang as shown. The EAGLE speculative-decoding flags below are optional but recommended on gfx950.
Command
FP8 (Recommended)
Command
BF16
Command
4.3 Basic Usage
For basic API usage and request examples, please refer to:4.4 Advanced Usage
4.4.1 Reasoning Parser
GLM-5.1 supports Thinking mode by default. Enable the reasoning parser during deployment to separate the thinking and content sections. The thinking process is returned viareasoning_content in the streaming response.
To disable thinking and use Instruct mode, pass chat_template_kwargs at request time:
- Thinking mode (default): The model performs step-by-step reasoning before answering. No extra parameters needed.
- Instruct mode (
{"enable_thinking": false}): The model responds directly without a thinking process.
reasoning_content:
Example
Output
{"enable_thinking": false} via chat_template_kwargs:
Example
Output
4.4.2 Tool Calling
GLM-5.1 supports tool calling capabilities. Enable the tool call parser during deployment. Thinking mode is on by default; to disable it for tool calling requests, passextra_body={"chat_template_kwargs": {"enable_thinking": False}}.
Python Example (with Thinking Process):
Example
Output
5. Benchmark
5.1 Speed Benchmark
Test Environment:- Hardware: H200 (8x)
- Model: GLM-5.1-FP8
- Tensor Parallelism: 8
- SGLang Version: commit 947927bdb
5.1.1 Latency Benchmark
Command
Output
5.1.2 Throughput Benchmark
Command
Output
5.2 Accuracy Benchmark
The accuracy benchmark results below are shared with GLM-5, as GLM-5.1 was not independently benchmarked at the time of this writing. A separate benchmark run is planned.
5.2.1 GSM8K Benchmark
- Benchmark Command
Command
- Test Result
Output
5.2.2 MMLU Benchmark
- Benchmark Command
Command
- Test Result
Output
5.3 AMD GPU Benchmarks
5.3.1 GSM8K Benchmark (MI325/MI35x)
- MI325/MI35x Test (GLM-5.1 BF16,
tp=8, TileLang DSA backends)
Command
Output
