From 230c85313b9a424652041f51263bf53b0c78664b Mon Sep 17 00:00:00 2001 From: Harshit28j Date: Wed, 11 Mar 2026 15:10:53 +0530 Subject: [PATCH] Fix dry-run HTTPException guard and VantageLogger instance detection - Add missing except HTTPException: raise in vantage_dry_run_export (consistent with all other endpoints in the file) - Fix is_vantage_setup_in_config() to detect both the string "vantage" and VantageLogger instances in litellm.callbacks, preventing duplicate logger registration on startup Co-Authored-By: Claude Opus 4.6 --- litellm/proxy/spend_tracking/vantage_endpoints.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/litellm/proxy/spend_tracking/vantage_endpoints.py b/litellm/proxy/spend_tracking/vantage_endpoints.py index e497e42e699..f478ba51604 100644 --- a/litellm/proxy/spend_tracking/vantage_endpoints.py +++ b/litellm/proxy/spend_tracking/vantage_endpoints.py @@ -276,10 +276,13 @@ async def is_vantage_setup_in_db() -> bool: def is_vantage_setup_in_config() -> bool: - """Check if Vantage is setup in config.yaml or environment variables.""" - import litellm + """Check if Vantage is setup in config.yaml, environment variables, or programmatically.""" + from litellm.integrations.vantage.vantage_logger import VantageLogger - return "vantage" in litellm.callbacks + for cb in litellm.callbacks: + if cb == "vantage" or isinstance(cb, VantageLogger): + return True + return False async def is_vantage_setup() -> bool: @@ -412,6 +415,8 @@ async def vantage_dry_run_export( summary=summary, ) + except HTTPException: + raise except Exception as e: verbose_proxy_logger.error( f"Error performing Vantage dry run export: {str(e)}"