OpenCode separates the coding agent from the AI model
Posted: (EET/GMT+2)
There is no shortage of AI coding agents anymore. Services like GitHub Copilot, Claude Code, OpenAI Codex, Meta Muse can inspect your code repositories, write code, edit files, run commands, execute tests, and work through larger development tasks.
An open-source alternative called OpenCode is another contender in this space, but it has an interesting difference: the coding agent and the AI model do not have to come from the same place (read: vendor).
OpenCode is an open-source AI coding agent that runs on your computer. It is available as a terminal application, desktop application, and editor integration.
To install the current CLI with npm, you can simply run:
npm install -g @opencode/cli
Once installed, you can start the tool inside a project:
cd C:\Code\MyProject opencode
From there, OpenCode can inspect the repository and work with files and development tools much like other modern coding agents.
The interesting part is the model configuration. OpenCode supports many different LLM providers. You can connect it to cloud-hosted models from providers such as OpenAI, Anthropic, and Google, or use locally hosted models.
For example, OpenCode can automatically discover models running through Ollama, LM Studio, and vLLM. A local Ollama model can be selected in the OpenCode configuration:
{
"$schema": "https://opencode.ai/config.json",
"model": "ollama/gemma3:4b"
}
This creates separation on the agent and the model:
Developer
|
v
OpenCode
|
+-- OpenAI
+-- Anthropic
+-- Google
+-- Ollama
+-- LM Studio
+-- vLLM
+-- other providers
You can keep the same coding-agent workflow while experimenting with different models. This is somewhat different from choosing an AI coding product mainly because of the ecosystem around it.
GitHub Copilot, for example, is deeply integrated with GitHub (remember, Microsoft owns GitHub), its pull requests, issues, IDEs, and GitHub's development workflow.
Claude Code is Anthropic's coding-agent experience and is especially closely tied to the Claude ecosystem. Similarly, OpenAI Codex provides OpenAI's coding-agent experience through its CLI, IDE integrations, application, and open agent harness.
OpenCode takes a more provider neutral approach. The agent itself can remain the same even if you change the model underneath it. This does not automatically make OpenCode better, however.
Tight integration between an agent, its models, and the surrounding developer platform can also be a major advantage. Copilot's GitHub integration is a good example. But model independence gives developers another architectural choice.
It is also worth being precise about what "local" means.OpenCode itself can run locally, but that does not necessarily mean the AI processing also happens locally. If you select a cloud model, the context required by the request is sent to that model provider.
OpenCode could be especially interesting if:
- you want to experiment with several coding models
- you want to run some models locally
- you do not want your coding-agent interface tied to one model provider
- you want an open-source agent you can inspect and extend
- you want to keep the same workflow while models change over time.
AI models are changing quickly. The best model for a complicated refactoring today may not be the one you want to use six months from now.
Happy (AI) hacking!