UraionLabs commited on
Commit
7576740
·
verified ·
1 Parent(s): 417966f

docs: refresh MiniCPM5-2B oQ4e model card

Browse files
Files changed (1) hide show
  1. README.md +255 -10
README.md CHANGED
@@ -1,18 +1,263 @@
1
  ---
 
 
2
  library_name: mlx
 
 
 
 
 
3
  tags:
4
- - mlx
5
- - oq
6
- - quantized
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  ---
8
 
9
- # MiniCPM5-2B-oQ4e
 
 
10
 
11
- This model was quantized using [oQ](https://github.com/jundot/omlx) (oMLX v0.6.4) mixed-precision quantization.
 
 
 
12
 
13
- ## Quantization details
14
 
15
- - **Model type**: llama
16
- - **Bits**: 4
17
- - **Group size**: 64
18
- - **Format**: MLX safetensors
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ base_model: openbmb/MiniCPM5-2B
3
+ base_model_relation: quantized
4
  library_name: mlx
5
+ license: apache-2.0
6
+ language:
7
+ - en
8
+ - zh
9
+ pipeline_tag: text-generation
10
  tags:
11
+ - mlx
12
+ - mlx-lm
13
+ - safetensors
14
+ - minicpm
15
+ - minicpm5
16
+ - llama
17
+ - text-generation
18
+ - conversational
19
+ - quantized
20
+ - quantization
21
+ - mixed-precision
22
+ - apple-silicon
23
+ - macos
24
+ - local-llm
25
+ - local-inference
26
+ - on-device
27
+ - edge-ai
28
+ - long-context
29
+ - 131k-context
30
+ - tool-calling
31
+ - function-calling
32
+ - agent
33
+ - agentic
34
+ - coding
35
+ - reasoning
36
+ - omlx
37
+ - oq
38
+ - oqe
39
+ - uraion-labs
40
+ datasets:
41
+ - openbmb/Ultra-FineWeb
42
+ - openbmb/UltraX-Preview
43
+ - openbmb/Ultra-FineWeb-L3
44
+ - openbmb/UltraData-Math
45
+ - openbmb/UltraData-Code
46
+ - openbmb/UltraData-SFT-2605
47
+ - openbmb/UltraData-SFT-Agent-2609
48
+ - openbmb/UltraData-RL-2609
49
  ---
50
 
51
+ <p align="center">
52
+ <img src="https://uraionlabs.com/public/icons/icon-192.png" alt="Uraion Labs" width="56">
53
+ </p>
54
 
55
+ <p align="center">
56
+ <strong>Uraion Labs</strong><br>
57
+ <sub>Foundational systems research.</sub>
58
+ </p>
59
 
60
+ # MiniCPM5-2B — oQ4e
61
 
62
+ > An MLX mixed-precision quantization of OpenBMB/MiniCPM5-2B for local inference on Apple Silicon, published by Uraion Labs.
63
+
64
+ **MiniCPM5-2B-oQ4e** is an MLX mixed-precision quantization of [OpenBMB/MiniCPM5-2B](https://huggingface.co/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](https://github.com/jundot/omlx) and [mlx-lm](https://github.com/ml-explore/mlx-examples/tree/main/llms/mlx_lm).
65
+
66
+ ## About This Quantization
67
+
68
+ - **Quantization Level**: `oQ4e`
69
+ - **Quantization Workflow**: oMLX oQe mixed-precision quantization
70
+ - **Base Weight Precision**: 4-bit
71
+ - **Mixed-Precision Profile**: Mixed 4/5/6-bit precision (58 @ 5b, 9 @ 6b)
72
+ - **Layer Overrides**: 67 overrides: 58 layers boosted to 5-bit, 9 layers boosted to 6-bit across attention and MLP projections
73
+ - **Output Head (`lm_head`) Precision**: 4-bit
74
+ - **Group Size**: 64
75
+ - **Quantization Mode**: Affine (scale and bias per group)
76
+ - **Non-Quantized Tensor Precision**: BF16 (LayerNorm weights, embedding scales and biases)
77
+ - **Calibration Dataset**: `oqe_code_multilingual` (294 calibration samples)
78
+ - **Model File Size**: 1.38 GB (1,410.44 MB)
79
+ - **Effective Bits Per Weight**: Effective ~4.4 bits per weight balancing compression with selective precision allocation.
80
+
81
+ ## Model Information
82
+
83
+ | Property | Value |
84
+ | :--- | :--- |
85
+ | Original Model | [OpenBMB/MiniCPM5-2B](https://huggingface.co/openbmb/MiniCPM5-2B) |
86
+ | Quantization Variant | oQ4e |
87
+ | Quantized By | Uraion Labs |
88
+ | Architecture | `LlamaForCausalLM` (`llama`) |
89
+ | Base Precision | 4-bit |
90
+ | Mixed-Precision Allocation | Mixed 4/5/6-bit precision (58 @ 5b, 9 @ 6b) |
91
+ | Output Head (`lm_head`) | 4-bit |
92
+ | Quantization Mode | Affine (group size 64) |
93
+ | Non-Quantized Precision | BF16 |
94
+ | Total Parameters | 2,516,756,480 (~2.52B) |
95
+ | Non-Embedding Parameters | 1,981,982,720 (~1.98B) |
96
+ | Layers | 42 |
97
+ | Attention Configuration | GQA — 16 Q heads / 2 KV heads (head dim 128) |
98
+ | Context Length | 131,072 tokens |
99
+ | Storage Format | MLX safetensors |
100
+ | Target Runtime | Apple Silicon macOS (`omlx`, `mlx-lm`) |
101
+ | Model Weight Size | 1.38 GB (1,410.44 MB) |
102
+ | License | Apache-2.0 |
103
+
104
+ ## Upstream MiniCPM5-2B Highlights
105
+
106
+ MiniCPM5-2B is developed by OpenBMB as the 2B-scale model in the MiniCPM5 series:
107
+
108
+ - **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.
109
+ - **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.
110
+ - **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.
111
+ - **High-Quality Training Datasets**: Trained using OpenBMB's UltraData data curriculum, including Ultra-FineWeb, UltraX, UltraData-Code, UltraData-SFT, and UltraData-RL.
112
+ - **Agentic and Tool-Use Capabilities**: Engineered for high accuracy on function calling, structured output generation, and coding assistant workflows.
113
+
114
+ ## Quantization Family Navigation
115
+
116
+ | Quant | Base Bits | Mixed-Precision Profile | lm_head | Model Size | Repository |
117
+ | :--- | :--- | :--- | :--- | :--- | :--- |
118
+ | **oQ8e** | 8-bit | Uniform 8-bit | 8-bit | 2.49 GB | [UraionLabs/MiniCPM5-2B-oQ8e](https://huggingface.co/UraionLabs/MiniCPM5-2B-oQ8e) |
119
+ | **oQ6e** | 6-bit | Mixed 6/8-bit (28 layers @ 8-bit) | 6-bit | 1.95 GB | [UraionLabs/MiniCPM5-2B-oQ6e](https://huggingface.co/UraionLabs/MiniCPM5-2B-oQ6e) |
120
+ | **oQ5e** | 5-bit | Mixed 5/6/8-bit (19 @ 6b, 6 @ 8b) | 6-bit | 1.67 GB | [UraionLabs/MiniCPM5-2B-oQ5e](https://huggingface.co/UraionLabs/MiniCPM5-2B-oQ5e) |
121
+ | **oQ4e** | 4-bit | Mixed 4/5/6-bit (58 @ 5b, 9 @ 6b) | 4-bit | 1.38 GB | [UraionLabs/MiniCPM5-2B-oQ4e](https://huggingface.co/UraionLabs/MiniCPM5-2B-oQ4e) |
122
+ | **oQ3.5e** | 3-bit | Mixed 3/5/6-bit (29 @ 5b, 7 @ 6b) | 6-bit | 1.17 GB | [UraionLabs/MiniCPM5-2B-oQ3.5e](https://huggingface.co/UraionLabs/MiniCPM5-2B-oQ3.5e) |
123
+ | **oQ3e** | 3-bit | Mixed 3/5/6-bit (31 @ 5b, 7 @ 6b) | 3-bit | 1.08 GB | [UraionLabs/MiniCPM5-2B-oQ3e](https://huggingface.co/UraionLabs/MiniCPM5-2B-oQ3e) |
124
+ | **oQ2.7e** | 2-bit | Mixed 2/5/6/8-bit (23 @ 5b, 8 @ 6b, lm_head @ 8b) | 8-bit | 0.98 GB | [UraionLabs/MiniCPM5-2B-oQ2.7e](https://huggingface.co/UraionLabs/MiniCPM5-2B-oQ2.7e) |
125
+ | **oQ2e** | 2-bit | Mixed 2/5/6-bit (10 @ 5b, 6 @ 6b) | 6-bit | 0.88 GB | [UraionLabs/MiniCPM5-2B-oQ2e](https://huggingface.co/UraionLabs/MiniCPM5-2B-oQ2e) |
126
+
127
+ ## Quickstart
128
+
129
+ ### Using oMLX
130
+
131
+ [oMLX](https://github.com/jundot/omlx) provides a high-throughput runtime for MLX models on Apple Silicon:
132
+
133
+ ```bash
134
+ # Install oMLX
135
+ pip install omlx
136
+
137
+ # Run inference
138
+ omlx run UraionLabs/MiniCPM5-2B-oQ4e --prompt "Explain quantum entanglement in simple terms."
139
+ ```
140
+
141
+ ### Using mlx-lm
142
+
143
+ This quantization is fully compatible with Apple's standard [mlx-lm](https://github.com/ml-explore/mlx-examples/tree/main/llms/mlx_lm) library:
144
+
145
+ ```bash
146
+ # Install mlx-lm
147
+ pip install mlx-lm
148
+ ```
149
+
150
+ #### Python Example
151
+
152
+ ```python
153
+ from mlx_lm import load, generate
154
+
155
+ model, tokenizer = load("UraionLabs/MiniCPM5-2B-oQ4e")
156
+
157
+ prompt = "Explain quantum entanglement in simple terms."
158
+ messages = [{"role": "user", "content": prompt}]
159
+ prompt_formatted = tokenizer.apply_chat_template(
160
+ messages, tokenize=False, add_generation_prompt=True
161
+ )
162
+
163
+ response = generate(
164
+ model,
165
+ tokenizer,
166
+ prompt=prompt_formatted,
167
+ max_tokens=512,
168
+ temp=1.0,
169
+ top_p=0.95,
170
+ verbose=True,
171
+ )
172
+ ```
173
+
174
+ #### CLI Example
175
+
176
+ ```bash
177
+ python -m mlx_lm.generate \
178
+ --model UraionLabs/MiniCPM5-2B-oQ4e \
179
+ --prompt "Explain quantum entanglement in simple terms." \
180
+ --temp 1.0 \
181
+ --top-p 0.95 \
182
+ --max-tokens 512
183
+ ```
184
+
185
+ ### Hugging Face Download
186
+
187
+ To download the repository files locally:
188
+
189
+ ```bash
190
+ hf download UraionLabs/MiniCPM5-2B-oQ4e
191
+ ```
192
+
193
+ ## Recommended Generation Settings
194
+
195
+ The following sampling parameters are officially recommended by OpenBMB for MiniCPM5-2B:
196
+
197
+ | Parameter | Recommended Value | Note |
198
+ | :--- | :--- | :--- |
199
+ | `temperature` | `1.0` | Balanced diversity and reasoning coherence |
200
+ | `top_p` | `0.95` | Nucleus sampling threshold |
201
+ | `do_sample` | `true` | Stochastic sampling enabled |
202
+
203
+ When performing deterministic evaluation or greedy decoding, set `temperature=0.0` or `do_sample=false`.
204
+
205
+ ## Evaluation Results and Benchmark Context
206
+
207
+ > 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.
208
+
209
+ | Capability / Benchmark | MiniCPM5-2B (Upstream) | Qwen3.5-4B | granite-4.2-3B | LFM2.5-2.6B |
210
+ | :--- | :--- | :--- | :--- | :--- |
211
+ | **Average Score** | **53.9** | 51.1 | 42.7 | 33.2 |
212
+ | **LiveCodeBench v6** | **69.1** | 56.4 | 58.9 | 42.1 |
213
+ | **LCB-Pro 25Q2 (Easy)** | **68.0** | 58.3 | 54.6 | 30.9 |
214
+ | **AIME 2025** | **86.5** | 78.8 | 79.4 | 41.9 |
215
+ | **AIME 2026** | **86.5** | 82.7 | 83.5 | 45.2 |
216
+ | **MATH-500** | 94.6 | **99.0** | 97.0 | 89.6 |
217
+ | **MMLU-Pro** | 70.8 | **78.0** | 65.8 | 65.2 |
218
+ | **MMLU-Redux** | 84.7 | **88.7** | 78.9 | 80.0 |
219
+ | **IFBench** | 66.3 | 59.0 | **73.0** | 59.0 |
220
+ | **AA-LCR (Long Context)** | **59.0** | 46.1 | 35.8 | 5.3 |
221
+
222
+ ## Limitations and Disclaimer
223
+
224
+ 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.
225
+
226
+ 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.
227
+
228
+ ## Original Model and Attribution
229
+
230
+ This repository contains a quantized derivative of [OpenBMB/MiniCPM5-2B](https://huggingface.co/openbmb/MiniCPM5-2B).
231
+
232
+ 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.
233
+
234
+ Training-data metadata is inherited from the upstream OpenBMB/MiniCPM5-2B release. Uraion Labs performed quantization only and did not retrain this checkpoint.
235
+
236
+ ### Upstream Resources
237
+ - **Model Card**: [openbmb/MiniCPM5-2B](https://huggingface.co/openbmb/MiniCPM5-2B)
238
+ - **GitHub Repository**: [OpenBMB/MiniCPM](https://github.com/OpenBMB/MiniCPM)
239
+ - **MiniCPM Technical Report**: [arXiv:2506.07900](https://arxiv.org/abs/2506.07900)
240
+ - **UltraData Paper**: [arXiv:2602.09003](https://arxiv.org/abs/2602.09003)
241
+ - **Online Demo**: [MiniCPM5-2B-Demo](https://huggingface.co/spaces/openbmb/MiniCPM5-2B-Demo)
242
+ - **OpenBMB MLX Deployment Guide**: [mlx.md](https://github.com/OpenBMB/MiniCPM/blob/main/docs/deployment/mlx.md)
243
+
244
+ ## License
245
+
246
+ This repository and the underlying MiniCPM model weights are released under the [Apache-2.0](https://github.com/OpenBMB/MiniCPM/blob/main/LICENSE) License.
247
+
248
+ ## Citation
249
+
250
+ Please cite the original MiniCPM research when referencing this work:
251
+
252
+ ```bibtex
253
+ @article{minicpm4,
254
+ title={Minicpm4: Ultra-efficient llms on end devices},
255
+ author={MiniCPM, Team},
256
+ journal={arXiv preprint arXiv:2506.07900},
257
+ year={2025}
258
+ }
259
+ ```
260
+
261
+ <p align="center">
262
+ <sub>Quantized and published by <a href="https://uraionlabs.com">Uraion Labs</a>. Foundational systems research.</sub>
263
+ </p>