Instructions to use RedHatAI/GLM-5.2-MXFP4xFP8_BLOCK with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RedHatAI/GLM-5.2-MXFP4xFP8_BLOCK with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RedHatAI/GLM-5.2-MXFP4xFP8_BLOCK") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("RedHatAI/GLM-5.2-MXFP4xFP8_BLOCK") model = AutoModelForCausalLM.from_pretrained("RedHatAI/GLM-5.2-MXFP4xFP8_BLOCK", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use RedHatAI/GLM-5.2-MXFP4xFP8_BLOCK with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RedHatAI/GLM-5.2-MXFP4xFP8_BLOCK" # 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.2-MXFP4xFP8_BLOCK", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/RedHatAI/GLM-5.2-MXFP4xFP8_BLOCK
- SGLang
How to use RedHatAI/GLM-5.2-MXFP4xFP8_BLOCK 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.2-MXFP4xFP8_BLOCK" \ --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.2-MXFP4xFP8_BLOCK", "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.2-MXFP4xFP8_BLOCK" \ --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.2-MXFP4xFP8_BLOCK", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use RedHatAI/GLM-5.2-MXFP4xFP8_BLOCK with Docker Model Runner:
docker model run hf.co/RedHatAI/GLM-5.2-MXFP4xFP8_BLOCK
GLM-5.2-MXFP4xFP8_BLOCK
Model Overview
- Model Architecture: GlmMoeDsaForCausalLM
- Input: Text
- Output: Text
- Model Optimizations:
- Weight quantization: Mixed (MXFP4 / FP8_BLOCK)
- Activation quantization: FP8
- Version: 1.0
- Model Developers: RedHatAI
This model is a quantized version of zai-org/GLM-5.2.
Model Optimizations
This model was obtained by applying mixed-precision quantization to zai-org/GLM-5.2, quantizing the MoE expert linears to 4-bit MXFP4 and the remaining quantized linears (attention, dense, and shared-expert layers) to 8-bit block-scaled FP8 with dynamic FP8 activation scaling, ready for inference with vLLM.
This optimization reduces the number of bits per parameter from 16 to an average of ~4.4 bits, shrinking the on-disk model size from ~1.47 TB (BF16) to ~411 GB and reducing disk and GPU memory requirements by approximately 72%.
Only the linear operators within transformer blocks are quantized using LLM Compressor.
Note: this quantized checkpoint is experimentally supported in vLLM.
Deployment
Use with vLLM
vllm serve RedHatAI/GLM-5.2-MXFP4xFP8_BLOCK \
--tensor-parallel-size 8 \
--kv-cache-dtype fp8_e4m3 \
--speculative-config '{"method": "mtp", "num_speculative_tokens": 5}' \
--tool-call-parser glm47 \
--reasoning-parser glm45 \
--enable-auto-tool-choice
Creation
This model was created by applying LLM Compressor with the mixed-precision scheme described above (RTN, no calibration data), exported in compressed-tensors format.
- Downloads last month
- 4,934
Model tree for RedHatAI/GLM-5.2-MXFP4xFP8_BLOCK
Base model
zai-org/GLM-5.2Evaluation results
- Idavidrein/gpqa 路 Diamond View evaluation results source leaderboard 91.2
- datacurve/deep-swe 路 Deep Swe View evaluation results source leaderboard 46.2
- ScaleAI/SWE-bench_Pro 路 SWE Bench Pro View evaluation results source leaderboard 62.1
- cais/hle 路 Hle
- default View evaluation results source40.5
- With tools View evaluation results source54.7 *