Text Generation
Transformers
Safetensors
English
glm4_moe
glm-4
Mixture of Experts
glm
glm4
reap
pruned
quantized
gptq
auto-round
4bit
cerebras
code
function-calling
conversational
4-bit precision
Instructions to use Jon-Nielsen/GLM-4.7-REAP-30-W4A16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Jon-Nielsen/GLM-4.7-REAP-30-W4A16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Jon-Nielsen/GLM-4.7-REAP-30-W4A16") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("Jon-Nielsen/GLM-4.7-REAP-30-W4A16") model = AutoModelForMultimodalLM.from_pretrained("Jon-Nielsen/GLM-4.7-REAP-30-W4A16") 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 Jon-Nielsen/GLM-4.7-REAP-30-W4A16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Jon-Nielsen/GLM-4.7-REAP-30-W4A16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jon-Nielsen/GLM-4.7-REAP-30-W4A16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Jon-Nielsen/GLM-4.7-REAP-30-W4A16
- SGLang
How to use Jon-Nielsen/GLM-4.7-REAP-30-W4A16 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 "Jon-Nielsen/GLM-4.7-REAP-30-W4A16" \ --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": "Jon-Nielsen/GLM-4.7-REAP-30-W4A16", "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 "Jon-Nielsen/GLM-4.7-REAP-30-W4A16" \ --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": "Jon-Nielsen/GLM-4.7-REAP-30-W4A16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Jon-Nielsen/GLM-4.7-REAP-30-W4A16 with Docker Model Runner:
docker model run hf.co/Jon-Nielsen/GLM-4.7-REAP-30-W4A16
GLM-4.7-REAP-30 4-bit GPTQ Quantization
This is a 4-bit AutoRound GPTQ quantization of 0xSero/GLM-4.7-REAP-30, a 30% REAP-pruned version of the original GLM-4.7 MoE model.
- Quantized with AutoRound v0.9.4 (
bits=4,group_size=128,sym=True) in auto_gptq format. - Model size: ~124 GB (3.8x compression from the unquantized pruned model).
- Compatible with vLLM, Transformers + AutoGPTQ, ExLlamaV2, etc.
Example vLLM serving command
(tested on 2x NVIDIA RTX PRO 6000 Blackwell with the following settings)
vllm serve Jon-Nielsen/GLM-4.7-REAP-30-W4A16 \
--tensor-parallel-size 2 \
--kv-cache-dtype fp8 \
--gpu-memory-utilization 0.96 \
--max-model-len 196608 \
--max-num-seqs 8 \
--max-num-batched-tokens 16384 \
--trust-remote-code \
--enable-prefix-caching \
--enable-chunked-prefill \
--enable-expert-parallel \
--tool-call-parser=glm47 \
--reasoning-parser=glm45 \
--enable-auto-tool-choice \
--disable-custom-all-reduce
- Downloads last month
- 2
Model tree for Jon-Nielsen/GLM-4.7-REAP-30-W4A16
Base model
zai-org/GLM-4.7