Text Generation
Transformers
Safetensors
English
Chinese
glm_moe_dsa
nvfp4
fp4
vllm
llm-compressor
compressed-tensors
conversational
8-bit precision
Instructions to use RedHatAI/GLM-5.3-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RedHatAI/GLM-5.3-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RedHatAI/GLM-5.3-NVFP4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("RedHatAI/GLM-5.3-NVFP4") model = AutoModelForCausalLM.from_pretrained("RedHatAI/GLM-5.3-NVFP4", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use RedHatAI/GLM-5.3-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-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-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/RedHatAI/GLM-5.3-NVFP4
- SGLang
How to use RedHatAI/GLM-5.3-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-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-NVFP4", "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 "RedHatAI/GLM-5.3-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-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use RedHatAI/GLM-5.3-NVFP4 with Docker Model Runner:
docker model run hf.co/RedHatAI/GLM-5.3-NVFP4
Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -22,9 +22,9 @@ base_model: zai-org/GLM-5.3
|
|
| 22 |
- **Input:** Text
|
| 23 |
- **Output:** Text
|
| 24 |
- **Model Optimizations:**
|
| 25 |
-
- **Weight quantization:** NVFP4
|
| 26 |
-
- **Activation quantization:** NVFP4
|
| 27 |
-
- **Format:** compressed-tensors
|
| 28 |
- **Base model:** [zai-org/GLM-5.3](https://huggingface.co/zai-org/GLM-5.3)
|
| 29 |
|
| 30 |
This is an NVFP4 checkpoint derived from [zai-org/GLM-5.3](https://huggingface.co/zai-org/GLM-5.3).
|
|
@@ -33,7 +33,7 @@ precision where needed for model quality.
|
|
| 33 |
|
| 34 |
### Model Optimizations
|
| 35 |
|
| 36 |
-
This model uses NVFP4 FP4 (E2M1) weights and activations
|
| 37 |
The checkpoint uses [LLM Compressor](https://github.com/vllm-project/llm-compressor)'s
|
| 38 |
compressed-tensors NVFP4 format.
|
| 39 |
|
|
@@ -55,16 +55,15 @@ vllm serve /data/Roderick-Wu/GLM-5.3-NVFP4-Mixed-Layerwise \
|
|
| 55 |
|
| 56 |
## Creation
|
| 57 |
|
| 58 |
-
The source model was compressed using an LLM-Compressor with experimental layerwise decompression/compression along with an NVFP4 scheme using `perfectblend` calibration samples.
|
| 59 |
-
was then postprocessed into this mixed-precision form and saved in compressed-tensors format.
|
| 60 |
|
| 61 |
## Evaluation
|
| 62 |
|
| 63 |
This model was evaluated on GSM8K Platinum, IFEval, MATH-500, AIME 2025, and GPQA Diamond using
|
| 64 |
-
[lighteval](https://github.com/huggingface/lighteval)
|
| 65 |
Generation used temperature 1.0, the `glm45` reasoning parser, FP8 E4M3 KV cache, and the same
|
| 66 |
serving stack for the NVFP4 and local FP8 baseline. GSM8K, IFEval, MATH-500, and GPQA used three
|
| 67 |
-
seeds; AIME used eight seeds. Recovery is relative to the
|
| 68 |
|
| 69 |
### Accuracy
|
| 70 |
|
|
@@ -114,16 +113,6 @@ seeds; AIME used eight seeds. Recovery is relative to the local FP8 baseline.
|
|
| 114 |
</tbody>
|
| 115 |
</table>
|
| 116 |
|
| 117 |
-
The complete comparison is:
|
| 118 |
-
|
| 119 |
-
| Benchmark | GLM-5.3-NVFP4 | Our FP8 baseline | Recovery |
|
| 120 |
-
|---|---:|---:|---:|
|
| 121 |
-
| GSM8K Platinum | 96.69% | 97.52% | 99.1% |
|
| 122 |
-
| IFEval | 85.70% | 89.77% | 95.5% |
|
| 123 |
-
| MATH-500 | 96.27% | 95.07% | 101.3% |
|
| 124 |
-
| AIME 2025 | 89.58% | 92.50% | 96.8% |
|
| 125 |
-
| GPQA Diamond | 90.40% | 92.42% | 97.8% |
|
| 126 |
-
|
| 127 |
Per-seed NVFP4 results:
|
| 128 |
|
| 129 |
- GSM8K: 96.36%, 96.86%, 96.86%
|
|
|
|
| 22 |
- **Input:** Text
|
| 23 |
- **Output:** Text
|
| 24 |
- **Model Optimizations:**
|
| 25 |
+
- **Weight quantization:** NVFP4
|
| 26 |
+
- **Activation quantization:** NVFP4
|
| 27 |
+
- **Format:** compressed-tensors
|
| 28 |
- **Base model:** [zai-org/GLM-5.3](https://huggingface.co/zai-org/GLM-5.3)
|
| 29 |
|
| 30 |
This is an NVFP4 checkpoint derived from [zai-org/GLM-5.3](https://huggingface.co/zai-org/GLM-5.3).
|
|
|
|
| 33 |
|
| 34 |
### Model Optimizations
|
| 35 |
|
| 36 |
+
This model uses NVFP4 FP4 (E2M1) weights and activations and two-level scaling. Layers outside of routed experts are left unquantized.
|
| 37 |
The checkpoint uses [LLM Compressor](https://github.com/vllm-project/llm-compressor)'s
|
| 38 |
compressed-tensors NVFP4 format.
|
| 39 |
|
|
|
|
| 55 |
|
| 56 |
## Creation
|
| 57 |
|
| 58 |
+
The source model was compressed using an LLM-Compressor with experimental layerwise decompression/compression along with an NVFP4 scheme using `perfectblend` calibration samples.
|
|
|
|
| 59 |
|
| 60 |
## Evaluation
|
| 61 |
|
| 62 |
This model was evaluated on GSM8K Platinum, IFEval, MATH-500, AIME 2025, and GPQA Diamond using
|
| 63 |
+
[lighteval](https://github.com/huggingface/lighteval). Evaluation was run on a vLLM server hosted on 4xB200.
|
| 64 |
Generation used temperature 1.0, the `glm45` reasoning parser, FP8 E4M3 KV cache, and the same
|
| 65 |
serving stack for the NVFP4 and local FP8 baseline. GSM8K, IFEval, MATH-500, and GPQA used three
|
| 66 |
+
seeds; AIME used eight seeds. Recovery is relative to the [base model](https://huggingface.co/zai-org/GLM-5.3) run in the same evaluation harness.
|
| 67 |
|
| 68 |
### Accuracy
|
| 69 |
|
|
|
|
| 113 |
</tbody>
|
| 114 |
</table>
|
| 115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
Per-seed NVFP4 results:
|
| 117 |
|
| 118 |
- GSM8K: 96.36%, 96.86%, 96.86%
|