Instructions to use axteam/GLM-4-9B-0414-FP8-dynamic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use axteam/GLM-4-9B-0414-FP8-dynamic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="axteam/GLM-4-9B-0414-FP8-dynamic") 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("axteam/GLM-4-9B-0414-FP8-dynamic") model = AutoModelForCausalLM.from_pretrained("axteam/GLM-4-9B-0414-FP8-dynamic", 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 axteam/GLM-4-9B-0414-FP8-dynamic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "axteam/GLM-4-9B-0414-FP8-dynamic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "axteam/GLM-4-9B-0414-FP8-dynamic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/axteam/GLM-4-9B-0414-FP8-dynamic
- SGLang
How to use axteam/GLM-4-9B-0414-FP8-dynamic 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 "axteam/GLM-4-9B-0414-FP8-dynamic" \ --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": "axteam/GLM-4-9B-0414-FP8-dynamic", "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 "axteam/GLM-4-9B-0414-FP8-dynamic" \ --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": "axteam/GLM-4-9B-0414-FP8-dynamic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use axteam/GLM-4-9B-0414-FP8-dynamic with Docker Model Runner:
docker model run hf.co/axteam/GLM-4-9B-0414-FP8-dynamic
GLM-4-9B-0414 · FP8 (dynamic)
8-bit quantization of zai-org/GLM-4-9B-0414 for vLLM serving. Quantized by axteam.
| Base model | zai-org/GLM-4-9B-0414 |
| Method | FP8 (dynamic) |
| Format | compressed-tensors FP8_DYNAMIC |
| Weights / activations | W8A8 — FP8 E4M3 weights (per-channel), dynamic per-token FP8 activations |
| Architecture | Dense (GLM-4 · Glm4ForCausalLM) · 9.4B · text-only |
| Size on disk | ~9.9 GB |
| Calibration | None (data-free) |
| License | mit |
Quantization details
- Scheme — W8A8 — FP8 E4M3 weights (per-channel), dynamic per-token FP8 activations, stored as compressed-tensors
FP8_DYNAMIC. - Kept in BF16 — token embeddings, the LM head, and all RMSNorms. Only attention & MLP projections are quantized.
- Post-training quantization (no retraining). Tokenizer /
chat_templateidentical to the original.
Evaluation
Checked against the BF16 original (perplexity + top-1, EN/KO).
Usage (vLLM)
vllm serve axteam/GLM-4-9B-0414-FP8-dynamic
License
Quantized derivative of zai-org/GLM-4-9B-0414 (mit).
한국어 요약
zai-org/GLM-4-9B-0414 를 FP8 (dynamic) 로 양자화한 서빙용(8-bit) 모델입니다. 작성: axteam.
- 방식 — FP8 E4M3, 가중치 채널별 스케일, 활성화 동적 FP8. 형식 compressed-tensors
FP8_DYNAMIC. - BF16 유지 — 임베딩·LM 헤드·모든 norm. attention·MLP projection 만 양자화.
- PTQ(재학습 없음), 토크나이저·chat_template 원본 동일.
- 품질 — BF16 대비 perplexity·top-1 검증.
- 사용 —
vllm serve axteam/GLM-4-9B-0414-FP8-dynamic. 라이선스 mit.
- Downloads last month
- -
Model tree for axteam/GLM-4-9B-0414-FP8-dynamic
Base model
zai-org/GLM-4-9B-0414