GLM-4 9B Chat 1M: Self-Hosting & Deployment Guide
GLM-4 9B Chat 1M is a compact open-weight chat model with a one-million-token context window.
What is GLM-4 9B Chat 1M?
GLM-4 9B Chat 1M is a compact open-weight chat model with a one-million-token context window, published by Z.ai with open weights at zai-org/glm-4-9b-chat-1m. LLM API does not route this model today, so there is no endpoint or code sample for it here. What this page does give you is the self-hosting picture: published weight sizes, the VRAM each quantisation needs and the commands to serve it yourself. Every figure is read from the public repository and refreshed weekly.
How to run GLM-4 9B Chat 1M yourself
Open weights (other), 9.5B parameters. Below: how much memory the weights need at each quantization, which hardware fits them, and the commands to serve it.
GLM-4 9B Chat 1M VRAM requirements
| Precision / quantization | Weights | Figure | Source |
|---|---|---|---|
| BF16 (full precision) | 19 GB | Estimate | 9.5B params × 2 bytes |
| MLX 4-bit | 5.3 GB | File size | mlx-community/glm-4-9b-chat-1m-4bit |
| GGUF Q8_0 | 10.1 GB | File size | bartowski/glm-4-9b-chat-1m-GGUF |
| GGUF Q4_K_M | 6.3 GB | File size | bartowski/glm-4-9b-chat-1m-GGUF |
| GGUF Q2_K | 4 GB | File size | bartowski/glm-4-9b-chat-1m-GGUF |
File size = actual download size on Hugging Face. Estimate = parameter count × bytes per weight. Weights only — the KV cache for long contexts needs extra memory; the fit tables below add 15% headroom as a rule of thumb.
GPU requirements: deploy GLM-4 9B Chat 1M on your hardware
| Hardware | BF16 (full precision) | MLX 4-bit | GGUF Q8_0 | GGUF Q4_K_M | GGUF Q2_K |
|---|---|---|---|---|---|
| NVIDIA H200141 GB | 1× | 1× | 1× | 1× | 1× |
| NVIDIA H10080 GB | 1× | 1× | 1× | 1× | 1× |
| NVIDIA A100 80GB80 GB | 1× | 1× | 1× | 1× | 1× |
| NVIDIA L40S48 GB | 1× | 1× | 1× | 1× | 1× |
GPUs needed per variant.
| Hardware | GGUF Q8_0 | GGUF Q4_K_M | GGUF Q2_K |
|---|---|---|---|
| RTX 509032 GB | 1× | 1× | 1× |
| RTX 409024 GB | 1× | 1× | 1× |
| RTX 309024 GB | 1× | 1× | 1× |
GGUF via llama.cpp; more cards or CPU offload for larger files.
| Hardware | GGUF Q8_0 | GGUF Q4_K_M | GGUF Q2_K | MLX 4-bit |
|---|---|---|---|---|
| Mac, 512 GBM3 Ultra | Fits | Fits | Fits | Fits |
| Mac, 192 GBM2 Ultra | Fits | Fits | Fits | Fits |
| Mac, 128 GBM4 Max / M3 Max | Fits | Fits | Fits | Fits |
| Mac, 64 GBM4 Pro / Max | Fits | Fits | Fits | Fits |
Assumes ~75% of unified memory is usable by the GPU.
| Hardware | BF16 (full precision) | MLX 4-bit | GGUF Q8_0 | GGUF Q4_K_M | GGUF Q2_K |
|---|---|---|---|---|---|
| AWS p5.48xlarge8× H100 · 640 GB | Fits | Fits | Fits | Fits | Fits |
| AWS p4de.24xlarge8× A100 80GB · 640 GB | Fits | Fits | Fits | Fits | Fits |
| AWS g6e.12xlarge4× L40S · 192 GB | Fits | Fits | Fits | Fits | Fits |
| Google Cloud a3-highgpu-8g8× H100 · 640 GB | Fits | Fits | Fits | Fits | Fits |
| Azure ND H100 v58× H100 · 640 GB | Fits | Fits | Fits | Fits | Fits |
Whole-instance GPU memory; public instance specs.
Not on LLM.API yet
We do not route this model through our API at the moment. Browse the models you can call today — most workloads have a close match already live.
Not available on LLM API yet
We do not route this model through our API at the moment, so there is no endpoint or code snippet for it yet. Browse the models you can call today — most workloads have a close match already live.
Browse available modelsWhy run GLM-4 9B Chat 1M on LLM.API?
Unified AI Routing
Reach GLM-4 9B Chat 1M and sibling models through one OpenAI-compatible endpoint.
Cost Control
Production: Compare provider price points and keep spend visible as you scale GLM-4 9B Chat 1M.
Reliability Layer
Retry and route across configured providers when a single upstream blips.
Observability
Trace prompts, tokens, and errors for GLM-4 9B Chat 1M alongside the rest of your stack.
Drop-in SDKs
Keep using familiar OpenAI client patterns with base URL https://api.llmapi.ai/v1.
Model Breadth
Swap GLM-4 9B Chat 1M for chat, media, or embedding alternatives without rewriting auth.
When to Use — When NOT to Use
Get one key to every model
Swap your API key. Keep your code.