How to Install Qwen 2.5 Coder 32B on Mac M4 Max
Last updated 2026-07-10
Three tested methods to run Qwen 2.5 Coder 32B locally on Apple's M4 Max, plus the exact quant and RAM tier that hit the best tokens-per-second.
By Mohamed Meguedmi · 9 min read
Key Takeaways
- The M4 Max runs Qwen 2.5 Coder 32B Instruct comfortably. Its 546 GB/s unified memory bandwidth is the real bottleneck for generation speed, not GPU core count.
- Use the Q4_K_M GGUF (~19.9 GB) or the 4-bit MLX build on a 36 GB machine; only step up to Q6_K or Q8_0 if you have 64 GB or more.
- LM Studio with the MLX runtime is the fastest and simplest path, delivering roughly 17-20 tokens/sec at 4-bit.
- Ollama is best for CLI scripting and editor integration; llama.cpp gives you the finest control over context and offload.
- You do not need the 128 GB model. A 48-64 GB M4 Max is the sweet spot for the weights plus a full IDE and browser.
The M4 Max is arguably the best consumer machine ever shipped for local inference, and Qwen 2.5 Coder 32B is arguably the best open coding model that fits on it. Put the two together and you get a private, offline coding assistant that lands in the neighborhood of GPT-4o-class code completion without a single API call. This guide walks through exactly how to install it, which quantization to pick for your RAM, and what performance to actually expect.
Why the M4 Max handles a 32B model so well
Apple Silicon's advantage is unified memory. On a discrete-GPU PC, a 32B model has to fit inside dedicated VRAM (24 GB on an RTX 4090, for example) or suffer a brutal PCIe penalty. On the M4 Max, the GPU addresses the same pool as the CPU, so a 20 GB model simply lives in system RAM and the 40-core GPU reads it directly.
The number that matters most is memory bandwidth. Token generation for a 32B model is memory-bound: every token requires streaming the entire active weight set. The full M4 Max delivers 546 GB/s, more than double the M4 Pro's 273 GB/s. Divide that by the ~20 GB footprint of a 4-bit quant and you get a theoretical ceiling near 27 tok/s; real-world numbers land at 13-20 tok/s depending on runtime, which is comfortably interactive.
Step 1 — Pick your quantization and RAM tier
Quantization compresses the model's weights. Lower bits mean a smaller file and faster generation, at some cost to accuracy. For a 32B coding model the practical floor is 4-bit — below that (Q3, Q2_K) the model starts to hallucinate syntax and drop reasoning quality, which defeats the purpose. Ben Terhechte's early M4 Max testing found the q2_k build noticeably weaker than q8 on real tasks, confirming the general rule.
Match the quant to your installed memory. Remember that macOS itself, your IDE, and a browser easily consume 8-12 GB before the model loads.
| Unified RAM | Recommended quant | Model size on disk | Verdict |
|---|---|---|---|
| 36 GB | Q4_K_M (GGUF) or 4-bit MLX | ~19.9 GB | Works, but keep other apps light |
| 48 GB | Q5_K_M or Q6_K | ~23-27 GB | Best balance of quality and headroom |
| 64 GB | Q8_0 | ~34.8 GB | Near-lossless, full IDE headroom |
| 128 GB | Q8_0 + huge context | ~34.8 GB | Overkill for one model; ideal for multi-model |
Our recommendation for most developers: Q4_K_M is the correct default. The quality delta between Q4_K_M and Q8_0 on coding benchmarks is small, while the speed and memory savings are large. Reserve Q8_0 for machines where you have RAM to spare and want the last few points of accuracy.
Step 2 — Method 1: LM Studio (recommended)
LM Studio is the fastest way to a working setup and ships an MLX runtime, Apple's own array framework, which consistently outperforms generic GGUF inference on Apple Silicon. This is the method we recommend for most readers.
- Download LM Studio from lmstudio.ai and drag it to Applications.
- Open the Discover (search) tab and search for
Qwen2.5-Coder-32B-Instruct. - Filter for MLX builds from the
lmstudio-communityormlx-communitypublisher. Select the 4-bit variant. - Click download (~18 GB). When it finishes, open the Chat tab and load the model from the top selector.
- In the load settings, set context length to 8192-16384 to start. Leave GPU offload at maximum — on Apple Silicon everything runs on the unified GPU by default.
- Send a prompt. You should see roughly 17-20 tok/s reported in the response footer.
To use it from your editor, open the Developer tab and start the local server. LM Studio exposes an OpenAI-compatible endpoint at http://localhost:1234/v1, which plugs directly into Continue, Cline, Zed, or any tool that speaks the OpenAI API.
Step 3 — Method 2: Ollama (best for CLI and editors)
Ollama is the cleanest option if you live in the terminal or want a persistent background server for editor extensions. Installation is a single command and the model pull is one more.
# Install (or download the .dmg from ollama.com)
brew install ollama
# Pull the 4-bit quant (default tag is Q4_K_M)
ollama pull qwen2.5-coder:32b
# Run it
ollama run qwen2.5-coder:32b
To force a specific quant, use an explicit tag such as qwen2.5-coder:32b-instruct-q8_0. The full tag list lives on the official ollama.com/library/qwen2.5-coder page. Ollama serves an API on http://localhost:11434 that Continue and Cline detect automatically.
One caveat: Ollama uses llama.cpp under the hood, not MLX, so it is typically 20-30% slower than an equivalent MLX build in LM Studio. The tradeoff is a better CLI and simpler automation.
Step 4 — Method 3: llama.cpp (maximum control)
For engineers who want to tune every knob — context size, KV-cache quantization, batch size, or Metal-specific flags — build llama.cpp directly. It also gives you the newest quant formats before they reach the GUI tools.
# Clone and build with Metal support
git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp
cmake -B build
cmake --build build --config Release -j
# Download a GGUF from Hugging Face, then run
./build/bin/llama-cli \
-m qwen2.5-coder-32b-instruct-q4_k_m.gguf \
-c 16384 -ngl 99 -p "Write a Rust function that reverses a linked list."
The -ngl 99 flag offloads all layers to the Metal GPU. Grab the GGUF weights from the community mirrors linked on the official Qwen2.5-Coder-32B-Instruct model card, which also documents the model's 128K token context ceiling and licensing (Apache 2.0).
Performance: what to actually expect
The table below reflects representative throughput for the 32B Instruct model on a full 16-core/40-core M4 Max (546 GB/s). Prompt-processing (prefill) speed is far higher than generation speed because prefill is compute-bound, not memory-bound. Your exact numbers will vary with context length and thermal state.
| Runtime + quant | Generation (tok/s) | Peak RAM used | Notes |
|---|---|---|---|
| LM Studio MLX 4-bit | ~17-20 | ~22 GB | Fastest; recommended default |
| llama.cpp Q4_K_M | ~12-14 | ~23 GB | Most tunable |
| Ollama Q4_K_M | ~11-13 | ~23 GB | Best CLI ergonomics |
| llama.cpp Q8_0 | ~7-9 | ~37 GB | Highest fidelity; needs 64 GB |
Anything above ~10 tok/s reads faster than most people, so all four configurations are genuinely usable for interactive coding. The MLX path simply gets you there with the most margin. For a broader cross-model comparison, see our benchmarks hub, and to estimate the break-even point versus a cloud API, run the numbers through our cost calculator.
Optimization and troubleshooting
- Raise the memory limit. macOS caps GPU-addressable memory around 75% of RAM by default. On a 36 GB machine running Q4 you rarely hit it, but if you load Q6/Q8 near the ceiling and see slowdowns, you can raise the limit with
sudo sysctl iogpu.wired_limit_mb=<value>(resets on reboot). - Watch context length. The KV cache grows with context. A 32K-token context can add several GB on top of the weights. Start at 8K-16K and only raise it when a task needs the whole file tree.
- Thermals. Sustained generation will spin the fans and can throttle slightly on the 14-inch chassis. The 16-inch holds clocks longer. Neither is a dealbreaker for interactive use.
- Model name confusion. Qwen has since shipped newer coder families. This guide targets the Qwen 2.5 Coder 32B specifically; if you install a 3.x tag by mistake, the setup steps are identical but the weights differ.
Every throughput figure and hardware profile on this site is queryable through the BestLLMfor public API (CC BY 4.0) and our open-source MCP server, so you can pull this data straight into your own tooling or an agent workflow. Browse the full model list in the catalog.
Frequently Asked Questions
Can a 36 GB M4 Max run Qwen 2.5 Coder 32B?
Yes. The Q4_K_M or 4-bit MLX build occupies about 20-22 GB, leaving enough for macOS and a lightweight editor. Keep memory-heavy apps closed and avoid pushing context beyond ~16K tokens to stay clear of the memory ceiling.
Should I use LM Studio or Ollama?
Use LM Studio if you want the fastest speed (its MLX runtime is ~20-30% quicker on Apple Silicon) and a graphical interface. Use Ollama if you prefer the command line, want a persistent background server, or are scripting the model into editor extensions like Continue or Cline.
Is MLX really faster than GGUF on Mac?
Consistently, yes. MLX is Apple's native array framework and is tuned for the unified-memory architecture. For the same 4-bit precision it typically edges out llama.cpp-based GGUF inference by a meaningful margin on generation throughput.
Do I need the 128 GB configuration?
No. A single 32B model at Q4-Q8 fits in 22-37 GB. A 48 GB or 64 GB M4 Max gives ample headroom for the weights plus a full IDE. The 128 GB tier only pays off if you run multiple large models at once or need very long contexts.
How does local Qwen compare to a cloud API on cost?
After the hardware is paid for, local inference has no marginal per-token cost and stays fully private. Heavy daily users often break even within months versus a metered API. Model the exact crossover with the cost calculator linked above.
Verdict
Qwen 2.5 Coder 32B on an M4 Max is one of the best local coding setups money can buy today. Install the 4-bit MLX build through LM Studio, keep at least 48 GB of RAM if you can, and you have a private assistant that keeps pace with paid tiers on everyday code tasks.
| If you want… | Choose | Quant |
|---|---|---|
| Fastest, easiest setup | LM Studio (MLX) | 4-bit MLX |
| CLI + editor integration | Ollama | Q4_K_M |
| Maximum control | llama.cpp | Q4_K_M / Q8_0 |
| Highest fidelity (64 GB+) | LM Studio or llama.cpp | Q8_0 |
For running local LLMs comfortably, an RTX 5070 Ti (16 GB VRAM) is the best value for money.
Amazon Check RTX 5070 Ti price →As an Amazon Associate, BestLLMfor earns from qualifying purchases, at no extra cost to you. It does not influence our independent rankings.