Instructions to use zai-org/GLM-4.7-Flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zai-org/GLM-4.7-Flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="zai-org/GLM-4.7-Flash") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("zai-org/GLM-4.7-Flash") model = AutoModelForCausalLM.from_pretrained("zai-org/GLM-4.7-Flash") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use zai-org/GLM-4.7-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-4.7-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-4.7-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/zai-org/GLM-4.7-Flash
- SGLang
How to use zai-org/GLM-4.7-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-4.7-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-4.7-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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-4.7-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-4.7-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use zai-org/GLM-4.7-Flash with Docker Model Runner:
docker model run hf.co/zai-org/GLM-4.7-Flash
Amazing! look what this local AI generated in 5 minutes.
Hi,
GLM-4.7-FLASH is really amazing AI.
Look what it created in few minutes.
My prompt was:
make an python application: open my webcam show it, and recognise what number i show with my fingers. show it as large number and say it in english.
Setup
Quantized version of GLM-4.7-Flash running with Llama.cpp as API server and Opencode connecting to it.
API Server
Latest llama.cpp should be used see excellent UNSLOTH document how to compile the latest: https://unsloth.ai/docs/models/glm-4.7-flash#llama.cpp-tutorial-gguf this works without any problem.
Llama.cpp setting to run -with tool calling optimization :
./llama-server
-m /home/b/.lmstudio/models/unsloth/GLM-4.7-Flash-GGUF/GLM-4.7-Flash-UD-Q6_K_XL.gguf
--host 0.0.0.0
--port 1234
-ngl 99
--ctx-size 65536
--jinja
--temp 0.7
--top-p 1.0
--min-p 0.01
--threads -1
--parallel 1
Coding Agent
Opencode is the best open source AI coding agent. :) https://opencode.ai/
Thank you very much ZAI Team for sharing this fantastic work ! :)
Also Thanks for UNSLOTH Team for their excellent quantized versions. https://huggingface.co/unsloth/GLM-4.7-Flash-GGUF
wow just 5 minute we can get AI Image we want, absolute ZAI cinema!
wow just 5 minute we can get AI Image we want, absolute ZAI cinema!
Nice to see you get the point :)
I am still playing with it myself but so far it has shown some of the cleanest reasoning traces I've seen and its FAST. Thanks very much for releasing this model.
How about specific tasks. Like for example, try to make it create a chess game in html. For example gemini 3 pro does it in one promt, even bot opponent is working.
But with this model its b̶a̶r̶e̶l̶y̶ ̶p̶o̶s̶s̶i̶b̶l̶e̶, even step by step, at least from my experience.
UPDATE: i'm very slowly managing to at least make it look like a chess game, with board and pieces. Whats left, Is to make it playable and with bot opponent.
Oh WOW... it actually also worked pretty flawlessly, i wasn't expecting this, because at first it was hard to design the board and pieces. But after that, using chess.js library worked after first try. Also it created simple bot too. Oh, looks like the numbers on the left are wrong 😄
i can't find the gguf file. is it available anywhere for download?
look comment above: "Also Thanks for UNSLOTH Team for their excellent quantized versions. https://huggingface.co/unsloth/GLM-4.7-Flash-GGUF"
look comment above: "Also Thanks for UNSLOTH Team for their excellent quantized versions. https://huggingface.co/unsloth/GLM-4.7-Flash-GGUF"
If you're vintage 1968 like me, you saw the first Apple II's and TRS-80, Commodore, Sinclar etc. and now you get your own AI. What a ride, eh?

