An LLM plugin for OpenCode Go subscription models.
Since the plugin is not yet on PyPI, install it directly from GitHub using uv tool install:
uv tool install llm --with "llm-opencode @ git+https://github.com/brendonmackenzie/llm-opencode.git"If you already have llm installed with other plugins, add it to the existing install. For example:
uv tool install llm \
--with "llm-opencode @ git+https://github.com/brendonmackenzie/llm-opencode.git" \
--with llm-git --with llm-openrouter \
--with llm-plugin-generator --with llm-uv-tool \
--with toml --reinstallTo install from a local checkout during development:
uv tool install llm --with /path/to/llm-opencode --reinstallSet your OpenCode Go API key:
llm keys set opencodePaste your key when prompted. You can get an API key from the OpenCode console.
Alternatively, set the OPENCODE_KEY environment variable.
List available models:
llm opencode modelsList all models registered with LLM:
llm models | grep opencode-goRun a prompt with an OpenAI-protocol model:
llm -m opencode-go/deepseek-v4-flash "Explain quantum computing in one paragraph"Run a prompt with an Anthropic-protocol model:
llm -m opencode-go/minimax-m3 "Write a haiku about programming"Start an interactive chat:
llm chat -m opencode-go/glm-5.1The model list is fetched dynamically from the OpenCode Go API. Run llm opencode models for the current list.
Available models broadly fall into two protocol groups:
| Protocol | Models |
|---|---|
| OpenAI | DeepSeek, GLM, Kimi K2.5/2.6, MiMo V2/V2.5, MiMo Omni |
| Anthropic | MiniMax M2.5/M2.7/M3, Qwen3.5/3.6/3.7 Plus/Max |
Anthropic-protocol models (MiniMax, Qwen) support the following options:
-o max_tokens N— Maximum number of tokens to generate (default: 4096)-o temperature F— Temperature for sampling (0.0–1.0)
Example:
llm -m opencode-go/minimax-m3 -o max_tokens 100 -o temperature 0.7 "Hello"Set up a local development environment with uv:
cd llm-opencode
uv venv
uv pip install -e '.[test]'Run tests with coverage:
uv run pytest --cov=.Reinstall the plugin into the llm tool after changes:
uv tool install llm --with /path/to/llm-opencode --reinstall