Instructions to use 0xSero/Qwen3.5-28B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 0xSero/Qwen3.5-28B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="0xSero/Qwen3.5-28B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("0xSero/Qwen3.5-28B") model = AutoModelForImageTextToText.from_pretrained("0xSero/Qwen3.5-28B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use 0xSero/Qwen3.5-28B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "0xSero/Qwen3.5-28B" # 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/Qwen3.5-28B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/0xSero/Qwen3.5-28B
- SGLang
How to use 0xSero/Qwen3.5-28B 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 "0xSero/Qwen3.5-28B" \ --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/Qwen3.5-28B", "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 "0xSero/Qwen3.5-28B" \ --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/Qwen3.5-28B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use 0xSero/Qwen3.5-28B with Docker Model Runner:
docker model run hf.co/0xSero/Qwen3.5-28B
Support this work → · X · GitHub · REAP paper · Cerebras REAP
Qwen3.5-28B
REAP-pruned Qwen/Qwen3.5-35B-A3B.
At a glance
| Base model | Qwen/Qwen3.5-35B-A3B |
| Format | BF16 |
| Total params | 28B |
| Active / token | 3B |
| Experts / layer | — |
| Layers | — |
| Hidden size | — |
| Context | — |
| On-disk size | 57 GB |
Which variant should I pick?
| Variant | Format | Link |
|---|---|---|
Qwen3.5-264B |
BF16 | link |
Qwen3.5-264B-FP8 |
FP8 | link |
Qwen3.5-264B-W4A16 |
W4A16 | link |
Qwen3.5-28B (this) |
BF16 | link |
Qwen3.5-35B-EXL3-4bpw |
EXL3-4bpw | link |
Qwen3.5-76B |
BF16 | link |
Qwen3.5-76B-GGUF |
GGUF | link |
Qwen3.5-88B |
BF16 | link |
Qwen3.5-99B |
BF16 | link |
Qwen3.5-99B-GGUF |
GGUF | link |
This is a 20% expert-pruned version of Qwen/Qwen3.5-35B-A3B, produced using the REAP (Router-weighted Expert Activation Pruning) method from the paper "REAP the Experts: Why Pruning Prevails for One-Shot MoE Compression" (ICLR 2026).
The model retains 205 of 256 experts (~80% of original experts) while remaining competitive on standard benchmarks.
What We Did
Method: REAP Layerwise Pruning
REAP prunes MoE experts by scoring each expert's importance using a combination of:
- Router gate-values — how often and how strongly the router selects each expert
- Expert activation norms — the magnitude of each expert's output contribution
Router logit weights are renormalized to sum to 1 after pruning (critical for maintaining output scale). Pruning is applied layer-by-layer (layerwise mode).
Calibration Data
Observations were collected over a mixed calibration dataset of 1,000 samples per category:
theblackcat102/evol-codealpaca-v1(250 samples)open-r1/Mixture-of-Thoughts[code](250 samples)open-r1/Mixture-of-Thoughts[math](250 samples)open-r1/Mixture-of-Thoughts[science](250 samples)
Max sequence length: 4096 tokens. Angular distance measure for expert similarity.
Pruning Config
| Parameter | Value |
|---|---|
| Compression ratio | 20% (51 experts removed) |
| Original experts | 256 |
| Remaining experts | 205 |
| Pruning method | REAP |
| Router weight renormalization | ✓ |
| Seed | 42 |
| Calibration samples | 1,000 total |
Benchmark Results
All evaluations run with vLLM (tensor-parallel across 8x RTX 3090), greedy decoding, 0-shot.
Coding (EvalPlus, greedy, 0-shot)
| Benchmark | Original | Pruned (20%) | Delta |
|---|---|---|---|
| HumanEval (pass@1) | 76.2% | 73.2% | -3.0% |
| HumanEval+ (pass@1) | 72.0% | 70.1% | -1.9% |
Multiple Choice / Reasoning (lm-eval, 0-shot, 250 samples/task)
| Benchmark | Original | Pruned (20%) | Delta |
|---|---|---|---|
| MMLU | 84.34% | 80.89% | -3.45% |
| MMLU - Humanities | 82.40% | 76.35% | -6.05% |
| MMLU - Social Sciences | 90.04% | 88.38% | -1.66% |
| MMLU - STEM | 81.46% | 78.88% | -2.58% |
| MMLU - Other | 84.52% | 81.05% | -3.47% |
| ARC-Challenge | 60.00% | 60.40% | +0.40% |
| ARC-Easy | 84.00% | 83.20% | -0.80% |
| BoolQ | 88.00% | 89.20% | +1.20% |
| HellaSwag (norm) | 76.40% | 75.60% | -0.80% |
| OpenBookQA (norm) | 45.20% | 47.20% | +2.00% |
| RTE | 81.20% | 82.00% | +0.80% |
| WinoGrande | 77.20% | 76.80% | -0.40% |
Perplexity (WikiText-2, 10k tokens, llama.cpp)
| Model | PPL |
|---|---|
| Original (256 experts) | 6.83 |
| Pruned 20% (205 experts) | 9.51 |
Throughput (4x RTX 3090, TP=4, vLLM, enforce_eager)
| Batch Size | Original tok/s | Pruned tok/s | Speedup |
|---|---|---|---|
| 1 | 12.3 | 12.5 | 1.02x |
| 4 | 37.0 | 36.0 | 0.97x |
| 8 | 74.4 | 70.3 | 0.95x |
| 16 | 89.3 | 86.0 | 0.96x |
Note: throughput speedup is minimal at this compression level with current vLLM routing overhead. The primary benefit is reduced VRAM footprint.
Memory Footprint
| Model | Size | Shards |
|---|---|---|
| Original | ~71 GB (bf16) | 14 safetensors |
| Pruned 20% | ~53 GB (bf16) | 2 safetensors |
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "0xSero/Qwen3.5-35B-A3B-REAP-20pct"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto",
)
messages = [{"role": "user", "content": "Write a quicksort in Python."}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
With vLLM:
vllm serve 0xSero/Qwen3.5-35B-A3B-REAP-20pct \
--tensor-parallel-size 4 \
--gpu-memory-utilization 0.9 \
--max-model-len 32768
Reproducing
git clone https://github.com/cerebras/reap
cd reap
bash scripts/build.sh
python -m reap.layerwise_prune \
--model_name Qwen/Qwen3.5-35B-A3B \
--dataset_name "theblackcat102/evol-codealpaca-v1:250,open-r1/Mixture-of-Thoughts[code]:250,open-r1/Mixture-of-Thoughts[math]:250,open-r1/Mixture-of-Thoughts[science]:250" \
--compression_ratio 0.20 \
--prune_method reap \
--seed 42 \
--renormalize_router_weights true
License & citation
License inherited from the base model.
@misc{lasby2025reap,
title = {REAP the Experts: Why Pruning Prevails for One-Shot MoE Compression},
author = {Mike Lasby and Ivan Lazarevich and Nish Sinnadurai and Sean Lie and Yani Ioannou and Vithursan Thangarasa},
year = {2025}, eprint = {2510.13999}, archivePrefix = {arXiv}
}
Sponsors
Made possible by NVIDIA · TNG Technology · Lambda · Prime Intellect · Hot Aisle.
- Downloads last month
- 36
Model tree for 0xSero/Qwen3.5-28B
Base model
Qwen/Qwen3.5-35B-A3B-BaseSpace using 0xSero/Qwen3.5-28B 1
Collections including 0xSero/Qwen3.5-28B
Paper for 0xSero/Qwen3.5-28B
Evaluation results
- pass@1 on HumanEvalself-reported0.732
- pass@1 on HumanEval+self-reported0.701
- accuracy on MMLUself-reported0.809