Can an M1 Max 64GB Mac run Qwen2.5-Coder 7B?
M1 Max ยท 64 GB unified memory ยท 400 GB/s ยท MacBook Pro 16" (M1 Max), Mac Studio (M1 Max)
At Q4_K_M it needs about 5.8 GiB, leaving 48.6 GiB spare out of the ~54.4 GiB macOS will let you use. Expect roughly 69 tokens/sec โ faster than you can read.
Where the memory goes
Three things occupy memory when a model is loaded: the weights themselves, the KV cache that holds the conversation, and the runtime's own working buffers. Only the first is fixed โ the KV cache grows with every token in your context.
| Quantisation | Weights | Total | Tok/s | Fits? |
|---|---|---|---|---|
| FP16 | 14.2 GiB | 16.1 GiB | 21 | Yes, comfortably |
| Q8_0 | 7.5 GiB | 9.2 GiB | 40 | Yes, comfortably |
| Q6_K | 5.9 GiB | 7.4 GiB | 51 | Yes, comfortably |
| Q5_K_M | 5.1 GiB | 6.5 GiB | 59 | Yes, comfortably |
| Q4_K_M | 4.3 GiB | 5.8 GiB | 69 | Yes, comfortably |
| Q3_K_M | 3.5 GiB | 4.9 GiB | 86 | Yes, comfortably |
| Q2_K | 2.7 GiB | 4.0 GiB | 112 | Yes, comfortably |
The default. Best quality-per-gigabyte for most people.
How long a context fits
The KV cache is often what breaks a setup that looked fine at load time. Quantising it to 8-bit roughly halves its footprint with little measurable quality cost.
| Context | KV cache | Total | FP16 KV | Q8 KV |
|---|---|---|---|---|
| 2K | 0.1 GiB | 5.2 GiB | Yes, comfortably | Yes, comfortably |
| 4K | 0.2 GiB | 5.4 GiB | Yes, comfortably | Yes, comfortably |
| 8K | 0.4 GiB | 5.8 GiB | Yes, comfortably | Yes, comfortably |
| 16K | 0.9 GiB | 6.5 GiB | Yes, comfortably | Yes, comfortably |
| 32K | 1.8 GiB | 8.0 GiB | Yes, comfortably | Yes, comfortably |
| 128K | 7.0 GiB | 16.9 GiB | Yes, comfortably | Yes, comfortably |
How to run it
Ollama is the shortest path. It picks a quantisation automatically โ usually Q4_K_M, which is what the numbers above assume.
brew install ollama
ollama serve &
ollama run qwen2.5-coder:7b
For MLX โ Apple's own array framework, typically a little faster than llama.cpp on Apple Silicon:
pip install mlx-lm
mlx_lm.generate --model mlx-community/Qwen2-5-Coder-7B-4bit --prompt "Hello"
Macs that run Qwen2.5-Coder 7B comfortably
The smallest configuration that handles it is the M1 16GB (MacBook Air (M1)).
| Mac | Memory | Bandwidth | Tok/s |
|---|---|---|---|
| M1 16GB | 16 GB | 68 GB/s | 12 |
| M1 Pro 16GB | 16 GB | 200 GB/s | 34 |
| M2 16GB | 16 GB | 100 GB/s | 17 |
| M4 16GB | 16 GB | 120 GB/s | 21 |
| M3 Pro 18GB | 18 GB | 150 GB/s | 26 |
| M2 24GB | 24 GB | 100 GB/s | 17 |
| M4 24GB | 24 GB | 120 GB/s | 21 |
| M4 Pro 24GB | 24 GB | 273 GB/s | 47 |
| M1 Max 32GB | 32 GB | 400 GB/s | 69 |
| M2 Max 32GB | 32 GB | 400 GB/s | 69 |
| M4 32GB | 32 GB | 120 GB/s | 21 |
| M3 Max 36GB | 36 GB | 300 GB/s | 51 |
Common questions
- Can an M1 Max 64GB Mac run Qwen2.5-Coder 7B?
- Yes. At Q4_K_M it needs about 5.8 GiB of the roughly 54.4 GiB available, generating around 69 tokens per second.
- How fast is Qwen2.5-Coder 7B on an Mac?
- Around 69 tokens per second. Token generation on Apple Silicon is limited by memory bandwidth, and this machine has 400 GB/s.
- How much memory does Qwen2.5-Coder 7B need?
- 4.3 GiB for the weights at Q4_K_M, plus 0.4 GiB for an 8K-token KV cache and about 1.0 GiB of runtime overhead โ 5.8 GiB in total.