closest i found was #629 but i dont understand the solution of using openauth though.
my use case is that i can only add one custom provider in opencode.json
{
"provider": {
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "http://localhost:11434/v1"
},
"models": {...}
}
}
}
sometimes i test out with other custom providers (local or hosted). is the only solution to overwrite the ollama provider config? what i was hoping for was something like
{
"providers": {
"ollama": {...},
"other": {...}
}
}
i did try opencode auth login and selecting other and naming it but all i got was this message afterwards, not sure where it even wrote the auth key to (i checked ~/.config/opencode/ but nothing was there and no change to the config json).
opencode auth login
┌ Add credential
│
◇ Select provider
│ Other
│
◇ Enter provider id
│ llama-cpp
│
▲ This only stores a credential for llama-cpp - you will need configure it in opencode.json, check the docs for examples.
│
◇ Enter your API key
│ ▪
│
└ Done
seems like the TUI can already support this since it separates the providers in /models. let me know if I’m thinking about this the wrong way.
closest i found was #629 but i dont understand the solution of using
openauththough.my use case is that i can only add one custom provider in
opencode.json{ "provider": { "ollama": { "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "http://localhost:11434/v1" }, "models": {...} } } }sometimes i test out with other custom providers (local or hosted). is the only solution to overwrite the ollama provider config? what i was hoping for was something like
{ "providers": { "ollama": {...}, "other": {...} } }i did try
opencode auth loginand selectingotherand naming it but all i got was this message afterwards, not sure where it even wrote the auth key to (i checked~/.config/opencode/but nothing was there and no change to the config json).seems like the TUI can already support this since it separates the providers in
/models. let me know if I’m thinking about this the wrong way.