From e66898828cf46b216fb75fe4a091b48f9e0f048d Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 3 Jul 2025 16:03:48 -0700 Subject: [PATCH] is_error_str_rate_limit --- .../litellm_core_utils/exception_mapping_utils.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/litellm/litellm_core_utils/exception_mapping_utils.py b/litellm/litellm_core_utils/exception_mapping_utils.py index 5d1d5c71276..7905cd571b9 100644 --- a/litellm/litellm_core_utils/exception_mapping_utils.py +++ b/litellm/litellm_core_utils/exception_mapping_utils.py @@ -42,8 +42,17 @@ class ExceptionCheckers: """ if not isinstance(error_str, str): return False - - return "429" in error_str or "rate limit" in error_str.lower() + + if "429" in error_str or "rate limit" in error_str.lower(): + return True + + ####################################### + # Mistral API returns this error string + ######################################### + if "service tier capacity exceeded" in error_str.lower(): + return True + + return False @staticmethod def is_error_str_context_window_exceeded(error_str: str) -> bool: