From a935514b4d144ed2e6922b0caea7268db5e08b90 Mon Sep 17 00:00:00 2001 From: Pablo Pardo Garcia Date: Tue, 17 Nov 2026 09:29:19 +0100 Subject: [PATCH] fix: map LiteLLM's ollama_chat provider to the registry's ollama The GenAI registry now lists ollama as a well-known gen_ai.provider.name. LiteLLM routes Ollama's chat endpoint as ollama_chat, so that value now maps to ollama, and an ollama_chat/ route drops its prefix like other providers. --- src/rius/normalization.py | 2 ++ tests/test_normalization_openinference.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/rius/normalization.py b/src/rius/normalization.py index 2a6d541..6483f3b 100644 --- a/src/rius/normalization.py +++ b/src/rius/normalization.py @@ -1641,6 +1641,8 @@ def shutdown(self) -> None: "gemini": "gcp.gemini", "az.ai.inference": "azure.ai.inference", "az.ai.openai": "azure.ai.openai", + # LiteLLM's route for Ollama's chat endpoint + "ollama_chat": "ollama", # the registry's own former spellings **PROVIDER_NAME_RENAMES, } diff --git a/tests/test_normalization_openinference.py b/tests/test_normalization_openinference.py index b20de62..36e0f13 100644 --- a/tests/test_normalization_openinference.py +++ b/tests/test_normalization_openinference.py @@ -284,6 +284,8 @@ def test_an_unparseable_token_count_maps_to_nothing() -> None: ("aws", "aws"), ("google", "google"), ("ollama", "ollama"), + # LiteLLM's route for Ollama's chat endpoint + ("ollama_chat", "ollama"), ], ) def test_provider_spellings(source_value: str, expected: str) -> None: @@ -524,6 +526,7 @@ def test_no_provider_without_a_named_ls_provider(metadata: str) -> None: # compared under the registry's spelling ("vertex_ai", "vertex_ai/gemini-2.5-flash", "gemini-2.5-flash"), ("mistralai", "mistral/mistral-small-latest", "mistral-small-latest"), + ("ollama_chat", "ollama_chat/llama3.2", "llama3.2"), # a prefix naming anyone else is part of the name ("openai", "openai/google/gemini-2.5-flash", "google/gemini-2.5-flash"), ("openai", "google/gemini-2.5-flash", "google/gemini-2.5-flash"),