Sharp-MiniCPM5-2B-MLX-oQ6e
on a Mac: what it actually needs
For Saga. Worked out from your repo, no sign-up,
nothing to click.
6-bit
42 layers
2 KV heads
head dim 128
4 likes
767 downloads
2.1 GB
measureddownload size, summed from the
1 safetensors file in your repo
8 GB Mac
computedthe smallest machine that holds it
at 8k context, assuming MLX can wire 75% of unified memory
What it needs as context grows
4k context0.18 GB KV + 2.1 GB weights + 1.2 GB runtime = 3.5 GB, smallest Mac 8 GB
8k context0.35 GB KV + 2.1 GB weights + 1.2 GB runtime = 3.6 GB, smallest Mac 8 GB
32k context1.41 GB KV + 2.1 GB weights + 1.2 GB runtime = 4.7 GB, smallest Mac 8 GB
128k context5.64 GB KV + 2.1 GB weights + 1.2 GB runtime = 8.9 GB, smallest Mac 16 GB
KV cache = 2 tensors x 42 layers x 2 KV heads
x 128 head dim x 2 bytes (fp16) x tokens. Read straight off your
config.json. Runtime overhead is the 1.2 GB I see for Python, MLX, the
tokenizer and activations on my own runs.
Mac by Mac
| Context | Needs | 8 | 16 | 18 | 24 | 32 | 36 | 48 | 64 | 96 | 128 |
| 4k | 3.5 GB | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes |
| 8k | 3.6 GB | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes |
| 32k | 4.7 GB | tight | yes | yes | yes | yes | yes | yes | yes | yes | yes |
| 128k | 8.9 GB | no | yes | yes | yes | yes | yes | yes | yes | yes | yes |
Columns are unified memory in GB. "Tight" means it fits but leaves under
2 GB for anything else, so expect swap once a browser is open.
Run it
pip install mlx-lm
mlx_lm.generate --model peculiar-ragdoll/Sharp-MiniCPM5-2B-MLX-oQ6e \
--prompt "hello" --max-tokens 100
What is not on this page
not measuredTokens per second. That needs a
real run on real silicon and I will not print a number I have not seen. If you want it,
reply and I will run Sharp-MiniCPM5-2B-MLX-oQ6e on an M5 and add the result here with the
command I used.