From e9d6137ef3ca505225452fd2969e1f3c4268b1d8 Mon Sep 17 00:00:00 2001 From: tombii Date: Tue, 3 Mar 2026 15:15:08 +0100 Subject: [PATCH] fix(ollama): make session usage limit check case-insensitive Apply code review suggestion: use error_str.lower() for both checks for consistent case handling. Co-Authored-By: Claude Sonnet 4.6 --- litellm/litellm_core_utils/exception_mapping_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/litellm_core_utils/exception_mapping_utils.py b/litellm/litellm_core_utils/exception_mapping_utils.py index 6d546c69f1b..dac09d34cc0 100644 --- a/litellm/litellm_core_utils/exception_mapping_utils.py +++ b/litellm/litellm_core_utils/exception_mapping_utils.py @@ -2040,7 +2040,7 @@ def exception_type( # type: ignore # noqa: PLR0915 llm_provider="ollama", model=model, ) - elif "session usage limit" in error_str or "rate limit" in error_str.lower(): + elif "session usage limit" in error_str.lower() or "rate limit" in error_str.lower(): exception_mapping_worked = True raise RateLimitError( message=f"OllamaException: {original_exception}",