Local models in OpenCode
Use models served by your local Sockless LLM Router as OpenCode models. Point this plugin at the router's API endpoint and every configured preset shows up automatically — no manual per-model configuration. It's the Copilot provider's sibling for the OpenCode terminal agent.
How model discovery works
The router speaks a standard OpenAI-compatible /v1/chat/completions API, so the plugin registers it as an @ai-sdk/openai-compatible provider for chat traffic. Zero-config discovery comes from the router's GET /v1/models/capabilities endpoint, which reports per-preset context length, max output tokens, and tool / vision / reasoning support — mapped straight onto OpenCode's model list.
Three plugin hooks work together: config populates the provider the moment opencode.json loads, auth is the interactive opencode auth login path, and provider.models refreshes the list on demand.
Install
Add opencode-sockless-llm-router to the plugin list in your opencode.json, or install it globally with opencode plugin --global opencode-sockless-llm-router.
Configure
Set it up whichever way fits — a saved connection from opencode auth login, an options.baseURL in opencode.json, or environment variables:
export SOCKLESS_LLM_ROUTER_BASE_URL="http://localhost:5054"
export SOCKLESS_LLM_ROUTER_API_KEY="..." # optionalRequirements
A running Sockless LLM Router instance with at least one server preset configured, and OpenCode with plugin support (@opencode-ai/plugin v1.18+).