@monroewilliams/opencode-local
v0.1.1
Published
OpenCode plugin for local inference endpoint management with model load/unload
Readme
opencode-local
OpenCode plugin for local inference endpoint management. Port of pi-local.
Features
- Register local inference servers (oMLX, LM Studio, OpenAI-compatible)
- Discover and cache available models across connections
- Load/unload models via TUI dialogs with real-time state refresh
- Cached models appear in
/modelwithout network access - macOS keychain storage for API keys (opt-in)
Configuration
Connections are stored in ~/.config/opencode/opencode-local-connections.json.
API keys support three formats:
- Direct key:
sk-1234567890abcdef(stored in config or macOS keychain) - Environment variable:
$MY_API_KEY - Command substitution:
!security find-generic-password ...
Commands
/local-endpoints
Manage local inference endpoints:
- Add — prompts for base URL and optional API key. On macOS, offers to store direct keys in the system keychain.
- Remove — deletes a configured endpoint
/local-model
Browse and manage models from configured endpoints:
- List — shows available models with size, context window, type, and reasoning info
- Load model —
→(right arrow) to load selected model - Unload model —
←(left arrow) to unload selected model - Filter — type to search models by name
Models are loaded/unloaded via the endpoint's API. After loading, select the model from /model to use it.
Installation
Via npm package:
opencode plugin -g @monroewilliams/opencode-localOr add to ~/.config/opencode/tui.json and opencode.jsonc:
{ "plugins": ["@monroewilliams/opencode-local"] }Limitations
- Active model selection requires
/modelafter loading via/local-model(no plugin API to set the active model directly) - Models in
/modelreflect the cache built at startup or last live query
