Setting up OpenCode with Ollama and sbx on Mac
20 days ago
- Running local LLMs like Qwen 3.8 (27B) and Gemma4 (31B) on a MacBook Pro M5 48GB is viable for development.
- Ollama provides easy setup, fast performance on Apple Silicon via MLX, and a stable model directory.
- Opencode is used as the harness, and Docker Sandboxes isolate the environment to prevent hallucination damages.
- Install Docker Sandbox (`brew install docker/tap/sbx`), Opencode (`brew install anomalyco/tap/opencode`), and Ollama (from website).
- Pull recommended models: `qwen3.8:27b-mxfp8` and `gemma4:31b-mxfp8` (or MLX variants for lower RAM).
- Configure each project with an `sbx-kit` directory containing `spec.yaml` and `opencode-local.json` for network and model settings.
- Launch with `sbx run opencode --kit ./sbx-kit/` and adjust reasoning effort via `/models` command.
- Note: Docker login is required to use `sbx`.