CoolFace
Modelpublic

UraionLabs/MiniCPM5-2B-oQ4e

sourceHugging Faceapache-2.0updated 12d agoView on Hugging Face
1likes223downloads
Model Card

<p align="center"> <img src="https://uraionlabs.com/public/icons/icon-192.png" alt="Uraion Labs" width="56"> </p>

<p align="center"> <strong>Uraion Labs</strong><br> <sub>Foundational systems research.</sub> </p>

MiniCPM5-2B — oQ4e

An MLX mixed-precision quantization of OpenBMB/MiniCPM5-2B for local inference on Apple Silicon, published by Uraion Labs.

MiniCPM5-2B-oQ4e is an MLX mixed-precision quantization of OpenBMB/MiniCPM5-2B optimized for local inference on Apple Silicon Macs. It was quantized and published by Uraion Labs using the oMLX oQe quantization workflow with importance-matrix guided sensitivity allocation. The checkpoint uses the standard MLX format and is directly compatible with both oMLX and mlx-lm.

About This Quantization

  • Quantization Level: oQ4e
  • Quantization Workflow: oMLX oQe mixed-precision quantization
  • Base Weight Precision: 4-bit
  • Mixed-Precision Profile: Mixed 4/5/6-bit precision (58 @ 5b, 9 @ 6b)
  • Layer Overrides: 67 overrides: 58 layers boosted to 5-bit, 9 layers boosted to 6-bit across attention and MLP projections
  • Output Head (`lm_head`) Precision: 4-bit
  • Group Size: 64
  • Quantization Mode: Affine (scale and bias per group)
  • Non-Quantized Tensor Precision: BF16 (LayerNorm weights, embedding scales and biases)
  • Calibration Dataset: oqe_code_multilingual (294 calibration samples)
  • Model File Size: 1.38 GB (1,410.44 MB)
  • Effective Bits Per Weight: Effective ~4.4 bits per weight balancing compression with selective precision allocation.

Model Information

PropertyValue
Original ModelOpenBMB/MiniCPM5-2B
Quantization VariantoQ4e
Quantized ByUraion Labs
ArchitectureLlamaForCausalLM (llama)
Base Precision4-bit
Mixed-Precision AllocationMixed 4/5/6-bit precision (58 @ 5b, 9 @ 6b)
Output Head (lm_head)4-bit
Quantization ModeAffine (group size 64)
Non-Quantized PrecisionBF16
Total Parameters2,516,756,480 (~2.52B)
Non-Embedding Parameters1,981,982,720 (~1.98B)
Layers42
Attention ConfigurationGQA — 16 Q heads / 2 KV heads (head dim 128)
Context Length131,072 tokens
Storage FormatMLX safetensors
Target RuntimeApple Silicon macOS (omlx, mlx-lm)
Model Weight Size1.38 GB (1,410.44 MB)
LicenseApache-2.0

Upstream MiniCPM5-2B Highlights

MiniCPM5-2B is developed by OpenBMB as the 2B-scale model in the MiniCPM5 series:

  • 2B-Class Open-Source State of the Art: Reaches top-tier performance among models in its size category (averaging 53.9 across OpenBMB's evaluation set) while remaining competitive with 3B and 4B class models.
  • Native 131k Context: Supports up to 131,072 tokens context window out of the box for document synthesis, repo-wide code reasoning, and long conversation threads.
  • Standard LLaMA Architecture: Uses standard LlamaForCausalLM with Grouped-Query Attention (GQA, 16 Q heads, 2 KV heads), enabling out-of-the-box execution across standard inference runtimes.
  • High-Quality Training Datasets: Trained using OpenBMB's UltraData data curriculum, including Ultra-FineWeb, UltraX, UltraData-Code, UltraData-SFT, and UltraData-RL.
  • Agentic and Tool-Use Capabilities: Engineered for high accuracy on function calling, structured output generation, and coding assistant workflows.

Quantization Family Navigation

QuantBase BitsMixed-Precision Profilelm_headModel SizeRepository
oQ8e8-bitUniform 8-bit8-bit2.49 GBUraionLabs/MiniCPM5-2B-oQ8e
oQ6e6-bitMixed 6/8-bit (28 layers @ 8-bit)6-bit1.95 GBUraionLabs/MiniCPM5-2B-oQ6e
oQ5e5-bitMixed 5/6/8-bit (19 @ 6b, 6 @ 8b)6-bit1.67 GBUraionLabs/MiniCPM5-2B-oQ5e
oQ4e4-bitMixed 4/5/6-bit (58 @ 5b, 9 @ 6b)4-bit1.38 GBUraionLabs/MiniCPM5-2B-oQ4e
oQ3.5e3-bitMixed 3/5/6-bit (29 @ 5b, 7 @ 6b)6-bit1.17 GBUraionLabs/MiniCPM5-2B-oQ3.5e
oQ3e3-bitMixed 3/5/6-bit (31 @ 5b, 7 @ 6b)3-bit1.08 GBUraionLabs/MiniCPM5-2B-oQ3e
oQ2.7e2-bitMixed 2/5/6/8-bit (23 @ 5b, 8 @ 6b, lm_head @ 8b)8-bit0.98 GBUraionLabs/MiniCPM5-2B-oQ2.7e
oQ2e2-bitMixed 2/5/6-bit (10 @ 5b, 6 @ 6b)6-bit0.88 GBUraionLabs/MiniCPM5-2B-oQ2e

Quickstart

Using oMLX

oMLX provides a high-throughput runtime for MLX models on Apple Silicon:

bash
# Install oMLX
pip install omlx

# Run inference
omlx run UraionLabs/MiniCPM5-2B-oQ4e --prompt "Explain quantum entanglement in simple terms."

Using mlx-lm

This quantization is fully compatible with Apple's standard mlx-lm library:

bash
# Install mlx-lm
pip install mlx-lm
Python Example
python
from mlx_lm import load, generate

model, tokenizer = load("UraionLabs/MiniCPM5-2B-oQ4e")

prompt = "Explain quantum entanglement in simple terms."
messages = [{"role": "user", "content": prompt}]
prompt_formatted = tokenizer.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True
)

