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 <noreply@anthropic.com>
This commit is contained in:
Harshit28j 2026-03-11 15:10:53 +05:30
parent 622d5dabba
commit 230c85313b

View file

@ -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)}"