Text Generation
Transformers
Safetensors
English
Chinese
glm5_next
image-text-to-text
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("text-generation", 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)# 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=40) 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": "What is the capital of France?" } ] }'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": "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-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": "What is the capital of France?" } ] }' - 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 ·
c54b8d1
1
Parent(s): edfc283
update
Browse files- config.json +56 -5
config.json
CHANGED
|
@@ -5,7 +5,6 @@
|
|
| 5 |
"text_config": {
|
| 6 |
"attention_bias": false,
|
| 7 |
"attention_dropout": 0.0,
|
| 8 |
-
"bos_token_id": null,
|
| 9 |
"dtype": "bfloat16",
|
| 10 |
"eos_token_id": [
|
| 11 |
154820,
|
|
@@ -124,12 +123,64 @@
|
|
| 124 |
"deepseek_sparse_attention",
|
| 125 |
"linear_attention"
|
| 126 |
],
|
| 127 |
-
"
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
"max_position_embeddings": 1048576,
|
| 132 |
"mhc": true,
|
|
|
|
| 133 |
"mlp_layer_types": [
|
| 134 |
"dense",
|
| 135 |
"dense",
|
|
|
|
| 5 |
"text_config": {
|
| 6 |
"attention_bias": false,
|
| 7 |
"attention_dropout": 0.0,
|
|
|
|
| 8 |
"dtype": "bfloat16",
|
| 9 |
"eos_token_id": [
|
| 10 |
154820,
|
|
|
|
| 123 |
"deepseek_sparse_attention",
|
| 124 |
"linear_attention"
|
| 125 |
],
|
| 126 |
+
"linear_attn_config": {
|
| 127 |
+
"num_heads": 64,
|
| 128 |
+
"gate_lower_bound": -5.0,
|
| 129 |
+
"head_dim": 128,
|
| 130 |
+
"short_conv_kernel_size": 4,
|
| 131 |
+
"kda_layers": [
|
| 132 |
+
0,
|
| 133 |
+
1,
|
| 134 |
+
2,
|
| 135 |
+
4,
|
| 136 |
+
5,
|
| 137 |
+
6,
|
| 138 |
+
8,
|
| 139 |
+
9,
|
| 140 |
+
10,
|
| 141 |
+
12,
|
| 142 |
+
13,
|
| 143 |
+
14,
|
| 144 |
+
16,
|
| 145 |
+
17,
|
| 146 |
+
18,
|
| 147 |
+
20,
|
| 148 |
+
21,
|
| 149 |
+
22,
|
| 150 |
+
24,
|
| 151 |
+
25,
|
| 152 |
+
26,
|
| 153 |
+
28,
|
| 154 |
+
29,
|
| 155 |
+
30,
|
| 156 |
+
32,
|
| 157 |
+
33,
|
| 158 |
+
34,
|
| 159 |
+
36,
|
| 160 |
+
37,
|
| 161 |
+
38,
|
| 162 |
+
40,
|
| 163 |
+
41,
|
| 164 |
+
42,
|
| 165 |
+
44
|
| 166 |
+
],
|
| 167 |
+
"full_attn_layers": [
|
| 168 |
+
3,
|
| 169 |
+
7,
|
| 170 |
+
11,
|
| 171 |
+
15,
|
| 172 |
+
19,
|
| 173 |
+
23,
|
| 174 |
+
27,
|
| 175 |
+
31,
|
| 176 |
+
35,
|
| 177 |
+
39,
|
| 178 |
+
43
|
| 179 |
+
]
|
| 180 |
+
},
|
| 181 |
"max_position_embeddings": 1048576,
|
| 182 |
"mhc": true,
|
| 183 |
+
"mla_use_nope": true,
|
| 184 |
"mlp_layer_types": [
|
| 185 |
"dense",
|
| 186 |
"dense",
|