Build a private, local coding assistant on an Apple Silicon Mac using OpenCode and Docker Model Runner.
The default 24+ GB setup uses Gemma 4 12B for larger development work and Qwen3.5 9B as the faster fallback. On 16 GB Macs, the installer selects Qwen3.5 9B by default. Model inference runs locally through Docker Model Runner.
- OpenCode from Homebrew.
- Docker Model Runner on
127.0.0.1:12434. ai/gemma4:12b-q4_K_Mand/orai/qwen3.5:9b.- A merged OpenCode provider configuration that preserves existing providers.
- An optional native OpenCode service on
127.0.0.1:4096. opencode-local [project-path]to open a fresh browser session in a project.- Local screenshot support plus PDF text extraction and page rendering.
- Verification and privacy-conscious diagnostic scripts.
No personal projects, documents, chat histories, model weights, secrets, or machine-specific configuration are included.
- Apple Silicon Mac (
arm64). - macOS 14 or newer recommended.
- 16 GB unified memory minimum for Qwen3.5 9B.
- 24-32 GB unified memory recommended for Gemma 4 12B plus Qwen3.5 9B.
- About 20 GB free disk space for applications, two quantized models, and caches.
- Administrator access for Homebrew and Docker Desktop installation.
- Internet access during installation.
Docker Desktop 4.40 or newer is required for Docker Model Runner on macOS. Larger context windows consume more unified memory; the installer uses 32K on 24+ GB systems and 16K on smaller systems.
git clone https://github.com/jting2013/AI_Development.git
cd AI_Development
chmod +x install.sh diagnose.sh uninstall.sh
./install.shThe installer is interactive and idempotent. Use ./install.sh --yes to accept installation prompts.
Open a project:
opencode-local ~/Developer/my-projectOr use the terminal interface directly:
cd ~/Developer/my-project
opencode--primary auto|gemma|qwen Choose the default model (default: auto)
--qwen-only Install only the lighter Qwen model
--no-service Do not install the browser-service LaunchAgent
--yes Accept installation prompts
--dry-run Show planned actions without changing the machine
Advanced environment overrides:
CONTEXT_SIZE=16384 KEEP_ALIVE=5m OPENCODE_PORT=4096 ./install.sh./scripts/verify.sh
node scripts/smoke-test.mjs
./scripts/test.shThe smoke test verifies that the selected local model emits a real OpenCode-style tool call. It does not modify a project.
Run:
./diagnose.shThen provide the generated report together with docs/AI_ASSISTANT_GUIDE.md to Claude, ChatGPT, Codex, or another support assistant. The report intentionally excludes prompts, repository contents, environment variables, and authentication files.
- Docker Model Runner's local API is unauthenticated. Keep it bound to localhost and do not expose port
12434to an untrusted network. - The included OpenCode service binds only to
127.0.0.1. - OpenCode can edit files and run commands in the project you open. Review requested permissions and use Git before large changes.
- Documents are treated as source material, not trusted instructions.
- Architecture
- AI assistant support guide
- Troubleshooting
- Docker Model Runner documentation
- OpenCode provider documentation
- OpenCode plugin documentation
MIT