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
Thank you Z.AI, I love this model! β€
- It speaks my native language fairly well - most other models had much worse output, maybe except Gemma 3, but that is now fairly old.
- It was clearly trained on more recent data than most of the models of the same size category I've been using!
- It beats anything else of the same size category I've been using in coding!
- It is very smart and competent even in roleplay scenarios even though it wasn't the main purpose of the model!
- I can finally actually ENJOY thinking models instead of dreading them: I'm waiting about 3-4 minutes for the model to finish thinking. Now, if you have a super powerful hardware, you may laugh and say this is very slow, but my hardware isn't the strongest one nowadays and most of the models I've been using so far think for much longer, even smaller models think for like 15-120 minutes! So you can bet I am VERY GRATEFUL for having this model as it only thinks for 4 minutes and its thinking process is much more condensed and more efficient!
- Overall this model feels like a much bigger model. Quite powerful and competent for its size. I can't help but think of at least Gemini 2.5 Flash and we can use it at home, that's awesome! π³
Thank you Z.AI for this awesome model! I knew you could do it and you did not disappoint - you managed to create something extraordinary. A single and competent model that I can finally use on my own hardware locally instead of many different models for various different purposes. This model is a MASTERPIECE! β€
that is out standing
- It speaks my native language fairly well - most other models had much worse output, maybe except Gemma 3, but that is now fairly old.
- It was clearly trained on more recent data than most of the models of the same size category I've been using!
- It beats anything else of the same size category I've been using in coding!
- It is very smart and competent even in roleplay scenarios even though it wasn't the main purpose of the model!
- I can finally actually ENJOY thinking models instead of dreading them: I'm waiting about 3-4 minutes for the model to finish thinking. Now, if you have a super powerful hardware, you may laugh and say this is very slow, but my hardware isn't the strongest one nowadays and most of the models I've been using so far think for much longer, even smaller models think for like 15-120 minutes! So you can bet I am VERY GRATEFUL for having this model as it only thinks for 4 minutes and its thinking process is much more condensed and more efficient!
- Overall this model feels like a much bigger model. Quite powerful and competent for its size. I can't help but think of at least Gemini 2.5 Flash and we can use it at home, that's awesome! π³
Thank you Z.AI for this awesome model! I knew you could do it and you did not disappoint - you managed to create something extraordinary. A single and competent model that I can finally use on my own hardware locally instead of many different models for various different purposes. This model is a MASTERPIECE! β€
How are you running it? In my language VLLM and sglang generates garbage. But llamacpp works really good.
How are you running it? In my language VLLM and sglang generates garbage. But llamacpp works really good.
I'm running it using LM Studio desktop application which is using LLamaCpp runtime.
Yeah... this model is awesome! THANK YOU!
This model is good at finding qwen's coding and mistakes. Though i tend to go to qwen first.