feat(models): add Ollama to model resolution and status
- Add OLLAMA_API_KEY to env key resolution map - Skip model picker for Ollama (uses auto-discovered models) - Include Ollama in status command env probe providers
This commit is contained in:
parent
1ee0e79618
commit
48b5d4c857
@ -275,6 +275,7 @@ export function resolveEnvApiKey(provider: string): EnvApiKeyResult | null {
|
|||||||
groq: "GROQ_API_KEY",
|
groq: "GROQ_API_KEY",
|
||||||
deepgram: "DEEPGRAM_API_KEY",
|
deepgram: "DEEPGRAM_API_KEY",
|
||||||
cerebras: "CEREBRAS_API_KEY",
|
cerebras: "CEREBRAS_API_KEY",
|
||||||
|
ollama: "OLLAMA_API_KEY",
|
||||||
xai: "XAI_API_KEY",
|
xai: "XAI_API_KEY",
|
||||||
openrouter: "OPENROUTER_API_KEY",
|
openrouter: "OPENROUTER_API_KEY",
|
||||||
"vercel-ai-gateway": "AI_GATEWAY_API_KEY",
|
"vercel-ai-gateway": "AI_GATEWAY_API_KEY",
|
||||||
|
|||||||
@ -145,6 +145,14 @@ export async function promptDefaultModel(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const hasPreferredProvider = preferredProvider ? providers.includes(preferredProvider) : false;
|
const hasPreferredProvider = preferredProvider ? providers.includes(preferredProvider) : false;
|
||||||
|
|
||||||
|
// If preferredProvider is specified but not in catalog, skip the picker.
|
||||||
|
// This handles auto-discovering providers (e.g., Ollama) where models aren't
|
||||||
|
// in the static catalog but were already configured by the auth handler.
|
||||||
|
if (preferredProvider && !hasPreferredProvider) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
const shouldPromptProvider =
|
const shouldPromptProvider =
|
||||||
!hasPreferredProvider && providers.length > 1 && models.length > PROVIDER_FILTER_THRESHOLD;
|
!hasPreferredProvider && providers.length > 1 && models.length > PROVIDER_FILTER_THRESHOLD;
|
||||||
if (shouldPromptProvider) {
|
if (shouldPromptProvider) {
|
||||||
|
|||||||
@ -131,6 +131,7 @@ export async function modelsStatusCommand(
|
|||||||
"cerebras",
|
"cerebras",
|
||||||
"xai",
|
"xai",
|
||||||
"openrouter",
|
"openrouter",
|
||||||
|
"ollama",
|
||||||
"zai",
|
"zai",
|
||||||
"mistral",
|
"mistral",
|
||||||
"synthetic",
|
"synthetic",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user