From 8b4c33c3989ae7ae06464c783f0c87d51f63bf62 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Thu, 14 Nov 2024 19:59:45 +0530 Subject: [PATCH] fix(exception_mapping_utils.py): map 'model is overloaded' to internal server error --- litellm/litellm_core_utils/exception_mapping_utils.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/litellm/litellm_core_utils/exception_mapping_utils.py b/litellm/litellm_core_utils/exception_mapping_utils.py index a4a30fc31..ca1de75be 100644 --- a/litellm/litellm_core_utils/exception_mapping_utils.py +++ b/litellm/litellm_core_utils/exception_mapping_utils.py @@ -1124,10 +1124,13 @@ def exception_type( # type: ignore # noqa: PLR0915 ), ), ) - elif "500 Internal Server Error" in error_str: + elif ( + "500 Internal Server Error" in error_str + or "The model is overloaded." in error_str + ): exception_mapping_worked = True - raise ServiceUnavailableError( - message=f"litellm.ServiceUnavailableError: VertexAIException - {error_str}", + raise litellm.InternalServerError( + message=f"litellm.InternalServerError: VertexAIException - {error_str}", model=model, llm_provider="vertex_ai", litellm_debug_info=extra_information,