Image-Text-to-Text
Transformers
Safetensors
glm5_next
vllm
llm-compressor
nvfp4
fp4
conversational
8-bit precision
compressed-tensors
Instructions to use RedHatAI/GLM-5.3-Flash-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RedHatAI/GLM-5.3-Flash-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="RedHatAI/GLM-5.3-Flash-NVFP4") 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("RedHatAI/GLM-5.3-Flash-NVFP4") model = AutoModelForMultimodalLM.from_pretrained("RedHatAI/GLM-5.3-Flash-NVFP4", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use RedHatAI/GLM-5.3-Flash-NVFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RedHatAI/GLM-5.3-Flash-NVFP4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RedHatAI/GLM-5.3-Flash-NVFP4", "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/RedHatAI/GLM-5.3-Flash-NVFP4
- SGLang
How to use RedHatAI/GLM-5.3-Flash-NVFP4 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 "RedHatAI/GLM-5.3-Flash-NVFP4" \ --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": "RedHatAI/GLM-5.3-Flash-NVFP4", "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 "RedHatAI/GLM-5.3-Flash-NVFP4" \ --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": "RedHatAI/GLM-5.3-Flash-NVFP4", "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 RedHatAI/GLM-5.3-Flash-NVFP4 with Docker Model Runner:
docker model run hf.co/RedHatAI/GLM-5.3-Flash-NVFP4
Add FP8-block MTP layer (layer 45): weights + index + mixed-precision quant config
Browse files- config.json +53 -2
- model.safetensors.index.json +2 -2
- model_mtp.safetensors +3 -0
config.json
CHANGED
|
@@ -27,7 +27,7 @@
|
|
| 27 |
},
|
| 28 |
"output_activations": null,
|
| 29 |
"targets": [
|
| 30 |
-
"re:.*mlp\\.experts\\..*(gate|up|down)_proj$"
|
| 31 |
],
|
| 32 |
"weights": {
|
| 33 |
"actorder": null,
|
|
@@ -43,9 +43,47 @@
|
|
| 43 |
"type": "float",
|
| 44 |
"zp_dtype": null
|
| 45 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
}
|
| 47 |
},
|
| 48 |
-
"format": "
|
| 49 |
"global_compression_ratio": null,
|
| 50 |
"ignore": [
|
| 51 |
"model.visual.blocks.0.attn.qkv",
|
|
@@ -811,6 +849,19 @@
|
|
| 811 |
"model.language_model.layers.44.mlp.shared_experts.gate_proj",
|
| 812 |
"model.language_model.layers.44.mlp.shared_experts.up_proj",
|
| 813 |
"model.language_model.layers.44.mlp.shared_experts.down_proj",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 814 |
"lm_head"
|
| 815 |
],
|
| 816 |
"kv_cache_scheme": null,
|
|
|
|
| 27 |
},
|
| 28 |
"output_activations": null,
|
| 29 |
"targets": [
|
| 30 |
+
"re:.*\\.layers\\.(?:[3-9]|[1-3][0-9]|4[0-4])\\.mlp\\.experts\\..*(gate|up|down)_proj$"
|
| 31 |
],
|
| 32 |
"weights": {
|
| 33 |
"actorder": null,
|
|
|
|
| 43 |
"type": "float",
|
| 44 |
"zp_dtype": null
|
| 45 |
}
|
| 46 |
+
},
|
| 47 |
+
"group_1": {
|
| 48 |
+
"format": "float-quantized",
|
| 49 |
+
"input_activations": {
|
| 50 |
+
"actorder": null,
|
| 51 |
+
"block_structure": null,
|
| 52 |
+
"dynamic": true,
|
| 53 |
+
"group_size": 128,
|
| 54 |
+
"num_bits": 8,
|
| 55 |
+
"observer": null,
|
| 56 |
+
"observer_kwargs": {},
|
| 57 |
+
"scale_dtype": null,
|
| 58 |
+
"strategy": "group",
|
| 59 |
+
"symmetric": true,
|
| 60 |
+
"type": "float",
|
| 61 |
+
"zp_dtype": null
|
| 62 |
+
},
|
| 63 |
+
"output_activations": null,
|
| 64 |
+
"targets": [
|
| 65 |
+
"re:.*\\.layers\\.45\\.mlp\\.experts\\.\\d+\\.(gate_proj|up_proj|down_proj)$"
|
| 66 |
+
],
|
| 67 |
+
"weights": {
|
| 68 |
+
"actorder": null,
|
| 69 |
+
"block_structure": [
|
| 70 |
+
128,
|
| 71 |
+
128
|
| 72 |
+
],
|
| 73 |
+
"dynamic": false,
|
| 74 |
+
"group_size": null,
|
| 75 |
+
"num_bits": 8,
|
| 76 |
+
"observer": "memoryless_minmax",
|
| 77 |
+
"observer_kwargs": {},
|
| 78 |
+
"scale_dtype": null,
|
| 79 |
+
"strategy": "block",
|
| 80 |
+
"symmetric": true,
|
| 81 |
+
"type": "float",
|
| 82 |
+
"zp_dtype": null
|
| 83 |
+
}
|
| 84 |
}
|
| 85 |
},
|
| 86 |
+
"format": "mixed-precision",
|
| 87 |
"global_compression_ratio": null,
|
| 88 |
"ignore": [
|
| 89 |
"model.visual.blocks.0.attn.qkv",
|
|
|
|
| 849 |
"model.language_model.layers.44.mlp.shared_experts.gate_proj",
|
| 850 |
"model.language_model.layers.44.mlp.shared_experts.up_proj",
|
| 851 |
"model.language_model.layers.44.mlp.shared_experts.down_proj",
|
| 852 |
+
"model.language_model.layers.45.eh_proj",
|
| 853 |
+
"model.language_model.layers.45.self_attn.q_a_proj",
|
| 854 |
+
"model.language_model.layers.45.self_attn.q_b_proj",
|
| 855 |
+
"model.language_model.layers.45.self_attn.kv_a_proj_with_mqa",
|
| 856 |
+
"model.language_model.layers.45.self_attn.kv_b_proj",
|
| 857 |
+
"model.language_model.layers.45.self_attn.o_proj",
|
| 858 |
+
"model.language_model.layers.45.self_attn.indexer.wq_b",
|
| 859 |
+
"model.language_model.layers.45.self_attn.indexer.wk",
|
| 860 |
+
"model.language_model.layers.45.self_attn.indexer.weights_proj",
|
| 861 |
+
"model.language_model.layers.45.mlp.gate",
|
| 862 |
+
"model.language_model.layers.45.mlp.shared_experts.gate_proj",
|
| 863 |
+
"model.language_model.layers.45.mlp.shared_experts.up_proj",
|
| 864 |
+
"model.language_model.layers.45.mlp.shared_experts.down_proj",
|
| 865 |
"lm_head"
|
| 866 |
],
|
| 867 |
"kv_cache_scheme": null,
|
model.safetensors.index.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:015faae91e8189c7553f1d48ec3d0694b8c02b282d7f58af2d7b4064a81ce4c0
|
| 3 |
+
size 17055736
|
model_mtp.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0cf8dfdc936f1cbc33b9e88d0289ff3b5b4a3d0f7381158a8ccbebb9c8adc035
|
| 3 |
+
size 7618560424
|