Make using any model with any provider easier #673

Closed
opened 2026-02-16 17:27:51 -05:00 by yindo · 5 comments
Owner

Originally created by @KTibow on GitHub (Jul 12, 2025).

Originally assigned to: @thdxr on GitHub.

Any model

Right now, opencode curates the models available through models.dev. This is good if you don't know what to use, but it means that you're missing out on dozens of models. Ideally opencode uses the models endpoint (https://api.openai.com/v1/models, https://openrouter.ai/api/v1/models) to load and display all available models, but if not possible, allow manually typing in the model specifier in the /models command.

*fun fact: using the models endpoint makes sure you have the most up to date and accurate data, preventing issues like #926

Any provider

Right now, opencode also curates the providers (to Anthropic, GitHub Copilot, OpenAI, Google, Amazon Bedrock, Azure, DeepSeek, Groq, Llama, Mistral, Morph, OpenRouter, Vercel, Vertex, and xAI). It's a long and admirable list, but it'll never be complete, since new providers and local providers will keep springing up. It should be simple to add a provider: type in a name, OpenAI-compatible API endpoint, and API key, and start using opencode. There is an "other" flow currently, but it requires you to manually edit the JSON while referring to the docs, which takes us to...

Document it

You've just been told to "check the docs for examples" (of how to add an OpenAI-compatible provider) by opencode. You find the config documentation, ctrl+f for "provider", and...

Image

this is the closest thing to documentation on providers. The config documentation has many sections - modes, models, themes, logging, keybinds, MCP servers, and disabled providers - but how to actually configure a provider is not one of them.

Now, if you're Dax, you're probably screaming at me right now. I'm so stupid that I can't follow a clearly marked link to "learn more" about models. And in fact, if you follow that link and specifically look at the "local models" section (although your provider isn't local), you'll find an example!
Image

But this is too hard to find. As long as you're required to edit config to add custom OpenAI-compatible providers, the config page should have a section on providers that clearly indicates how to set up OpenAI-compatible providers.

Why didn't I just make opencode make a PR to solve this

Unfortunately my preferred models don't work - see #929 and #926.

Originally created by @KTibow on GitHub (Jul 12, 2025). Originally assigned to: @thdxr on GitHub. ## Any model Right now, opencode curates the models available through [models.dev](https://github.com/sst/models.dev). This is good if you don't know what to use, but it means that you're missing out on dozens of models. Ideally opencode uses the models endpoint (https://api.openai.com/v1/models, https://openrouter.ai/api/v1/models) to load and display all available models, but if not possible, allow manually typing in the model specifier in the `/models` command. *fun fact: using the models endpoint makes sure you have the most up to date and accurate data, preventing issues like #926 ## Any provider Right now, opencode also curates the providers (to Anthropic, GitHub Copilot, OpenAI, Google, Amazon Bedrock, Azure, DeepSeek, Groq, Llama, Mistral, Morph, OpenRouter, Vercel, Vertex, and xAI). It's a long and admirable list, but it'll never be complete, since new providers and local providers will keep springing up. It should be simple to add a provider: type in a name, OpenAI-compatible API endpoint, and API key, and start using opencode. There is an "other" flow currently, but it requires you to manually edit the JSON while referring to the docs, which takes us to... ## Document it You've just been told to "check the docs for examples" (of how to add an OpenAI-compatible provider) by opencode. You find the [config documentation](https://opencode.ai/docs/config/), ctrl+f for "provider", and... > <img width="1498" height="762" alt="Image" src="https://github.com/user-attachments/assets/250bc317-5b16-4f5b-a4f3-c3f788b71b64" /> this is the closest thing to documentation on providers. The config documentation has many sections - modes, models, themes, logging, keybinds, MCP servers, and disabled providers - but how to actually configure a provider is not one of them. Now, if you're Dax, you're probably screaming at me right now. I'm so stupid that I can't follow a clearly marked link to "learn more" about models. And in fact, if you follow that link and specifically look at the "local models" section (although your provider isn't local), you'll find an example! <img width="1470" height="956" alt="Image" src="https://github.com/user-attachments/assets/d45cd82b-b381-4775-be4c-0cbb9c8d547f" /> But this is too hard to find. As long as you're required to edit config to add custom OpenAI-compatible providers, the config page should have a section on providers that clearly indicates how to set up OpenAI-compatible providers. ## Why didn't I just make opencode make a PR to solve this Unfortunately my preferred models don't work - see #929 and #926.
yindo closed this issue 2026-02-16 17:27:51 -05:00
Author
Owner

@deadcoder0904 commented on GitHub (Jul 14, 2025):

I agree. Just made a similar issue as I was trying this for the first time. Search isn't working well. https://github.com/sst/opencode/issues/976

@deadcoder0904 commented on GitHub (Jul 14, 2025): I agree. Just made a similar issue as I was trying this for the first time. Search isn't working well. https://github.com/sst/opencode/issues/976
Author
Owner

@adstalla commented on GitHub (Jul 18, 2025):

One thing that wasn't clear to me in the local models section was whether the provider key "lmstudio" is meaningful.

Can it be vLLM? Or is there a known set? What about the npm field? Is @ai-sdk/openai-compatible the common value for local models? More directly stating this would be helpful.

@adstalla commented on GitHub (Jul 18, 2025): One thing that wasn't clear to me in the local models section was whether the provider key "lmstudio" is meaningful. Can it be vLLM? Or is there a known set? What about the npm field? Is `@ai-sdk/openai-compatible` the common value for local models? More directly stating this would be helpful.
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Author
Owner

@KTibow commented on GitHub (Dec 27, 2025):

@rekram1-node can you reopen this issue as even though https://github.com/sst/opencode/pull/4569 was merged, /connect doesn't function as claimed: there is no true "other" option

@KTibow commented on GitHub (Dec 27, 2025): @rekram1-node can you reopen this issue as even though https://github.com/sst/opencode/pull/4569 was merged, /connect doesn't function as [claimed](https://opencode.ai/docs/providers#custom-provider): there is no true "other" option
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

We have this issue instead for that:

https://github.com/sst/opencode/issues/5937

@rekram1-node commented on GitHub (Dec 27, 2025): We have this issue instead for that: https://github.com/sst/opencode/issues/5937
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#673