Get Started with GLM-5.3
GLM-5.3 is a Z.ai GLM-series large language model designed for advanced reasoning, coding, and agentic workflows. Use it for applications that need strong instruction following, long-context problem solving, and reliable text generation.
This procedure deploys GLM-5.3 with the SGLang Model-Free NIM. The model-free container downloads model assets from a remote source at startup, so you can serve GLM-5.3 without building a model-specific NIM image. For more information, refer to Model-Free NIM.
Known Issues
This release includes the following known issues and limitations.
-
Environment variable
NIM_DISABLE_MODEL_DOWNLOADis not supported. -
For air-gap deployment, mount the local model path and set
NIM_MODEL_PATH:
Prerequisites
Before deploying a NIM LLM container, ensure your environment meets the following requirements:
Hardware Requirements
The following are the minimum required specifications for supported hardware components:
Software Requirements
Minimum required versions for supported software components.
Operating System
While other Linux distributions can be compatible with NIM, they have not been officially validated.
We recommend using Ubuntu 22.04 LTS or later for the best experience.
CUDA SDK
Install CUDA SDK by following the CUDA installation guide for Linux.
GPU Drivers
Install the NVIDIA GPU drivers by following the NVIDIA Driver Installation Guide.
Docker
Docker is required to run the containerized NIM services.
-
Install Docker Engine for your Linux distribution by following the Docker Engine installation guide.
-
Verify that the Docker daemon is running and that your user can execute
dockercommands withoutsudo. Add your user to thedockergroup if needed: -
Log out and back in for the group change to take effect.
Container Toolkit
The NVIDIA Container Toolkit enables Docker containers to access the host GPU.
-
Install the toolkit by following the NVIDIA Container Toolkit installation guide.
-
Configure Docker to use the NVIDIA runtime by following the Docker configuration steps.
-
Restart the Docker daemon after configuration:
NIM Container Access
To download and deploy NIM containers, you need one of the following:
- A free NVIDIA Developer Program membership.
- An NVIDIA AI Enterprise license. To request a free 90-day evaluation license, refer to Ways to Get Started With NVIDIA AI Enterprise and Activate Your NVIDIA AI Enterprise License.
Verify NVIDIA Runtime Access
To ensure that your setup is correct, run the following command:
This command should produce output similar to one of the following, where you can confirm CUDA driver version, and available GPUs.
Configuration
Use environment variables to control authentication and model caching.
Create and Export a Token for the Remote Repository
-
Create a Hugging Face access token with read permissions (or higher, only if your org or private repos require it).
-
Export the token in your shell (temporary), replacing
<token-value>with your actual token: -
Persist the variable (optional):
If using bash:
If using zsh:
-
Verify the variable is set:
If you want to serve a pre-downloaded local model or a private cloud model instead of downloading one from Hugging Face, you do not need a Hugging Face access token. Refer to Model Downloads for your workflow.
For enhanced security, consider storing your token in a file and retrieving it
as needed with cat. Alternatively, consider using a
password manager.
Model Cache and Source
NIM downloads model weights and other assets to a cache directory inside the container. Map a persistent directory on your host machine to that path so files survive restarts and later deployments can reuse them.
Local Cache
An essential variable to configure on your host system is the cache path directory. This directory is mapped from the host machine to container; assets (for example, model weights) are downloaded to this host directory and persist across container restarts. Configuring a local cache is highly recommended, as it avoids re-downloading large model files upon subsequent container restarts. You can name the environment variable containing the path to the local cache whatever you want.
Create the cache directory and export an environment variable:
When you start the NIM container, you must map your host machine’s local cache directory ($LOCAL_NIM_CACHE) to the container’s internal cache path (/opt/nim/.cache) using a Docker volume mount, such as -v "$LOCAL_NIM_CACHE:/opt/nim/.cache". This mapping ensures that the large model weights downloaded by the container are saved to your host machine. Because containers are ephemeral, any data stored only inside the container is lost when it stops. By using a volume mount, subsequent container runs detect the existing model files in your local cache and skip the lengthy download process, allowing the NIM to start up faster.
Cache Directory Permissions
The NIM container runs as a non-root user with GID 0 (root group). The cache directory on your host must be writable by GID 0:
Run the container with the cache mounted:
To make this setting permanent across terminal sessions, you can add export LOCAL_NIM_CACHE=~/.cache/nim to your ~/.bashrc or ~/.zshrc profile.
Custom Model Source
You can configure model-free NIM to download a model from Hugging Face or other supported sources. To do this, specify the directory where the model files should be stored and set the appropriate environment variable.
Specify a Hugging Face model directly using the hf:// prefix.
The NIM will automatically download the model from Hugging Face and cache it in your configured LOCAL_NIM_CACHE. When running the container, you will map your host machine’s local cache directory to a path inside the container using the -v flag. This ensures that the downloaded model weights persist on your host machine across ephemeral container restarts.
For example, using -v "$LOCAL_NIM_CACHE:/opt/nim/.cache" tells Docker: “Take the folder at $LOCAL_NIM_CACHE on my host machine, and make it available inside the container at the path /opt/nim/.cache.”
Pull the Container Image
Use docker pull to fetch the NIM container image:
How to Choose the Right Model Profile
NIM LLM automatically selects the most optimal model profile based on the detected hardware (for example, number of GPUs or GPU architecture). If you need to manually override this selection, you can specify the NIM_MODEL_PROFILE environment variable. For more information, refer to Model Profiles.
Run NIM
Run the container with the model-source credentials required by your selected model. The following example uses a Hugging Face token to authenticate and download the model.
If you want to serve a pre-downloaded local model or a private cloud model instead of downloading one from Hugging Face, refer to Model Downloads for your workflow.
Reference Configurations for H200 and B200 GPUs
The following SGLang configurations are recommended starting points for specific workloads on H200 and B200 GPUs. Benchmark and adjust these values for your deployment, workload, and latency or throughput requirements.
Pass these settings as CLI arguments after nim-serve. The configuration
snippets use underscore-separated key names for compact comparison; replace
underscores with hyphens for CLI arguments. Pass a true Boolean setting as a
standalone flag, for example, enable_prefill_cp: true, which becomes
--enable-prefill-cp.
For more information and a complete container example, refer to Advanced Configuration.
Set SGLANG_ENABLE_SPEC_V2=1 on the container when using either EAGLE
configuration. For example:
Long-Context Workload
For a long-context workload with an input sequence length (ISL) of 64K tokens and an output sequence length (OSL) of 400 tokens, use the following common configuration on H200 and B200 GPUs:
H200 GPUs require no additional overrides. For B200 GPUs, add the following:
RAG-QA Workload
For a retrieval-augmented generation question answering (RAG-QA) workload with an ISL of 8K tokens and an OSL of 1K tokens, use the following common configuration on H200 and B200 GPUs:
Interact with the API
There are three main inference endpoints:
- Chat Completions:
/v1/chat/completions - Text Completions:
/v1/completions - Responses:
/v1/responses
All three endpoints support streaming.
Find the Model Name
Replace the "model" value in the examples below with the model name served by
your NIM container. To find it, query the models endpoint:
The id field in the response is the model name to use in your requests. For
model-free NIMs, the name is set by the NIM_SERVED_MODEL_NAME environment variable
(for example, zai-org/GLM-5.3).
You can set the environment variable NIM_SERVED_MODEL_NAME to a desired string.
This name is used as the model name in API requests. For more information, refer to
Environment Variables.
Send a Chat Completion Request
Once the server is running, you can send a request to the chat completion endpoint:
The expected response:
Verify Health Endpoints
You can verify that the NIM container is running and ready to accept requests by checking its health endpoints. By default, these endpoints are served on port 8000. If you set NIM_HEALTH_PORT, use that port instead.
Live Endpoint
Perform a liveness check to see if the server is running:
Example response:
Ready Endpoint
Perform a readiness check to see if the model is fully loaded and ready for inference:
Example response:
Streaming
To receive responses incrementally as they are generated, you can enable streaming by adding "stream": true to your request payload. This is supported across the /v1/chat/completions, /v1/completions, and /v1/responses endpoints.
When streaming is enabled, the API returns a sequence of Server-Sent Events (SSE).
The response will be streamed back in chunks, with each chunk containing a data JSON object. The stream terminates with a data: [DONE] message: