--- title: OpenCode Cluster created: 2026-04-28 updated: 2026-04-28 type: concept tags: [concept, ai, services] sources: [../../homelab/docs/opencode-cluster.md, ../../ai-assistant/host-context.md] --- # OpenCode Cluster OpenCode AI coding assistant deployed as systemd services across the homelab cluster, accessible via Traefik-routed HTTPS endpoints. ## Instances | Instance | Host | IP | Port | Traefik Route | Status | |----------|------|-----|------|---------------|--------| | ubuntu | Ubuntu VM | 192.168.50.61 | 4096 | opencode.tophermayor.com | Active/Enabled | | ice | Raspberry Pi 4 | 192.168.50.197 | 4096 | opencode-ice.tophermayor.com | Active/Enabled | | grizzley | Raspberry Pi 5 | 192.168.50.84 | 4096 | — | Inactive/Disabled | ## Service Management All instances run as `opencode-web.service` via systemd: ```bash # Check status systemctl status opencode-web # Restart sudo systemctl restart opencode-web # View logs journalctl -u opencode-web -f ``` ## Shared Infrastructure - **Qdrant** (192.168.50.61:6333) — Shared vector memory backend for OpenCode cluster - **Ollama** (192.168.50.61:11434) — Local embedding generation ## Configuration Per-host config files in `homelab//opencode/`: - `opencode.json` — Main OpenCode configuration - `oh-my-opencode.json` — Framework configuration ## Traefik Routing OpenCode instances use dedicated Traefik middlewares: - `local-only@file` — IP whitelist - `opencode-streaming@file` — SSE support - `opencode-cors@file` — CORS headers ## Agent Context Detection Each OpenCode instance detects its host context via: - `.opencode/opencode.json` init file - Environment variables (`HOST_CONTEXT`, `WIKI_PATH`) - `detect_host_context.py` script See [[host-context-detection]] for full detection table. ## Wiki Integration All OpenCode instances have `WIKI_PATH=/home/bear/homelabagentroot/obsidian-vault` in their environment, enabling them to read and write to the shared wiki. ## Related - [[ice]] — RPi4 control plane running OpenCode - [[ubuntu]] — Primary host running OpenCode - [[host-context-detection]] — Per-host agent detection - [[vm-storage-policy]] — AI assistant workflows