This is an MXFP4 MLX quantization of JetBrains/Mellum2.1-12B-A2.5B-Instruct for Apple Silicon inference, produced with mlx-lm 0.32.2 / mlx 0.32.4.
The base model is a 12B mixture-of-experts decoder (2.5B active parameters) that answers directly, without a chain of thought. Weights are quantized to 4-bit MXFP4 with group size 32; the router gates are kept at 8-bit (affine, group size 64). The result is a single-file MLX build of 6.46 GB, averaging ≈4.25 bits per weight.
This is an unofficial, community quantization and is not affiliated with or endorsed by JetBrains. All model weights, architecture, and license terms come from the base model.
hidden_size 2304, intermediate_size 7168, moe_intermediate_size 896; 32 query heads and 4 KV heads (GQA); 3 of every 4 layers use a 1024-token sliding window, the rest use full attentionnorm_topk_prob thinking block; tuned for coding, agentic work, tool loops, and code questions| Property | Value |
|---|---|
| Mode | mxfp4 (4-bit float, shared E8M0 exponent per group) |
| Group size | 32 |
| Weight storage | U32 packed 4-bit weights + U8 E8M0 scales |
| Scales overhead | 1 byte per 32 weights → 4.25 bpw |
| MoE router gates | affine 8-bit, group size 64 (mlp.gate per layer) |
| Unquantized | 1-D norms in BF16 |
| Output layout | 1 shard (model.safetensors) |
| Effective bits per weight | 4.252 |
| Weight bytes | 6,457,111,871 (6.46 GB / 6.01 GiB) |
| Total download | ≈6.46 GB (weights + config, tokenizer, and this card) |
The per-layer 8-bit exception for mlp.gate is written explicitly into config.json; it follows the quant_predicate of the mellum architecture in mlx-lm.
The direct size comparison is against JetBrains' own GGUF files of the same base model. GGUF is a different runtime (llama.cpp), so treat this as a size/format trade-off rather than an apples-to-apples speed comparison.
mxfp4 (this repo) |
GGUF MXFP4_MOE | GGUF Q4_K_M | |
|---|---|---|---|
| Reference | this repo | JetBrains/Mellum2.1-12B-A2.5B-Instruct-GGUF (Mellum2.1-12B-A2.5B-Instruct-MXFP4_MOE.gguf) |
same repo, Mellum2.1-12B-A2.5B-Instruct-Q4_K_M.gguf |
| Quantization | MXFP4, group 32 | MXFP4-style MoE blocks | k-quant Q4_K_M (mixed 4/6-bit) |
| Layout | single model.safetensors + config/tokenizer |
single .gguf |
single .gguf |
| Size | 6.46 GB (6,457,111,871 weight bytes) | 7.03 GB (7,029,535,840 bytes) | 8.07 GB (8,071,294,048 bytes) |
| Effective bits per weight | ≈4.25 | ≈4.6 | ≈5.3 |
| Runtime | mlx-lm |
llama.cpp, LM Studio |
llama.cpp, LM Studio |
| Hardware | Apple Silicon via MLX/Metal | Metal, CUDA, ROCm, CPU | Metal, CUDA, ROCm, CPU |
The MXFP4 build is about 0.57 GB smaller than the GGUF MXFP4_MOE file and 1.61 GB smaller than Q4_K_M. Most of the gap is bit-rate: MXFP4 needs one byte of scale per 32 weights and no per-group bias, while the GGUF builds keep more tensors at higher precision.
Quantization is never lossless. Since this model is very confident on generic text, perplexity alone is a misleading signal here: MXFP4 slightly sharpens the logits relative to BF16, which can lower PPL even though the predictions move away from the reference. The table below therefore reports top-1 agreement with the BF16 model and the KL divergence from it.
Measured on the first 4,096-token window of a fixed 203k-token corpus (Wikipedia en+zh), comparing against a layer-by-layer BF16 run of the original checkpoint:
| Build | Top-1 agreement with BF16 | KL(BF16 ‖ build) | PPL on the window |
|---|---|---|---|
| BF16 (reference) | 100% | 0 | 15.27 |
| MXFP4 (this repo) | 82.15% | 0.222 nats/token | 10.55 |
| MXFP8 (reference build) | 93.21% | 0.047 nats/token | 19.63 |
In other words, the build keeps roughly four out of five BF16 argmax decisions. On the full 202,554-token corpus, MXFP4 agrees with the MXFP8 build on 77.2% of tokens. If you need higher fidelity, use an MXFP8 or BF16 build; MXFP4 is the size/speed option.
Greedy decoding on Apple M5 Pro (24 GB), 322-token prefill and 128 decode steps, median of 3 runs:
| Metric | Value |
|---|---|
| Prefill | 1417.4 tok/s |
| Decode | 79.8 tok/s |
| Peak memory | 6.98 GB |
Actual speed depends on prompt length, sampling, and other load on the GPU.
Self-reported by JetBrains for the base model (greedy decoding unless noted):
| Benchmark | Mellum2.1 Instruct |
|---|---|
| SWE-bench Verified | 40.4 |
| SWE-bench Pro | 20.0 |
| Terminal-Bench 2.1 | 8.2 |
| LiveCodeBench v6 | 53.7 |
| HumanEval+ | 89.1 |
| MultiPL-E (7 languages) | 73.7 |
| AIME 25/26 (avg@8) | 61.1 |
| GSM-Plus | 86.7 |
| BFCL v4 | 46.5 |
| WorkBench | 38.0 |
| IFEval | 87.2 |
| MMLU-Redux | 82.8 |
See the base model card for the full table and methodology.
from mlx_lm import load, generate
model, tokenizer = load("randmaru/Mellum2.1-12B-A2.5B-Instruct-mlx-mxfp4")
messages = [{"role": "user", "content": "Write a Python function that reverses a string."}]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
print(generate(model, tokenizer, prompt=prompt, max_tokens=256, verbose=False))
Interactive chat:
mlx_lm.chat --model randmaru/Mellum2.1-12B-A2.5B-Instruct-mlx-mxfp4
Recommended sampling from the base model card: temperature=0.6, top_p=0.95, top_k=20.
JetBrains/Mellum2.1-12B-A2.5B-Instruct checkpoint has no model-mtp.safetensors; this build is plain autoregressive inference. JetBrains publishes a separate Instruct-MTP repository with an additional MTP shard.