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:
Louis Lefebvre 2026-02-20 22:04:32 +00:00
parent e883e14b81
commit ba71e79abd

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 == "" {