Default LiteLLM base for explicit provider selection

This commit is contained in:
alfonso gonzalez 2026-03-02 10:31:38 -08:00
parent e7d6d532f1
commit 69f581f54b
No known key found for this signature in database
2 changed files with 12 additions and 0 deletions

View file

@ -107,6 +107,9 @@ func resolveProviderSelection(cfg *config.Config) (providerSelection, error) {
sel.apiKey = cfg.Providers.LiteLLM.APIKey
sel.apiBase = cfg.Providers.LiteLLM.APIBase
sel.proxy = cfg.Providers.LiteLLM.Proxy
if sel.apiBase == "" {
sel.apiBase = "http://localhost:4000/v1"
}
}
case "zhipu", "glm":
if cfg.Providers.Zhipu.APIKey != "" {

View file

@ -29,6 +29,15 @@ func TestResolveProviderSelection(t *testing.T) {
wantAPIBase: "http://localhost:4000/v1",
wantProxy: "http://127.0.0.1:7890",
},
{
name: "explicit litellm provider defaults base when only key is configured",
setup: func(cfg *config.Config) {
cfg.Agents.Defaults.Provider = "litellm"
cfg.Providers.LiteLLM.APIKey = "litellm-key"
},
wantType: providerTypeHTTPCompat,
wantAPIBase: "http://localhost:4000/v1",
},
{
name: "explicit claude-cli provider routes to cli provider type",
setup: func(cfg *config.Config) {