Skip to content
Tech News
← Back to articles

Setting up OpenCode with Ollama and sbx on Mac

read original get Apple MacBook Pro (M4, 48GB) → more articles
Why This Matters

This is a practical how-to showing that local LLM coding agents are now viable on consumer hardware — a 48GB Apple Silicon MacBook can run ~30B models inside a coding harness like OpenCode. It also highlights an emerging best practice: running agents inside Docker sandboxes so a hallucinating model can't damage your machine. For developers, it points to a workflow where AI-assisted coding happens entirely offline, without API costs or sending code to a vendor.

Key Takeaways
Worth a Look

Apple MacBook Pro (M4, 48GB) — Running 30B local models with a usable context window takes serious unified memory, which is exactly why the article calls a high-RAM Apple silicon MacBook Pro the sweet spot for local LLM work. Ollama's MLX support means these chips chew through inference fast, so you can run Ollama, OpenCode and Docker sandboxes all at once without leaving your desk.

See Apple MacBook Pro (M4, 48GB) on Amazon → Affiliate link — we may earn a commission on purchases, at no extra cost to you. Product picked by AI based on this article; it is not a tested recommendation.

How to get started with running Ollama local models with Opencode and Docker Sandboxes.

Viable local LLM development is here. With powerful models like Qwen 3.8 and Gemma4 we can now finally use these models to build out web applications. I'm using a Apple Macbook pro m5 48GB model. I think this is the sweet spot for local development as it allows you to run 30B models with a decent sized context.

Why I use Ollama. To be frank it's just easy. It has mlx now, so it's fast on Apple silicon. It has a pretty good model directory. It is also very stable and won't crash.

Why Opencode. Well, we need to start somewhere with this blog and opencode is a great harness.

There is one other tool that I use, docker sandboxes aka sbx . I use frontier models at work which require us to sandbox our harnesses. I also, like to run my local models in containers as they can just as easily mess up your computer with a unwanted hallucination.

Installing the tools

Install Docker Sandbox:

brew trust docker/tap && brew install docker/tap/sbx

Install Opencode:

brew install anomalyco/tap/opencode

... continue reading