Skip to content

About

Run a private local LLM with OpenCode and Docker Model Runner on Apple Silicon Macs.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

AI Development

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.

What This Installs

  • OpenCode from Homebrew.
  • Docker Model Runner on 127.0.0.1:12434.
  • ai/gemma4:12b-q4_K_M and/or ai/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.

Requirements

  • 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.

Quick Start

git clone https://github.com/jting2013/AI_Development.git
cd AI_Development
chmod +x install.sh diagnose.sh uninstall.sh
./install.sh

The installer is interactive and idempotent. Use ./install.sh --yes to accept installation prompts.

Open a project:

opencode-local ~/Developer/my-project

Or use the terminal interface directly:

cd ~/Developer/my-project
opencode

Installer Options

--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

Verify

./scripts/verify.sh
node scripts/smoke-test.mjs
./scripts/test.sh

The smoke test verifies that the selected local model emits a real OpenCode-style tool call. It does not modify a project.

Get Help From Claude Or ChatGPT

Run:

./diagnose.sh

Then 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.

Important Security Notes

  • Docker Model Runner's local API is unauthenticated. Keep it bound to localhost and do not expose port 12434 to 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.

Documentation

License

MIT

About

Run a private local LLM with OpenCode and Docker Model Runner on Apple Silicon Macs.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages