Instructions to use zai-org/GLM-4.6V-Flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zai-org/GLM-4.6V-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-4.6V-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, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("zai-org/GLM-4.6V-Flash") model = AutoModelForImageTextToText.from_pretrained("zai-org/GLM-4.6V-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?"} ] }, ] 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
- vLLM
How to use zai-org/GLM-4.6V-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.6V-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.6V-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-4.6V-Flash
- SGLang
How to use zai-org/GLM-4.6V-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.6V-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.6V-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-4.6V-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.6V-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-4.6V-Flash with Docker Model Runner:
docker model run hf.co/zai-org/GLM-4.6V-Flash
Update README.md
#26 opened 4 months ago
by
mnhasmuiscas
it run good gguf on colab cpu
#25 opened 5 months ago
by
asdgad
extract reasoning_content error
👀 2
3
#24 opened 5 months ago
by
zet-yd
Can you share the finetuning settings
#23 opened 5 months ago
by
Forceless
Cannot summarize 8000 tokens
2
#22 opened 5 months ago
by
kalle07
llama.cpp support
🚀 9
#21 opened 5 months ago
by
ngxson
VLLM 启动报错了
1
#20 opened 5 months ago
by
qinghuiyyds
这模型推理陷入死循环的概率非常高
4
#19 opened 5 months ago
by
pypry
Fits in RTX 3090, which is best time to buy ($500 on used market)
#18 opened 5 months ago
by
krustik
Update README.md
#17 opened 5 months ago
by
byjiang1996
it run good in colab t4
10
#16 opened 5 months ago
by
asdgad
run colab t4 but
5
#14 opened 5 months ago
by
asdgad
not run
👀 1
1
#13 opened 5 months ago
by
asdgad
支持识别电气图纸吗?比如图片、PDF、CAD文件中的电气图纸
#12 opened 5 months ago
by
richuyouyaojie
🚀🚀🚀GLM-4.6v-Flash本地部署+深度测评
#11 opened 5 months ago
by
leo009
Question regarding the FP8 version
1
#9 opened 5 months ago
by
thecr7guy
vLLM error
14
#8 opened 5 months ago
by
ccernat
Local Installation Video and Testing - Step by Step
👍 1
1
#7 opened 5 months ago
by
fahdmirzac
It's really top_k = 2?
👍 2
1
#6 opened 5 months ago
by
CHNtentes
Add model-index with benchmark evaluations
#2 opened 5 months ago
by
davidlms
The demo script loads forever.
3
#1 opened 5 months ago
by
AliceThirty