Skip to main content
GLM-5.3-Flash is an open-weight model from Z.ai, under the MIT license. It is a mixture of experts with 320 billion parameters, of which 18 billion are active for each token. It reads text and images, and it reasons before it answers. The official checkpoint is stored in FP8 and takes 328 GB, more than the 320 GB of four H100s, so the model needs a whole 8-GPU node. In this example you serve it with SGLang on one H100 node of a SUNK cluster. A first job downloads the weights and the SGLang container to your home directory without using any GPUs. A second job runs the server on a whole node, and you call its OpenAI-compatible API from the login node.

What you need

  • An H100 SUNK cluster and the training host alias. Rent and connect as in the first three steps of the nanoGPT speedrun. One H100 node runs the server, and H200 nodes work too.
  • About 400 GB free in your home directory, for the weights and the container. Check with ssh training 'df -h ~'. If there is less, buy more storage before you start; see Increase storage capacity.

Set up the directory

Create a directory for the model, and an API key for the server in it:
The server listens on a port that everyone on the cluster can reach, so it accepts only requests that carry this key. umask 077 makes the file readable only by you.

The download script

The download asks for no GPUs and no whole node, so it runs next to other jobs, and the GPU node is not held while 328 GB arrives. It saves the SGLang container to ~/glm/sglang.sqsh first, then downloads the model with the Hugging Face CLI from inside that container. The image is pinned to SGLang v0.5.21. GLM-5.3-Flash needs v0.5.20 or later, and those releases are built for CUDA 13 only. SUNK compute nodes run NVIDIA driver 580, which runs CUDA 13 containers. hf download checks what is already in ~/glm/GLM-5.3-Flash and fetches only what is missing, so if the job fails or hits its time limit, submitting it again continues where it stopped.

The serve script

Resources

The server takes one whole node: all 8 GPUs, every CPU, and all memory. It runs until the time limit and then stops, so set --time to how long you want to serve. On an H200 cluster, set --partition=compute-h200.

The server

These are the settings SGLang’s GLM-5.3-Flash cookbook verifies on 8 H100s for throughput, plus the parsers, the key, and the address: SGLang starts one worker per GPU from a single Slurm task, so --cpus-per-task gives that task every CPU on the node. unset NCCL_NET keeps NCCL on NVLink inside the node; the nanoGPT example explains why.

The full scripts

Save both files on your machine.
download.sbatch
serve.sbatch

Run it

Copy the scripts to the cluster:
Then submit both from the login node. --dependency=afterok holds the server until the download has succeeded:
squeue --me shows the server as PD with reason Dependency until the download finishes. Once the model is on disk, later runs only need sbatch serve.sbatch.

Watch it

Startup takes a while. The server reads 328 GB from the shared filesystem, compiles its GPU kernels, and captures CUDA graphs. Along the way it logs the size of its KV cache:
max_total_num_tokens is how many tokens all running requests can hold at once, so no single request can be longer. The server is ready when it prints:

Call it

Run these on the login node, in the ssh training session. Find the server’s node and read the key:
Send a chat request:
The model always reasons first. reasoning_effort sets how much: low, high, or max, the default, which the model card recommends for benchmarks. clear_thinking: true drops the reasoning of earlier turns from the prompt, which the model card recommends for chat. Z.ai recommends temperature 1.0 and top_p 0.95. Any OpenAI-compatible client works, with http://<node>:30000/v1 as the base URL and the key as the API key. To send an image, use a message content list with an image_url part, as with OpenAI models. The URL must be reachable from the compute node, or be a data: URL. The SSH gateway forwards ports only to the login node, so you cannot reach the server from your own computer. Run clients on the cluster: on the login node, or in other jobs.

Lower latency for one user

The settings above favor many requests at once. For one user at a time, SGLang can draft several tokens ahead with the model’s built-in multi-token prediction layer. In serve.sbatch, change --mem-fraction-static to 0.70 and add these lines before --host:
The SGLang cookbook lists these settings for H100 but has not finished verifying them there.

When you’re done

Stop the server:
The weights stay in ~/glm, so the next sbatch serve.sbatch skips the download. On-demand clusters are billed until they end; to stop paying, end the cluster in the console as in the nanoGPT example.

Troubleshooting

Next