Image-Text-to-Text
Transformers
Safetensors
English
Chinese
glm5_next
conversational
Eval Results
fp8
Run this model with HF Jobs
Run zai-org/GLM-5.3-Flash on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/zai-org/GLM-5.3-Flash. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/zai-org/GLM-5.3-Flash on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/zai-org/GLM-5.3-Flash. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/zai-org/GLM-5.3-Flash. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
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
zRzRzRzRzRzRzR commited on
Commit ·
c5b82b6
1
Parent(s): dbc994b
update template
Browse filesFiles changed (2)
- .ms_upload_cacheDeleted-1
- chat_template.jinja+12-59
1{"version": 3, "repo_id": "ZhipuAI/GLM-5.3-Flash", "files": {"chat_template.jinja|1787740514.0|10644": {"hash": "34d5ee66b12fa6446cdae131c352b8f68cd85369e0e6fda115583805fada3891", "size": 10644}, "config.json|1787740514.0|68794": {"hash": "00c3ce40c92fae7f248c72a8fff3163e74bda2fe0a82d190806ad2284bcddde8", "size": 68794}, "generation_config.json|1787740514.0|194": {"hash": "230c30609ecbbb9e6583bedde8e7bdda0c6eb8fe5fad0eaeb3d1b293d751cb4f", "size": 194}, "model-00003-of-00062.safetensors|1787739040.0|5363448800": {"hash": "e9806d89bb028a51393414a5817d104ca811def3459fcff82dc37616adcdafe2", "size": 5363448800}, "model-00006-of-00062.safetensors|1787739068.0|5361790216": {"hash": "20e2cd306152f5de1e1d4ffa474e90a466d1b2ffd01c21a4182a99e263e9eaa0", "size": 5361790216}, "model-00004-of-00062.safetensors|1787739049.0|5364323736": {"hash": "faaeaf32f8b9219a3a13437bf3b5436928d39d619a82c9c375c21f995c1607c0", "size": 5364323736}, "model-00007-of-00062.safetensors|1787739078.0|5364323968": {"hash": "00b63fd168956e79228899d1a0663f045f13e6d6466c01ef93cc067aad7803da", "size": 5364323968}, "model-00005-of-00062.safetensors|1787739058.0|5363896872": {"hash": "d2124352d6cb564db9144310fff9df6ca73c7d848514ce54d0ce627bc92d4b8f", "size": 5363896872}, "model-00008-of-00062.safetensors|1787739087.0|5364323752": {"hash": "6605c4a52d76579574edfe3b7084c46d91ded3f33b678be25ee36ef724175d87", "size": 5364323752}, "model-00002-of-00062.safetensors|1787739031.0|5320647024": {"hash": "d05313aa3d972efc49076d3b7fc4ed3e827cd5648fce6fd83e8e6e4caed68a1b", "size": 5320647024}, "model-00001-of-00062.safetensors|1787739025.0|5365306688": {"hash": "fd5202d28efdd01b47557c3f59111de3b4c4c375b2709c167b9b61834663c7da", "size": 5365306688}}}123456740 unmodified lines48495051525354555657585960616263646566676869707130 unmodified lines10210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313411 unmodified lines14614714814915015115236 unmodified lines18919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122210 unmodified lines233234235236237238239240[gMASK]<sop>{%- set effective_reasoning_effort = reasoning_effort if reasoning_effort is defined and reasoning_effort in ['low', 'high'] else 'max' -%}{%- if effective_reasoning_effort is not none -%}<|system|>Reasoning Effort: {{ effective_reasoning_effort | capitalize }}{%- endif -%}{%- set clear_thinking = clear_thinking if clear_thinking is defined else false -%}{%- if tools -%}{%- macro tool_to_json(tool) -%}{%- set ns_tool = namespace(first=true) -%}40 unmodified linesFor each function call, output the function name and arguments within the following XML format:<tool_call>{function-name}<arg_key>{arg-key-1}</arg_key><arg_value>{arg-value-1}</arg_value><arg_key>{arg-key-2}</arg_key><arg_value>{arg-value-2}</arg_value>...</tool_call>{%- endif -%}{%- macro emit_image() -%}<|begin_of_image|><|image|><|end_of_image|>{%- endmacro -%}{%- macro emit_video() -%}<|begin_of_video|><|video|><|end_of_video|>{%- endmacro -%}{%- macro emit_audio() -%}<|begin_of_audio|><|end_of_audio|>{%- endmacro -%}{%- macro visible_text(content) -%}{%- if content is string -%}{{- content -}}{%- elif content is iterable and content is not mapping -%}{%- for item in content -%}{%- if item is mapping and item.type == 'text' -%}{{- item.text -}}{%- elif item is string -%}{{- item -}}{%- elif item is mapping and item.type in ['image', 'image_url'] -%}{{- emit_image() -}}{%- elif item is mapping and item.type in ['video', 'video_url'] -%}{{- emit_video() -}}{%- elif item is mapping and item.type in ['audio', 'audio_url', 'input_audio'] -%}{{- emit_audio() -}}{%- endif -%}{%- endfor -%}{%- else -%}30 unmodified lines{%- macro is_list_of_outputs(m) -%}{%- if m.content and m.content.0.output is defined -%}1{%- endif -%}{%- endmacro -%}{%- macro has_dup_tool_result_id(lo, hi, target) -%}{%- set ns_cnt = namespace(n=0) -%}{%- for k in range(lo, hi + 1) -%}{%- set m = messages[k] -%}{%- if is_list_of_outputs(m) -%}{%- for entry in m.content -%}{%- if id_of(entry) == target -%}{%- set ns_cnt.n = ns_cnt.n + 1 -%}{%- endif -%}{%- endfor -%}{%- elif id_of(m) == target -%}{%- set ns_cnt.n = ns_cnt.n + 1 -%}{%- endif -%}{%- if ns_cnt.n > 1 -%}{%- break -%}{%- endif -%}{%- endfor -%}{%- if ns_cnt.n > 1 -%}1{%- endif -%}{%- endmacro -%}{%- macro tc_id_exists(tcs, target) -%}{%- set ns_f = namespace(found=false) -%}{%- for tc in tcs -%}{%- if id_of(tc) == target -%}{%- set ns_f.found = true -%}{%- break -%}{%- endif -%}{%- endfor -%}{%- if ns_f.found -%}1{%- endif -%}{%- endmacro -%}{%- set ns = namespace(last_user_index=-1) -%}{%- for m in messages %}{%- if m.role == 'user' %}11 unmodified lines{%- set reasoning_content = content.split('</think>')[0].split('<think>')[-1] %}{%- set content = content.split('</think>')[-1] %}{%- endif %}{%- if (not clear_thinking or loop.index0 > ns.last_user_index) and reasoning_content is defined -%}{{ '<think>' + reasoning_content + '</think>'}}{%- else -%}{{ '<think></think>' }}36 unmodified lines{%- set eid = id_of(entry) -%}{%- if not eid -%}{%- set ns_chk.can_sort = false -%}{%- elif has_dup_tool_result_id(block_start, ns_blk.end, eid) -%}{%- set ns_chk.can_sort = false -%}{%- elif not tc_id_exists(ns_a.tool_calls, eid) -%}{%- set ns_chk.can_sort = false -%}{%- endif -%}{%- endfor -%}{%- else -%}{%- set tk_id = id_of(m) -%}{%- if not tk_id -%}{%- set ns_chk.can_sort = false -%}{%- elif has_dup_tool_result_id(block_start, ns_blk.end, tk_id) -%}{%- set ns_chk.can_sort = false -%}{%- elif not tc_id_exists(ns_a.tool_calls, tk_id) -%}{%- set ns_chk.can_sort = false -%}{%- endif -%}{%- endif -%}{%- endfor -%}{%- for i in range(ns_a.tool_calls | length) -%}{%- set tc_id = id_of(ns_a.tool_calls[i]) -%}{%- if not tc_id -%}{%- set ns_chk.can_sort = false -%}{%- endif -%}{%- for j in range(i + 1, ns_a.tool_calls | length) -%}{%- if id_of(ns_a.tool_calls[j]) == tc_id -%}{%- set ns_chk.can_sort = false -%}{%- endif -%}{%- endfor -%}{%- endfor -%}{%- endif -%}{%- if ns_chk.can_sort -%}{%- for tc in ns_a.tool_calls -%}10 unmodified lines{{- tool_response(visible_text(entry.output)) -}}{%- endif -%}{%- endif -%}{%- endfor -%}{%- else -%}{%- set tk_id = id_of(m) -%}{%- if tk_id == tc_id -%}{{- render_tool_response(m) -}}12345640 unmodified lines47484950515253545556575859606162636430 unmodified lines959697989910011 unmodified lines11211311411511611711836 unmodified lines15515615715815916016116216316416516616716816917017117217317417510 unmodified lines186187188189190191192193[gMASK]<sop>{%- set effective_reasoning_effort = reasoning_effort if reasoning_effort is defined and reasoning_effort in ['low', 'high'] else 'max' -%}{%- if effective_reasoning_effort is not none -%}<|system|>Reasoning Effort: {{ effective_reasoning_effort | capitalize }}{%- endif -%}{%- if tools -%}{%- macro tool_to_json(tool) -%}{%- set ns_tool = namespace(first=true) -%}40 unmodified linesFor each function call, output the function name and arguments within the following XML format:<tool_call>{function-name}<arg_key>{arg-key-1}</arg_key><arg_value>{arg-value-1}</arg_value><arg_key>{arg-key-2}</arg_key><arg_value>{arg-value-2}</arg_value>...</tool_call>{%- endif -%}{%- macro visible_text(content) -%}{%- if content is string -%}{{- content }}{%- elif content is iterable and content is not mapping -%}{%- for item in content -%}{%- if item is mapping and item.type == 'text' -%}{{- item.text }}{%- elif item is string -%}{{- item }}{%- elif item is mapping and item.type in ['image', 'image_url', 'video', 'video_url', 'audio', 'audio_url', 'input_audio'] -%}{%- set media_type = item.type | replace('_url', '') | replace('input_', '') -%}{{- "<reminder>You are unable to process this " ~ media_type ~ " because you don't have multi-modal input ability. Try different methods.</reminder>" }}{%- endif -%}{%- endfor -%}{%- else -%}30 unmodified lines{%- macro is_list_of_outputs(m) -%}{%- if m.content and m.content.0.output is defined -%}1{%- endif -%}{%- endmacro -%}{%- set ns = namespace(last_user_index=-1) -%}{%- for m in messages %}{%- if m.role == 'user' %}11 unmodified lines{%- set reasoning_content = content.split('</think>')[0].split('<think>')[-1] %}{%- set content = content.split('</think>')[-1] %}{%- endif %}{%- if ((clear_thinking is defined and not clear_thinking) or loop.index0 > ns.last_user_index) and reasoning_content is defined -%}{{ '<think>' + reasoning_content + '</think>'}}{%- else -%}{{ '<think></think>' }}36 unmodified lines{%- set eid = id_of(entry) -%}{%- if not eid -%}{%- set ns_chk.can_sort = false -%}{%- endif -%}{%- endfor -%}{%- else -%}{%- set tk_id = id_of(m) -%}{%- if not tk_id -%}{%- set ns_chk.can_sort = false -%}{%- endif -%}{%- endif -%}{%- endfor -%}{%- for tc in ns_a.tool_calls -%}{%- set tc_id = id_of(tc) -%}{%- if not tc_id -%}{%- set ns_chk.can_sort = false -%}{%- endif -%}{%- endfor -%}{%- endif -%}{%- if ns_chk.can_sort -%}{%- for tc in ns_a.tool_calls -%}10 unmodified lines{{- tool_response(visible_text(entry.output)) -}}{%- endif -%}{%- endif -%}{%- endfor -%}{%- else -%}{%- set tk_id = id_of(m) -%}{%- if tk_id == tc_id -%}{{- render_tool_response(m) -}}
.ms_upload_cacheDeleted-1
chat_template.jinja+12-59