Instructions to use lukealonso/GLM-5.2-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lukealonso/GLM-5.2-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lukealonso/GLM-5.2-NVFP4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("lukealonso/GLM-5.2-NVFP4") model = AutoModelForCausalLM.from_pretrained("lukealonso/GLM-5.2-NVFP4") 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 lukealonso/GLM-5.2-NVFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lukealonso/GLM-5.2-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": "lukealonso/GLM-5.2-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lukealonso/GLM-5.2-NVFP4
- SGLang
How to use lukealonso/GLM-5.2-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 "lukealonso/GLM-5.2-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": "lukealonso/GLM-5.2-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 "lukealonso/GLM-5.2-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": "lukealonso/GLM-5.2-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use lukealonso/GLM-5.2-NVFP4 with Docker Model Runner:
docker model run hf.co/lukealonso/GLM-5.2-NVFP4
Have you tested the AIME-2026 scores for this version?
Hi,
I evaluated the AIME-2026 benchmark using this NVFP4 model and only got 90%, whereas the officially reported score is 99%.
Under the same settings on GPU-5.1-NVFP4 (temperature=1, top_p=0.95), the result looks much better: 96% on AIME-26.
So I’m wondering whether this quantization may be suboptimal.
I didn’t (and currently can’t) evaluate the official BF16 weights because I don’t have enough disk space or GPU memory to run them.
Just for comparison, I did run the AIME-2026 benchmark of nvidia/GLM-5.2-NVFP4 and also got only 90.83% with this config:
model: glm-5.2
api: custom
api_key_env: OPENAI_API_KEY
base_url: http://<HOST>:<PORT>/v1
max_tokens: 131072
concurrent_requests: 8
temperature: 1.0
top_p: 0.95
reasoning_effort: max
extra_body:
thinking:
type: enabled
read_cost: 0
write_cost: 0
human_readable_id: GLM 5.2 Nvidia NVFP4
date: "2026-06-22"
other_params:
open: true
creator: Z.ai
parameters: 753
active_parameters: 40
huggingface_id: nvidia/GLM-5.2-NVFP4
stream_openai_chat_completions: true
and this command (delete the "vllm" dependency before from pyproject.toml):
uv run python scripts/run.py --comp aime/aime_2026 --models glm/glm-52-nvfp4 --n 4
The following problems failed:
Problem 15 and 30: all 4 runs failed, Problem 29: 2 runs failed, Problem 20: 1 run failed, Problem 29: 2 runs failed.
Maybe later I can try the failed problems with the Z.ai API to see if it is really better.
Yes, I previously found that one of 3 wrong cases was due to incorrect match by the judger, so the correct scores should be around 93%.
If enabling tool_use, the scores go up to 99% for nvfp4.