From da273607226dca3e2b83a0ba9afa40dcb9f7ca78 Mon Sep 17 00:00:00 2001 From: BrokenFinger98 Date: Sun, 8 Feb 2026 21:21:34 +0900 Subject: [PATCH] feat(ollama): switch implicit provider to native api type (#11828) --- src/agents/models-config.providers.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/agents/models-config.providers.ts b/src/agents/models-config.providers.ts index aa6adfd434a..f17f3b8ebdb 100644 --- a/src/agents/models-config.providers.ts +++ b/src/agents/models-config.providers.ts @@ -79,8 +79,8 @@ const QWEN_PORTAL_DEFAULT_COST = { cacheWrite: 0, }; -const OLLAMA_BASE_URL = "http://127.0.0.1:11434/v1"; -const OLLAMA_API_BASE_URL = "http://127.0.0.1:11434"; +const OLLAMA_BASE_URL = "http://127.0.0.1:11434"; +const OLLAMA_API_BASE_URL = OLLAMA_BASE_URL; const OLLAMA_DEFAULT_CONTEXT_WINDOW = 128000; const OLLAMA_DEFAULT_MAX_TOKENS = 8192; const OLLAMA_DEFAULT_COST = { @@ -180,11 +180,6 @@ async function discoverOllamaModels(baseUrl?: string): Promise { async function buildOllamaProvider(configuredBaseUrl?: string): Promise { const models = await discoverOllamaModels(configuredBaseUrl); return { - baseUrl: configuredBaseUrl ?? OLLAMA_BASE_URL, - api: "openai-completions", + baseUrl: resolveOllamaApiBase(configuredBaseUrl), + api: "ollama", models, }; }