A 4.55 bpw EXL3 quantization of
openbmb/MiniCPM5-15B-A2.5B (revision a6b6ae9fb071),
OpenBMB's 15B-parameter Mixture-of-Experts model with 2.5B active parameters (thinking mode, tool calling,
long context). 9.12 GB instead of 30 GB in BF16.
Made with MLXL3. It runs today on CUDA with ExLlamaV3 1.6.9 plus the
architecture file included here (mcpm5_arch.py), because ExLlamaV3 does not ship MiniCPM5 support yet.
Native Apple Silicon support for MiniCPM5 in MLXL3 is not available yet.
The bits go where they matter most: 90.6 % of the parameters are routed experts, so the small shared parts stay at 8 bits for almost no size cost, and each expert's down projection gets one extra bit.
| Part | Parameters | Format |
|---|---|---|
Routed experts, gate_proj / up_proj (27 layers × 160 experts) |
9.06 B | EXL3 4 bpw |
Routed experts, down_proj |
4.53 B | EXL3 5 bpw |
| Attention (gated Q, K, V, O), shared expert, dense MLP of layer 0 | 0.87 B | EXL3 8 bpw |
| Output head | 0.27 B | EXL3 8 bpw |
| Embeddings, router (weights + correction bias), norms | 0.28 B | unquantized |
Decoder average: 4.55 bpw (head excluded). All tensors use the MCG codebook (-cb mcg --out_scales auto).
Router. MiniCPM5 routes with a DeepSeek-V3-style router (sigmoid scores, selection on score +
correction bias, top-16 of 160, renormalized weights × 3.66) whose logits the reference computes in FP32.
mcpm5_arch.py uses ExLlamaV3's FP32 ds3 router for this. Unquantized, it picks the same expert set as
Transformers at 512 of 512 positions.
Calibration (738,874 tokens, 396 rows):
</think>, the final answer and the tool calls are calibrated too.-mae 0.01).The reference is the official model in FP32: Transformers 5.25.1, per-expert loop, no TF32. The distributions are compared next-token by next-token over the true continuation, on 59 held-out rows (102,441 positions):
| Model | Mean KL (nat) | Median KL | p99 KL | Top-1 agreement | ΔNLL |
|---|---|---|---|---|---|
| This EXL3 4.55 bpw | 0.0117 | 0.0025 | 0.124 | 95.96 % | +0.0048 |
| Official model in BF16 (for scale) | 0.0040 | 0.0009 | 0.039 | 97.49 % | −0.0006 |
| Unquantized FP16 in ExLlamaV3 (for scale) | 0.0014 | 0.0001 | 0.015 | 98.85 % | −0.0007 |
By domain (mean KL / top-1):
The fast FP16 dots router gives the same quality on this quantization: the paired difference is
−0.00005 nat, 95 % CI [−0.00017, +0.00005].
Free generation from the uploaded files, as a sanity check rather than a benchmark:
</think> and answered correctly;merge_intervals came out with correct doctests;<function name="get_weather"><param name="city">Lyon</param></function>.Peak GPU memory was 8.7 GiB with a 16k-token cache.
Requires ExLlamaV3 1.6.9. Import mcpm5_arch before loading: it registers the MiniCPM5MoEForCausalLM
architecture.
import mcpm5_arch # in this repository; registers the architecture with ExLlamaV3
from exllamav3 import Config, Model, Cache, Tokenizer, Generator, TopPSampler
from transformers import AutoTokenizer
model_dir = "MiniCPM5-15B-A2.5B-EXL3-4.55bpw"
config = Config.from_directory(model_dir)
model = Model.from_config(config)
cache = Cache(model, max_num_tokens=32768)
model.load()
generator = Generator(model=model, cache=cache, tokenizer=Tokenizer.from_config(config))
hf_tok = AutoTokenizer.from_pretrained(model_dir) # chat template (thinking, tools)
prompt = hf_tok.apply_chat_template([{"role": "user", "content": "Hello!"}],
add_generation_prompt=True, enable_thinking=True, tokenize=False)
print(generator.generate(prompt=prompt, max_new_tokens=4096, encode_special_tokens=True,
decode_special_tokens=True, completion_only=True,
stop_conditions=[hf_tok.convert_tokens_to_ids("<|im_end|>"), 1],
sampler=TopPSampler(top_p=0.95, temperature=1.0)))
Recommended sampling (from the original model card):
enable_thinking=False): temperature 0.7, top-p 0.8, top-k 20.Thinking is on by default. Reasoning chains are often several thousand tokens long, so leave room in
max_new_tokens.
mcpm5_arch.py was tested.minicpm5_moe implementation, and Salesforce for wikitext-2.model-00001-of-00002.safetensors 8.0 GiBmodel-00002-of-00002.safetensors 547 MiB