fix(ollama): add missing api field to auto-discovered models

Auto-discovered Ollama models from discoverOllamaModels() were missing
the `api` field, causing "Unhandled API in mapOptionsForApi: undefined"
errors when the model was used at runtime.

This adds `api: "openai-completions"` to match the provider-level
configuration in buildOllamaProvider().

Fixes #3153
This commit is contained in:
nesnewsnad 2026-01-28 11:23:04 -05:00
parent 01e0d3a320
commit e508d925b1

View File

@ -120,6 +120,7 @@ async function discoverOllamaModels(): Promise<ModelDefinitionConfig[]> {
cost: OLLAMA_DEFAULT_COST,
contextWindow: OLLAMA_DEFAULT_CONTEXT_WINDOW,
maxTokens: OLLAMA_DEFAULT_MAX_TOKENS,
api: "openai-completions",
};
});
} catch (error) {