Instructions to use zai-org/GLM-5.3-Flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zai-org/GLM-5.3-Flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="zai-org/GLM-5.3-Flash") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("zai-org/GLM-5.3-Flash") model = AutoModelForMultimodalLM.from_pretrained("zai-org/GLM-5.3-Flash", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use zai-org/GLM-5.3-Flash with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "zai-org/GLM-5.3-Flash" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zai-org/GLM-5.3-Flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/zai-org/GLM-5.3-Flash
- SGLang
How to use zai-org/GLM-5.3-Flash with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "zai-org/GLM-5.3-Flash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zai-org/GLM-5.3-Flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "zai-org/GLM-5.3-Flash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zai-org/GLM-5.3-Flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use zai-org/GLM-5.3-Flash with Docker Model Runner:
docker model run hf.co/zai-org/GLM-5.3-Flash
glm 5.3 flash now 2-4 times faster on new llama fork. 2x3090 from 12 to 24 t/s
If you have 2-4 GPUs, prepare for a big smile ๐ โ forked llama.cpp: real multi-GPU speedup for MoE models bigger than VRAM
If you've got 2-4 GPUs sitting mostly idle running a big MoE model, this is for you.
Stock llama.cpp splits big models across GPUs by layer
So only one GPU computes at a time, the rest sit idle. More GPUs = more VRAM, not more speed.
I forked llama.cpp and built a VRAM-filling MoE expert cache instead:
Every GPU caches the experts actually being used, live, updated as you generate,
while the CPU handles cache misses in parallel instead of one-after-another.
Numbers on my box (2x RTX 3090, 128GB DDR4, 3700X), same prompt/temp 0, stock vs fork:
r/machinelearningnews - If you have 2-4 GPUs, prepare for a big smile ๐ โ forked llama.cpp: real multi-GPU speedup for MoE models bigger than VRAM
(Qwen's gain is small honestly โ stock's autofit already fit most of it on GPU there, so little room for the cache to help. The big wins are on models where default placement leaves most expert work on the CPU.)
Credit where due:
the expert-cache mechanism builds on u csantiago78's PR #27861
(github.com ggml-org llama.cpp pull 27861) โ they had it working first.
I'd independently been chasing the same hot-expert-cache idea and burned real time fighting the scheduler before finding their PR; no point reinventing a wheel that already worked, so I built on top of it
(VRAM-filling auto-sizing, usage-based eviction that only swaps when it pays back, CPU/GPU overlap,
added fused kernels). sdroege independently explored similar prefill-based cache warming in the same PR thread โ worth a look too.
GLM-5.3-Flash support is from timkhronos's PRs #27773/ #27917
( github com ggml-org llama.cpp pull 27773).
Repo: github com neurall llama.cpp (Linux CUDA and windows release binary attached,
portable across CPU/GPU variants)
Upped Aditional 10% faster but not necesary
Pre-quantized GLM-5.3-Flash GGUF (10% faster attention weights, experts unchanged):
huggingface co neuralll GLM-5.3-Flash-GSQ-RCO-3.0bit-Q4Kattn-GGUF
If you've got 2+ GPUs and a model too big for one, try it and tell me what breaks โ different GPU counts, different models, whatever. Feedback genuinely welcome.
looking for job too
