Running frontier-level AI models locally on a MacBook feels like living in the future- until you actually try to use one for real software engineering work.
Recently, I spun up gemma4:12b locally using Ollama on my Mac for what seemed like a straightforward task: reviewing a JavaScript tokenizer script and applying the suggested fixes.
The code review went great. Snappy feedback, solid analysis, and I was feeling optimistic. Then... I asked it to actually write the updated code.
Thinking... [ββββββββββ------------------------] 15 mins passed
My Macβs fans spun up. My terminal cursor blinked. After nearly 15 minutes of waiting, I hit Ctrl+C.
My immediate takeaway? Local AI isnβt worth the wait for complex, generation-heavy coding tasks.
But as it turns out, I fell straight into a few hidden traps of local LLM behavior on Apple Silicon. Hereβs what went wrong under the hoodβand how to make local models actually usable. π
π Why It Took 15+ Minutes (The Anatomy of a Stall)
When a local model crawls on a task it should easily handle, it usually comes down to three silent killers:
1οΈβ£ The Silent Memory Spillover π§ π
Apple Silicon's Unified Memory is amazing, but it has limits.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β YOUR 16GB MAC RAM β
βββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ€
β macOS + IDE + Apps β GPU VRAM Boundary β
β (~6-8 GB) β (Ollama is forced to swap) β
β β π¨ 1-2 tokens/sec π¨ β
βββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββ
A 12B model needs about 8 GB just to load, plus extra for the context window. Once you factor in your IDE and browser tabs, macOS quietly offloads processing to the CPU or SSD swap , dropping generation from a fast 35 tokens/sec to a painful 1β2 tokens/sec.
2οΈβ£ The Hidden "Thinking" Trap π¬π€―
Advanced models like Gemma 4 use an internal reasoning channel (<|thought|>).
- When reviewing , the thinking phase is short.
- When generating , the model can burn thousands of invisible tokens planning edge cases before writing a single line of JS.
3οΈβ£ Full-File Regeneration πβ³
Cloud APIs have massive clusters to output full files in seconds. Locally, every token costs you time. Forcing the model to rewrite a 300-line script instead of target diffs multiplies your wait time exponentially.
π οΈ 4 Quick Fixes for Speed
Before giving up on local coding, use these optimizations to supercharge your setup:
π¨ Speed Tip 1: Run ollama ps
Always verify if you are hitting a RAM bottleneck. Open a second terminal while it runs:
> ollama ps
NAME ID SIZE PROCESSOR CONTEXT RUNNER UNTIL
gemma4:12b c7292fb00b86 7.7 GB 100% GPU 4096 mlx 4 minutes from now
If the processor column says anything less than 100% GPU , your model has spilled over into CPU/swap territory.
π¨ Speed Tip 2: Switch to MLX Builds (Multi-Token Prediction)
If you are on Apple Silicon, GGUF builds can waste potential. Ollamaβs MLX-backed gemma4:12b-mlx uses speculative decoding to boost speeds. On a 16GB RAM machine, drop to gemma4:e4b-mlx to keep the footprint light.
π¨ Speed Tip 3: Cap Your Context Window π
Large context windows destroy performance on consumer hardware. Tighten the limits:
ollama run gemma4:12b-mlx --ctx-size 8192
π¨ Speed Tip 4: Ask for Diffs, Not Full Files βοΈ
Prompt specifically to keep output short:
"Review this file, then output ONLY a unified diff or the specific modified functions. Do not rewrite unchanged code."
βοΈ The Verdict: Where Should Local Models Actually Live?
ββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ
β π USE CLOUD FOR β π USE LOCAL FOR β
ββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββ€
β β’ Massive refactoring β β’ Zero-latency auto-complete β
β β’ Multi-file architectural β β’ NDAs & strict client privacy β
β changes β β’ Offline coding (flights) β
β β’ Writing entire scripts β β’ Fast, iterative queries β
ββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββ
Local AI is not a cloud replacement for heavy-lifting refactoring on a consumer Mac. But when configured right, it acts as a perfect private, offline co-pilot. Keep the small tasks local, but send the heavy lifting to the cloud!
π‘ Have you tried running models locally for your dev workflow? What is your go-to setup? Letβs chat in the comments!
Top comments (0)