REAP the Experts: Why Pruning Prevails for One-Shot MoE compression
Paper • 2510.13999 • Published • 19
How to use 0xSero/GLM-5-REAP-381B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="0xSero/GLM-5-REAP-381B")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("0xSero/GLM-5-REAP-381B")
model = AutoModelForCausalLM.from_pretrained("0xSero/GLM-5-REAP-381B")
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 0xSero/GLM-5-REAP-381B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "0xSero/GLM-5-REAP-381B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "0xSero/GLM-5-REAP-381B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/0xSero/GLM-5-REAP-381B
How to use 0xSero/GLM-5-REAP-381B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "0xSero/GLM-5-REAP-381B" \
--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": "0xSero/GLM-5-REAP-381B",
"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 "0xSero/GLM-5-REAP-381B" \
--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": "0xSero/GLM-5-REAP-381B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use 0xSero/GLM-5-REAP-381B with Docker Model Runner:
docker model run hf.co/0xSero/GLM-5-REAP-381B
Support this work: donate.sybilsolutions.ai
REAP surfaces: GLM | MiniMax | Qwen | Gemma | Paper | Code | PR17 | Cerebras Collection
This repository now hosts the BF16 GLM-5 checkpoint produced by a 50% REAP prune. The actual checkpoint contents are the BF16 files described below.
GLM-5-BF16GlmMoeDsaForCausalLMrefusal_contrast_reap0.5042true381,464,351,232762,928,740,864 bytes17BF16glm5-grouped-22k-20260331T172330Zcombined/data0/external_research/glm5-layerwise-reap-artifacts/GLM-5-BF16/combined/pruned_models/layerwise_refusal_contrast_reap-renorm_true-seed_42-0.50model-00001-of-00017.safetensors through model-00017-of-00017.safetensorsmodel.safetensors.index.jsonconfig.jsongeneration_config.jsonchat_template.jinjatokenizer.jsontokenizer_config.jsonreap_layerwise_args.yaml2026-04-05.Thank you for the kind sponsors, wouldn't be possible without them: