Instructions to use modal-labs/GLM-5.3-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use modal-labs/GLM-5.3-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="modal-labs/GLM-5.3-NVFP4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("modal-labs/GLM-5.3-NVFP4") model = AutoModelForCausalLM.from_pretrained("modal-labs/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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use modal-labs/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 "modal-labs/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": "modal-labs/GLM-5.3-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/modal-labs/GLM-5.3-NVFP4
- SGLang
How to use modal-labs/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 "modal-labs/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": "modal-labs/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 "modal-labs/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": "modal-labs/GLM-5.3-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use modal-labs/GLM-5.3-NVFP4 with Docker Model Runner:
docker model run hf.co/modal-labs/GLM-5.3-NVFP4
GLM-5.3-NVFP4
NVFP4 quantization of Z.ai's zai-org/GLM-5.3, produced from the BF16 release (zai-org/GLM-5.3-BF16) with NVIDIA Model Optimizer. Run it on Modal.
- Base model:
zai-org/GLM-5.3-BF16(revision861dfa23) - Quantization: NVFP4 weights and activations on the routed expert linears, FP8 KV cache
- Producer: Model Optimizer 0.47.0.dev (upstream
5500999d0),general/ptq/nvfp4_experts_only-kv_fp8_castrecipe - Size: 465 GB (47 shards)
Quantization Method
Only the linear operators of the routed MoE experts (gate_proj, up_proj, down_proj in model.layers.{3..77}.mlp.experts.*) are quantized, to NVFP4 (4-bit float, group size 16, two-level scaling: per-16-element FP8 block scales plus a per-tensor global scale). Expert activations use NVFP4 with static, max-calibrated per-expert input scales.
Kept in BF16: all attention (MLA projections and the DSA indexer), shared experts, the first three dense-MLP layers (model.layers.{0..2}), the MTP/NextN layer (model.layers.78, usable for speculative decoding), lm_head, and embeddings. The KV cache is FP8 (E4M3) in cast mode (unit scale, no data-driven KV calibration). The full per-layer quantizer map is in .quant_summary.txt. The exclusion list is in hf_quant_config.json.
Calibration
Calibrated with max calibration on 1,024 samples at sequence length 1,024. The calibration set covers general text, chat, code, software engineering, agentic tool use, and math: cnn_dailymail (256 samples), Nemotron-SFT-Instruction-Following-Chat-v2 (192), OpenCodeReasoning (256), Nemotron-SFT-SWE-v2 (128), Nemotron-SFT-Agentic-v2 (128), and Nemotron-Math-v2 (64). Chat data was formatted with the model's chat template, with tool definitions included.
Deployment
Run it on Modal. Use the model's recommended sampling (temperature=1.0, top_p=0.95).
License
Quantized version of GLM-5.3, distributed under Z.ai's GLM-5.3 License, inherited from the base model.
- Downloads last month
- 20
Model tree for modal-labs/GLM-5.3-NVFP4
Base model
zai-org/GLM-5.3-BF16