Image-Text-to-Text
Transformers
Safetensors
English
Chinese
glm5_next
conversational
Eval Results
fp8
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)# pip install -U transformers accelerate # 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=256) 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
GLM3.5
#59
by D0ntKn0w - opened
- .eval_results/agents-last-exam.yaml +0 -9
- chat_template.jinja +55 -51
.eval_results/agents-last-exam.yaml
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 1 |
-
- dataset:
|
| 2 |
-
id: agents-last-exam/agents-last-exam
|
| 3 |
-
task_id: ale-cli-pass-rate
|
| 4 |
-
value: 26.3
|
| 5 |
-
date: "2026-08-26"
|
| 6 |
-
source:
|
| 7 |
-
url: https://huggingface.co/zai-org/GLM-5.3-Flash
|
| 8 |
-
name: "GLM-5.3-Flash model card"
|
| 9 |
-
notes: "Claude Code harness; read from the card's benchmark chart."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chat_template.jinja
CHANGED
|
@@ -178,69 +178,73 @@ For each function call, output the function name and arguments within the follow
|
|
| 178 |
{%- if block_start > 0 and messages[block_start - 1].role == 'assistant' and messages[block_start - 1].tool_calls -%}
|
| 179 |
{%- set ns_a.tool_calls = messages[block_start - 1].tool_calls -%}
|
| 180 |
{%- endif -%}
|
| 181 |
-
{%- set ns_chk = namespace(can_sort=true
|
| 182 |
-
{%- for k in range(block_start, ns_blk.end + 1) -%}
|
| 183 |
-
{%- set m = messages[k] -%}
|
| 184 |
-
{%- if is_list_of_outputs(m) -%}
|
| 185 |
-
{%- for entry in m.content -%}
|
| 186 |
-
{%- set ns_chk.res = ns_chk.res + [id_of(entry)] -%}
|
| 187 |
-
{%- set ns_chk.mk = ns_chk.mk + [k] -%}
|
| 188 |
-
{%- set ns_chk.ek = ns_chk.ek + [loop.index0] -%}
|
| 189 |
-
{%- endfor -%}
|
| 190 |
-
{%- else -%}
|
| 191 |
-
{%- set ns_chk.res = ns_chk.res + [id_of(m)] -%}
|
| 192 |
-
{%- set ns_chk.mk = ns_chk.mk + [k] -%}
|
| 193 |
-
{%- set ns_chk.ek = ns_chk.ek + [-1] -%}
|
| 194 |
-
{%- endif -%}
|
| 195 |
-
{%- endfor -%}
|
| 196 |
{%- if not ns_a.tool_calls -%}
|
| 197 |
{%- set ns_chk.can_sort = false -%}
|
| 198 |
{%- else -%}
|
| 199 |
-
{%- for
|
| 200 |
-
{%-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 201 |
{%- endfor -%}
|
| 202 |
-
{%-
|
| 203 |
-
{%-
|
| 204 |
-
|
| 205 |
-
{%-
|
| 206 |
-
|
| 207 |
-
{%-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
{%- if eid not in ns_chk.tcs -%}
|
| 211 |
{%- set ns_chk.can_sort = false -%}
|
| 212 |
{%- break -%}
|
| 213 |
{%- endif -%}
|
| 214 |
{%- endfor -%}
|
| 215 |
-
{%-
|
| 216 |
{%- endif -%}
|
| 217 |
{%- if ns_chk.can_sort -%}
|
| 218 |
-
{%-
|
| 219 |
-
|
| 220 |
-
{%-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
{%- set m = messages[ns_chk.mk[pair.p]] -%}
|
| 234 |
-
{%- if ns_chk.ek[pair.p] >= 0 -%}
|
| 235 |
-
{%- set entry = m.content[ns_chk.ek[pair.p]] -%}
|
| 236 |
-
{%- if entry.output is iterable and entry.output is not string and entry.output is not mapping and entry.output and entry.output.0.type == "tool_reference" -%}
|
| 237 |
-
{{- tool_references_to_response(entry.output) -}}
|
| 238 |
{%- else -%}
|
| 239 |
-
{
|
|
|
|
|
|
|
|
|
|
| 240 |
{%- endif -%}
|
| 241 |
-
{%-
|
| 242 |
-
{{- render_tool_response(m) -}}
|
| 243 |
-
{%- endif -%}
|
| 244 |
{%- endfor -%}
|
| 245 |
{%- else -%}
|
| 246 |
{%- for k in range(block_start, ns_blk.end + 1) -%}
|
|
|
|
| 178 |
{%- if block_start > 0 and messages[block_start - 1].role == 'assistant' and messages[block_start - 1].tool_calls -%}
|
| 179 |
{%- set ns_a.tool_calls = messages[block_start - 1].tool_calls -%}
|
| 180 |
{%- endif -%}
|
| 181 |
+
{%- set ns_chk = namespace(can_sort=true) -%}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
{%- if not ns_a.tool_calls -%}
|
| 183 |
{%- set ns_chk.can_sort = false -%}
|
| 184 |
{%- else -%}
|
| 185 |
+
{%- for k in range(block_start, ns_blk.end + 1) -%}
|
| 186 |
+
{%- if not ns_chk.can_sort -%}{%- break -%}{%- endif -%}
|
| 187 |
+
{%- set m = messages[k] -%}
|
| 188 |
+
{%- if is_list_of_outputs(m) -%}
|
| 189 |
+
{%- for entry in m.content -%}
|
| 190 |
+
{%- if not ns_chk.can_sort -%}{%- break -%}{%- endif -%}
|
| 191 |
+
{%- set eid = id_of(entry) -%}
|
| 192 |
+
{%- if not eid -%}
|
| 193 |
+
{%- set ns_chk.can_sort = false -%}
|
| 194 |
+
{%- elif has_dup_tool_result_id(block_start, ns_blk.end, eid) -%}
|
| 195 |
+
{%- set ns_chk.can_sort = false -%}
|
| 196 |
+
{%- elif not tc_id_exists(ns_a.tool_calls, eid) -%}
|
| 197 |
+
{%- set ns_chk.can_sort = false -%}
|
| 198 |
+
{%- endif -%}
|
| 199 |
+
{%- endfor -%}
|
| 200 |
+
{%- else -%}
|
| 201 |
+
{%- set tk_id = id_of(m) -%}
|
| 202 |
+
{%- if not tk_id -%}
|
| 203 |
+
{%- set ns_chk.can_sort = false -%}
|
| 204 |
+
{%- elif has_dup_tool_result_id(block_start, ns_blk.end, tk_id) -%}
|
| 205 |
+
{%- set ns_chk.can_sort = false -%}
|
| 206 |
+
{%- elif not tc_id_exists(ns_a.tool_calls, tk_id) -%}
|
| 207 |
+
{%- set ns_chk.can_sort = false -%}
|
| 208 |
+
{%- endif -%}
|
| 209 |
+
{%- endif -%}
|
| 210 |
{%- endfor -%}
|
| 211 |
+
{%- for i in range(ns_a.tool_calls | length) -%}
|
| 212 |
+
{%- if not ns_chk.can_sort -%}{%- break -%}{%- endif -%}
|
| 213 |
+
{%- set tc_id = id_of(ns_a.tool_calls[i]) -%}
|
| 214 |
+
{%- if not tc_id -%}
|
| 215 |
+
{%- set ns_chk.can_sort = false -%}
|
| 216 |
+
{%- endif -%}
|
| 217 |
+
{%- for j in range(i + 1, ns_a.tool_calls | length) -%}
|
| 218 |
+
{%- if id_of(ns_a.tool_calls[j]) == tc_id -%}
|
|
|
|
| 219 |
{%- set ns_chk.can_sort = false -%}
|
| 220 |
{%- break -%}
|
| 221 |
{%- endif -%}
|
| 222 |
{%- endfor -%}
|
| 223 |
+
{%- endfor -%}
|
| 224 |
{%- endif -%}
|
| 225 |
{%- if ns_chk.can_sort -%}
|
| 226 |
+
{%- for tc in ns_a.tool_calls -%}
|
| 227 |
+
{%- set tc_id = id_of(tc) -%}
|
| 228 |
+
{%- for k in range(block_start, ns_blk.end + 1) -%}
|
| 229 |
+
{%- set m = messages[k] -%}
|
| 230 |
+
{%- if is_list_of_outputs(m) -%}
|
| 231 |
+
{%- for entry in m.content -%}
|
| 232 |
+
{%- set eid = id_of(entry) -%}
|
| 233 |
+
{%- if eid == tc_id -%}
|
| 234 |
+
{%- if entry.output is iterable and entry.output is not string and entry.output is not mapping and entry.output and entry.output.0.type == "tool_reference" -%}
|
| 235 |
+
{{- tool_references_to_response(entry.output) -}}
|
| 236 |
+
{%- else -%}
|
| 237 |
+
{{- tool_response(visible_text(entry.output)) -}}
|
| 238 |
+
{%- endif -%}
|
| 239 |
+
{%- endif -%}
|
| 240 |
+
{%- endfor -%}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
{%- else -%}
|
| 242 |
+
{%- set tk_id = id_of(m) -%}
|
| 243 |
+
{%- if tk_id == tc_id -%}
|
| 244 |
+
{{- render_tool_response(m) -}}
|
| 245 |
+
{%- endif -%}
|
| 246 |
{%- endif -%}
|
| 247 |
+
{%- endfor -%}
|
|
|
|
|
|
|
| 248 |
{%- endfor -%}
|
| 249 |
{%- else -%}
|
| 250 |
{%- for k in range(block_start, ns_blk.end + 1) -%}
|