From 9352b1d395f4f4cafc1dbeef440095ff52cfe894 Mon Sep 17 00:00:00 2001 From: "Ethan T." Date: Fri, 13 Mar 2026 13:29:22 +0800 Subject: [PATCH] fix: strip provider prefix from model name in Ollama health check Update model_params["model"] after get_llm_provider() strips the provider prefix. This ensures health check calls to Ollama use bare model names (e.g. "llama2") instead of prefixed names (e.g. "ollama/llama2"). Fixes BerriAI/litellm#17842 --- litellm/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/litellm/main.py b/litellm/main.py index f2ce894ba38..6cf8a39faf5 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -7155,6 +7155,7 @@ async def ahealth_check( api_base=api_base_from_params, api_key=api_key_from_params, ) + model_params["model"] = model # update model to use the provider-stripped name (e.g. "ollama/llama2" -> "llama2") if model in litellm.model_cost and mode is None: mode = litellm.model_cost[model].get("mode")