Instructions to use zai-org/GLM-4.6V with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zai-org/GLM-4.6V 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") 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") model = AutoModelForImageTextToText.from_pretrained("zai-org/GLM-4.6V") 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 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" # 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", "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
- SGLang
How to use zai-org/GLM-4.6V 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" \ --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", "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" \ --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", "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 with Docker Model Runner:
docker model run hf.co/zai-org/GLM-4.6V
Add model-index with benchmark evaluations
#6
by davidlms - opened
Added structured evaluation results from benchmark comparison (36 benchmarks):
General VQA:
- MMBench V1.1: 88.8, MMBench V1.1 (CN): 88.2, MMStar: 75.9, BLINK (Val): 65.5, MUIRBENCH: 77.1
Multimodal Reasoning:
- MMMU (Val): 76.0, MMMU_Pro: 66.0, VideoMMU: 74.7, MathVista: 85.2, AI2D: 88.8, DynaMath: 54.5, WeMath: 69.8, ZeroBench (sub): 25.8
Multimodal Agentic:
- MMBrowseComp: 7.6, Design2Code: 88.6, Flame-React-Eval: 86.3, OSWorld: 37.2, AndroidWorld: 57.0, WebVoyager: 81.0, Webquest-SingleQA: 79.5, Webquest-MultiQA: 59.0
Multimodal Long Context:
- MMLongBench-Doc: 54.9, MMLongBench-128K: 64.1, LVBench: 59.5
OCR & Chart:
- OCRBench: 86.5, OCR-Bench_v2 (EN): 65.1, OCR-Bench_v2 (CN): 59.6, ChartQAPro: 65.5, ChartMuseum: 58.4, CharXiv_Val-Reasoning: 63.2
Spatial & Grounding:
- OmniSpatial: 52.0, RefCOCO-avg (val): 88.6, TreeBench: 51.4, Ref-L4-test: 88.9
This enables the model to appear in leaderboards and makes it easier to compare with other models.
davidlms changed pull request status to closed