From 5264a3eb53eb441e5f56d9b4b388b655021d8d33 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Thu, 25 Jan 2024 11:58:55 -0800 Subject: [PATCH] (fix) do nothing if alerting is not switched on --- litellm/proxy/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.py index 4c6030e5bc9..12605cf4001 100644 --- a/litellm/proxy/utils.py +++ b/litellm/proxy/utils.py @@ -188,6 +188,10 @@ class ProxyLogging: user_current_spend: float, user_info=None, ): + if self.alerting is None: + # do nothing if alerting is not switched on + return + if type == "user_and_proxy_budget": user_info = dict(user_info) user_id = user_info["user_id"]