fix(router.py): move deployment cooldown list message to error log, not client-side

don't show user all deployments
This commit is contained in:
Krrish Dholakia 2024-08-03 12:49:39 -07:00
parent a69e3edabb
commit 934883999a

View file

@ -2496,17 +2496,18 @@ class Router:
raise e raise e
except Exception as new_exception: except Exception as new_exception:
verbose_router_logger.error( verbose_router_logger.error(
"litellm.router.py::async_function_with_fallbacks() - Error occurred while trying to do fallbacks - {}\n{}".format( "litellm.router.py::async_function_with_fallbacks() - Error occurred while trying to do fallbacks - {}\n{}\n\nDebug Information:\nCooldown Deployments={}".format(
str(new_exception), traceback.format_exc() str(new_exception),
traceback.format_exc(),
await self._async_get_cooldown_deployments_with_debug_info(),
) )
) )
if hasattr(original_exception, "message"): if hasattr(original_exception, "message"):
# add the available fallbacks to the exception # add the available fallbacks to the exception
original_exception.message += "\nReceived Model Group={}\nAvailable Model Group Fallbacks={}\nCooldown Deployments={}".format( original_exception.message += "\nReceived Model Group={}\nAvailable Model Group Fallbacks={}".format(
model_group, model_group,
fallback_model_group, fallback_model_group,
await self._async_get_cooldown_deployments_with_debug_info(),
) )
raise original_exception raise original_exception