Model Providers and Local Models
Harry
· 13 Sep 2026
· 2 views
Bring Your Own Key
OpenCode works with most major providers. Add a key for Anthropic, OpenAI or Google, and the agent uses that provider's models for its work.
Using Local Models
OpenCode supports OpenAI-compatible local servers. Tools like Ollama and LM Studio serve local models on your machine, and OpenCode can point at them instead of the cloud.
ollama serve # start Ollama on localhost:11434Configure the provider in the OpenCode config file, then select your local model in the session model picker.
Mixing Providers
You can use a strong cloud model for reasoning and a fast local model for simple edits, switching per session.
Key Points
- Connect any provider key to get started.
- Local models run entirely on your machine.
- Ollama and LM Studio expose OpenAI-compatible servers.
- Mix cloud and local models per session.