response = generate(
    model,
    tokenizer,
    prompt=prompt_formatted,
    max_tokens=512,
    temp=1.0,
    top_p=0.95,
    verbose=True,
)
CLI Example
bash
python -m mlx_lm.generate \
  --model UraionLabs/MiniCPM5-2B-oQ4e \
  --prompt "Explain quantum entanglement in simple terms." \
  --temp 1.0 \
  --top-p 0.95 \
  --max-tokens 512

Hugging Face Download

To download the repository files locally:

bash
hf download UraionLabs/MiniCPM5-2B-oQ4e

Recommended Generation Settings

The following sampling parameters are officially recommended by OpenBMB for MiniCPM5-2B:

ParameterRecommended ValueNote
temperature1.0Balanced diversity and reasoning coherence
top_p0.95Nucleus sampling threshold
do_sampletrueStochastic sampling enabled

When performing deterministic evaluation or greedy decoding, set temperature=0.0 or do_sample=false.

Evaluation Results and Benchmark Context

Benchmark results below are reported by OpenBMB for the original MiniCPM5-2B release. This Uraion Labs quantization has not been independently benchmarked unless explicitly stated otherwise.
Capability / BenchmarkMiniCPM5-2B (Upstream)Qwen3.5-4Bgranite-4.2-3BLFM2.5-2.6B
Average Score53.951.142.733.2
LiveCodeBench v669.156.458.942.1
LCB-Pro 25Q2 (Easy)68.058.354.630.9
AIME 202586.578.879.441.9
AIME 202686.582.783.545.2
MATH-50094.699.097.089.6
MMLU-Pro70.878.065.865.2
MMLU-Redux84.788.778.980.0
IFBench66.359.073.059.0
AA-LCR (Long Context)59.046.135.85.3

Limitations and Disclaimer

This model generates text based on statistical language modeling patterns and may produce inaccurate, biased, or hallucinated statements. Responses regarding sensitive or specialized domains (such as law, medical treatment, or financial investment) must not be treated as professional advice.

This model is provided "AS IS", without warranty of any kind, express or implied. Users are responsible for verifying outputs, implementing safety guardrails, and complying with all applicable local regulations and acceptable use policies.

Original Model and Attribution

This repository contains a quantized derivative of OpenBMB/MiniCPM5-2B.

MiniCPM5-2B was developed and trained by OpenBMB. Model architecture, pre-training, instruction tuning, benchmarks, and capabilities described on this page originate from the upstream MiniCPM5-2B release.

Training-data metadata is inherited from the upstream OpenBMB/MiniCPM5-2B release. Uraion Labs performed quantization only and did not retrain this checkpoint.

Upstream Resources

License

This repository and the underlying MiniCPM model weights are released under the Apache-2.0 License.

Citation

Please cite the original MiniCPM research when referencing this work:

bibtex
@article{minicpm4,
  title={Minicpm4: Ultra-efficient llms on end devices},
  author={MiniCPM, Team},
  journal={arXiv preprint arXiv:2506.07900},
  year={2025}
}

<p align="center"> <sub>Quantized and published by <a href="https://uraionlabs.com">Uraion Labs</a>. Foundational systems research.</sub> </p>