Text Generation
Transformers
Safetensors
glm4_moe_lite
fp8
quantized
glm4
Mixture of Experts
conversational
Instructions to use marksverdhei/GLM-4.7-Flash-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use marksverdhei/GLM-4.7-Flash-FP8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="marksverdhei/GLM-4.7-Flash-FP8") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("marksverdhei/GLM-4.7-Flash-FP8") model = AutoModelForCausalLM.from_pretrained("marksverdhei/GLM-4.7-Flash-FP8", 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 marksverdhei/GLM-4.7-Flash-FP8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "marksverdhei/GLM-4.7-Flash-FP8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "marksverdhei/GLM-4.7-Flash-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/marksverdhei/GLM-4.7-Flash-FP8
- SGLang
How to use marksverdhei/GLM-4.7-Flash-FP8 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 "marksverdhei/GLM-4.7-Flash-FP8" \ --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": "marksverdhei/GLM-4.7-Flash-FP8", "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 "marksverdhei/GLM-4.7-Flash-FP8" \ --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": "marksverdhei/GLM-4.7-Flash-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use marksverdhei/GLM-4.7-Flash-FP8 with Docker Model Runner:
docker model run hf.co/marksverdhei/GLM-4.7-Flash-FP8
metadata
license: mit
base_model: zai-org/GLM-4.7-Flash
tags:
- fp8
- quantized
- glm4
- moe
library_name: transformers
GLM-4.7-Flash FP8
FP8 quantized version of zai-org/GLM-4.7-Flash.
Also, see Unsloth's new unsloth/GLM-4.7-Flash-FP8-Dynamic
Quantization Details
- Method: FP8 E4M3 per-tensor quantization with embedded scales
- Original size: ~62GB (BF16)
- Quantized size: ~30GB (FP8)
- Preserved in BF16: lm_head, embed_tokens, layernorms, router weights
Performance
Tested on 2x RTX 3090 (24GB each) with vLLM 0.13.0:
| Setting | Value |
|---|---|
| Tensor Parallel | 2 |
| Context Length | 8192 |
| VRAM per GPU | 14.7 GB |
| Throughput | 19.4 tokens/sec |
Note: RTX 3090 lacks native FP8 support, so vLLM uses the Marlin kernel for weight-only FP8 decompression. GPUs with native FP8 (RTX 40xx, Ada Lovelace+) will achieve higher throughput.
Usage with vLLM
Requires vLLM 0.13.0+ and transformers 5.0+ for glm4_moe_lite architecture support.
from vllm import LLM, SamplingParams
llm = LLM(
model="marksverdhei/GLM-4.7-Flash-fp8",
tensor_parallel_size=2,
max_model_len=8192,
enforce_eager=True, # Optional: disable CUDA graphs to save VRAM
)
outputs = llm.generate(["Hello, world!"], SamplingParams(max_tokens=100))
print(outputs[0].outputs[0].text)
License
MIT (same as base model)