What you need
- An H100 SUNK cluster and the
traininghost 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:umask 077 makes the file readable only by you.
The download script
~/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
--time to how long you want to serve. On an H200 cluster, set --partition=compute-h200.
The server
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:--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
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 thessh training session. Find the server’s node and read the key:
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. Inserve.sbatch, change --mem-fraction-static to 0.70 and
add these lines before --host:
When you’re done
Stop the server:~/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
- The SGLang GLM-5.3-Flash cookbook has settings for other GPUs, more nodes, and benchmark results.
- The model card describes the model’s architecture, benchmarks, and chat template.
- Configure Slurm, for example to add a prolog that checks GPU health before every job.