Practical guide for running AI models locally on M4 MacBook: 24GB of memory can run 128K context smoothly
A developer shared his complete experience of running a local AI model on an M4 MacBook Pro (24GB memory): Qwen 3.5-9B Q4 quantized model can achieve an inference speed of 40 tokens/s, supports 128K context windows and tool calls, and can be used with LM Studio and OpenCode to build a practical local AI development environment.
Core conclusion
Local AI models are no longer toys. In May 2026, a developer (Johanna Larsson) successfully ran the Qwen 3.5-9B Q4 quantization model on an M4 MacBook Pro (24GB memory), achieving 40 tokens/s inference speed, 128K context window and available Tool Use capabilities. This practice shows that owning a mid-range MacBook is enough to build an AI development assistant that does not rely on cloud services.
Key Points
- Event source: Hacker News hot post (229 likes), posted by Johanna Larsson on jola.dev
- Core Findings: Qwen 3.5-9B Q4_K_S quantified as the only model that combines speed, context width, and tool availability on a 24GB M4 MacBook
- Applicable people: Content creators, independent developers, small teams, who need local AI assistance but don’t want to pay for cloud APIs
- Cost comparison: one-time hardware investment (M4 MacBook ≈ ¥12,000), no subsequent API fees
Background: The "Impossible Triangle" of local AI
For a long time, running AI models locally has faced an "impossible triangle":
| Dimensions | Cloud API (such as GPT-5.5) | Local model (Qwen 3.5-9B) | Real-world impact |
|---|---|---|---|
| Reasoning quality | ✅ SOTA level | ⚠️ Needs step-by-step guidance | The cloud API is stronger for complex tasks, and the local one is sufficient for regular tasks |
| Context window | ✅ 128K+ | ✅ 128K (available in actual testing) | There is not much difference in long document processing capabilities |
| Cost | ❌ GPT-5.5 price increase by 100% | ✅ Zero running costs | Local models have huge advantages in high-frequency usage scenarios |
| Privacy | ❌ Data sent to third party | ✅ Completely local | The only local choice for sensitive data scenarios |
| Response speed | ⚠️ Network delay 1-5s | ✅ 40 tokens/s | Continuous interaction scenes are smoother locally |
| Setting complexity | ✅ Ready to use out of the box | ⚠️ Requires configuration of quantification/inference framework | Certain technical threshold required |
Best solution tested: Qwen 3.5-9B + LM Studio
After many attempts (Qwen 3.6 Q3, GPT-OSS 20B, Devstral Small 24B, Gemma 4B), the author finally confirmed that Qwen 3.5-9B Q4_K_S is currently the most balanced choice on the 24GB M4 MacBook.
Recommended configuration
// LM Studio
temperature: 0.6
top_p: 0.95
top_k: 20
min_p: 0.0
presence_penalty: 0.0
repetition_penalty: 1.0
// Thinking
// → → Prompt Template
// {% raw %}{% set enable_thinking = true %}{% endraw %}Pi
{
"providers": {
"lmstudio": {
"baseUrl": "http://localhost:1234/v1",
"api": "openai-completions",
"apiKey": "lm-studio",
"models": [
{
"id": "qwen3.5-9b@q4_k_s",
"reasoning": true,
"compat": {
"thinkingFormat": "qwen-chat-template"
}
}
]
}
}
}OpenCode
{
"provider": {
"lmstudio": {
"npm": "@ai-sdk/openai-compatible",
"name": "LM Studio (local)",
"options": {
"baseURL": "http://127.0.0.1:1234/v1"
},
"models": {
"qwen3.5-9b@q4_k_s": {
"name": "Qwen 3.5 9B Q4_K_S",
"tools": true,
"context_length": 131072,
"max_tokens": 32768
}
}
}
},
"model": "lmstudio/qwen3.5-9b@q4_k_s"
}vs SOTA
、、****。
****。
「 SOTA ,,。,——。」
Hacker News 「Task Paralysis and AI」(221 )AI 。
- ****、、
- ****、、
- ****、、
- LM Studio
- Hugging Face Qwen 3.5-9B Q4_K_S
- , Thinking
- API (LM Studio )
- AI (Pi OpenCode)
Apple Silicon (M4 Ultra / M5)(GGUF Q3/Q2),。,「 80% + API 20% 」,。
LM Studio、OpenCode、Qwen、Hugging Face、Claude、ChatGPT、Ollama、llama.cpp
Internal link guidance
- Want to try it yourself? See the full tutorial: How to run local AI models on M4 Mac with LM Studio: A complete 30-minute tutorial
- Real case: AI developers can make money by using local models to build automated workflows: Indie Developer: n8n + OpenClaw Automation Workflow Earning $5,000/mo
- Advanced reading: DeepSeek V4 output price is only 1/36 of GPT-5.5: Token economic reconstruction in progress
Reference material
Monetization angle
How can you make money from this trend?
WayToClawEarn focuses on verified earn playbooks—not just news. Start from these cases.
n8n + OpenAI affiliate site
Automate content and affiliate monetization
Claude + n8n automation agency
Charge monthly for agent workflow builds