Text Generation
Transformers
Safetensors
English
Chinese
glm5_next
image-text-to-text
quantized
nvfp4
mxfp8
modelopt
distillation
quantization-aware-distillation
conversational
multimodal
8-bit precision
Instructions to use local-inference-lab/GLM-5.3-Flash-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use local-inference-lab/GLM-5.3-Flash-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="local-inference-lab/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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("local-inference-lab/GLM-5.3-Flash-NVFP4") model = AutoModelForMultimodalLM.from_pretrained("local-inference-lab/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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use local-inference-lab/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 "local-inference-lab/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": "local-inference-lab/GLM-5.3-Flash-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/local-inference-lab/GLM-5.3-Flash-NVFP4
- SGLang
How to use local-inference-lab/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 "local-inference-lab/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": "local-inference-lab/GLM-5.3-Flash-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 "local-inference-lab/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": "local-inference-lab/GLM-5.3-Flash-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use local-inference-lab/GLM-5.3-Flash-NVFP4 with Docker Model Runner:
docker model run hf.co/local-inference-lab/GLM-5.3-Flash-NVFP4
Update README.md
Browse files
README.md
CHANGED
|
@@ -71,41 +71,19 @@ the unquantized components to compensate alongside the NVFP4 experts.
|
|
| 71 |
### Training data
|
| 72 |
|
| 73 |
The distillation corpus contains approximately 200M prompt-and-response
|
| 74 |
-
tokens.
|
| 75 |
-
reasoning, instruction following and conversations, including curated
|
| 76 |
-
coding/instruction samples, UltraChat and WildChat inputs. Assistant
|
| 77 |
-
responses come from the BF16 GLM teacher using its native chat template.
|
| 78 |
-
|
| 79 |
-
Raw text is used for activation calibration, not distillation training.
|
| 80 |
|
| 81 |
### Activation calibration
|
| 82 |
|
| 83 |
Distillation uses BF16 activations. For NVFP4 activation quantization at
|
| 84 |
inference, expert-specific input scales are calibrated separately on the
|
| 85 |
-
200M-token chat corpus
|
| 86 |
-
uses the larger maximum observed across the two corpora.
|
| 87 |
|
| 88 |
Calibration uses natural routing and covers all 12,096 layer/expert pairs
|
| 89 |
without fallback scales. Gate/up share their expert's input range; down
|
| 90 |
uses the post-activation range. The serving configuration also retains
|
| 91 |
dynamic MXFP8 activation quantization for MTP routed experts.
|
| 92 |
|
| 93 |
-
### Training-path evaluation
|
| 94 |
-
|
| 95 |
-
The prompt-disjoint holdout contains 35 chat documents and 114,714 tokens.
|
| 96 |
-
Both measurements use native student routing, NVFP4 expert weights and
|
| 97 |
-
BF16 activations. Lower is better.
|
| 98 |
-
|
| 99 |
-
| Metric | Before distillation | Distilled model |
|
| 100 |
-
| --- | ---: | ---: |
|
| 101 |
-
| Nucleus TV | 0.054213 | 0.051114 |
|
| 102 |
-
| Hidden-state MSE | 0.091256 | 0.079682 |
|
| 103 |
-
| Teacher-to-student KL | 0.047267 | 0.043334 |
|
| 104 |
-
|
| 105 |
-
These are teacher-agreement measurements on a monitored training holdout,
|
| 106 |
-
not downstream benchmark scores or measurements of NVFP4 activation
|
| 107 |
-
quantization at inference.
|
| 108 |
-
|
| 109 |
### Requirements
|
| 110 |
|
| 111 |
Use a runtime supporting the `glm5_next` architecture and this mixed
|
|
|
|
| 71 |
### Training data
|
| 72 |
|
| 73 |
The distillation corpus contains approximately 200M prompt-and-response
|
| 74 |
+
tokens. Assistant responses come from the BF16 GLM teacher using its native chat template.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
### Activation calibration
|
| 77 |
|
| 78 |
Distillation uses BF16 activations. For NVFP4 activation quantization at
|
| 79 |
inference, expert-specific input scales are calibrated separately on the
|
| 80 |
+
200M-token chat corpus.
|
|
|
|
| 81 |
|
| 82 |
Calibration uses natural routing and covers all 12,096 layer/expert pairs
|
| 83 |
without fallback scales. Gate/up share their expert's input range; down
|
| 84 |
uses the post-activation range. The serving configuration also retains
|
| 85 |
dynamic MXFP8 activation quantization for MTP routed experts.
|
| 86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
### Requirements
|
| 88 |
|
| 89 |
Use a runtime supporting the `glm5_next` architecture and this mixed
|