Allow vllm provider to work without API key

Skip the API key requirement check when using the vllm provider,
enabling use of OpenAI-compatible endpoints that don't require
authentication (e.g. opencode.ai/zen free models).
This commit is contained in:
Loule | Louis 2026-02-20 22:19:20 +00:00
parent e883e14b81
commit 56c0bc98e8

View file

@ -295,7 +295,7 @@ func resolveProviderSelection(cfg *config.Config) (providerSelection, error) {
}
if sel.providerType == providerTypeHTTPCompat {
if sel.apiKey == "" && !strings.HasPrefix(model, "bedrock/") {
if sel.apiKey == "" && !strings.HasPrefix(model, "bedrock/") && providerName != "vllm" {
return providerSelection{}, fmt.Errorf("no API key configured for provider (model: %s)", model)
}
if sel.apiBase == "" {