This commit is contained in:
Shiva Nagendra Babu Kore 2026-01-29 13:55:48 -05:00 committed by GitHub
commit 1f898d7dda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -269,6 +269,15 @@ export function resolveEnvApiKey(provider: string): EnvApiKeyResult | null {
return pick("QWEN_OAUTH_TOKEN") ?? pick("QWEN_PORTAL_API_KEY"); return pick("QWEN_OAUTH_TOKEN") ?? pick("QWEN_PORTAL_API_KEY");
} }
// Ollama doesn't require an API key for local instances
if (normalized === "ollama") {
// If user provided OLLAMA_API_KEY (e.g. for remote/proxy), allow it
const explicit = pick("OLLAMA_API_KEY");
if (explicit) return explicit;
// Otherwise return a dummy key to bypass the "No API key found" check
return { apiKey: "ollama-local", source: "ollama-default" };
}
const envMap: Record<string, string> = { const envMap: Record<string, string> = {
openai: "OPENAI_API_KEY", openai: "OPENAI_API_KEY",
google: "GEMINI_API_KEY", google: "GEMINI_API_KEY",