REAP the Experts: Why Pruning Prevails for One-Shot MoE compression
Paper • 2510.13999 • Published • 20
How to use MuVeraAI/glm-5-381-reap-w3a16 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="MuVeraAI/glm-5-381-reap-w3a16")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("MuVeraAI/glm-5-381-reap-w3a16")
model = AutoModelForCausalLM.from_pretrained("MuVeraAI/glm-5-381-reap-w3a16", 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]:]))How to use MuVeraAI/glm-5-381-reap-w3a16 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "MuVeraAI/glm-5-381-reap-w3a16"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "MuVeraAI/glm-5-381-reap-w3a16",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/MuVeraAI/glm-5-381-reap-w3a16
How to use MuVeraAI/glm-5-381-reap-w3a16 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "MuVeraAI/glm-5-381-reap-w3a16" \
--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": "MuVeraAI/glm-5-381-reap-w3a16",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "MuVeraAI/glm-5-381-reap-w3a16" \
--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": "MuVeraAI/glm-5-381-reap-w3a16",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use MuVeraAI/glm-5-381-reap-w3a16 with Docker Model Runner:
docker model run hf.co/MuVeraAI/glm-5-381-reap-w3a16
Support this work: donate.sybilsolutions.ai
REAP surfaces: GLM | MiniMax | Qwen | Gemma | Paper | Code | PR17 | Cerebras Collection
This repository contains the W3A16 AutoRound quantization of the 50% REAP-pruned GLM-5 checkpoint.
GLM-5GlmMoeDsaForCausalLM381,464,351,232refusal_contrast_reap, compression ratio 0.50, seed 42, router renormalization trueAutoRoundW3A16128NeelNanda/pile-10k1281024502929,571 / 29,659quantization_config.jsonlm_headmodel.layers.[0-2].mlp.down_projmodel.layers.[0-2].mlp.gate_projmodel.layers.[0-2].mlp.up_projmodel.layers.[0-77].self_attn.indexer.weights_proj/data0/external_research/glm5-autoround/full/glm5-reap-50pct-w3a16-pile10k-20260405T182123Z/output/layerwise_refusal_contrast_reap-renorm_true-seed_42-0.50-w3g128/data0/external_research/glm5-autoround/full/glm5-reap-50pct-w3a16-pile10k-20260405T182123Z/quant.log4549.26s.Thank you for the kind sponsors, wouldn't be possible without them:
Base model
zai-org/GLM-5