gpt-oss-20b-tq3
on a Mac: what it actually needs
For Manjunath Janardhan. Worked out from your repo, no sign-up,
nothing to click.
3-bit
24 layers
8 KV heads
head dim 64
47 likes
1,466 downloads
9.9 GB
measureddownload size, summed from the
2 safetensors files in your repo
16 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.20 GB KV + 9.9 GB weights + 1.2 GB runtime = 11.3 GB, smallest Mac 16 GB
8k context0.40 GB KV + 9.9 GB weights + 1.2 GB runtime = 11.5 GB, smallest Mac 16 GB
32k context1.61 GB KV + 9.9 GB weights + 1.2 GB runtime = 12.8 GB, smallest Mac 18 GB
128k context6.44 GB KV + 9.9 GB weights + 1.2 GB runtime = 17.6 GB, smallest Mac 24 GB
KV cache = 2 tensors x 24 layers x 8 KV heads
x 64 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 | 11.3 GB | no | tight | yes | yes | yes | yes | yes | yes | yes | yes |
| 8k | 11.5 GB | no | tight | tight | yes | yes | yes | yes | yes | yes | yes |
| 32k | 12.8 GB | no | no | tight | yes | yes | yes | yes | yes | yes | yes |
| 128k | 17.6 GB | no | no | no | tight | 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 manjunathshiva/gpt-oss-20b-tq3 \
--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 gpt-oss-20b-tq3 on an M5 and add the result here with the
command I used.