The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Fix dry-run summary alignment, token logging, and upload error handling
Harshit28j9200b2807899
diff --git a/litellm/integrations/focus/destinations/vantage_destination.py b/litellm/integrations/focus/destinations/vantage_destination.pyindex 0e06c8f4413..8275c0690bf 100644--- a/litellm/integrations/focus/destinations/vantage_destination.py+++ b/litellm/integrations/focus/destinations/vantage_destination.py@@ -88,7 +88,15 @@ class FocusVantageDestination(FocusDestination):headers=headers,files={"file": (filename, csv_bytes, "text/csv")},)- response.raise_for_status()+ try:+ response.raise_for_status()+ except httpx.HTTPStatusError as e:+ verbose_logger.error(+ "Vantage destination: upload failed for %s — %s",+ filename,+ e,+ )+ raiseverbose_logger.debug("Vantage destination: uploaded %d bytes (%s)",diff --git a/litellm/integrations/vantage/vantage_logger.py b/litellm/integrations/vantage/vantage_logger.pyindex df51bb72866..5dbcce8c33d 100644--- a/litellm/integrations/vantage/vantage_logger.py+++ b/litellm/integrations/vantage/vantage_logger.py@@ -83,7 +83,7 @@ class VantageLogger(FocusLogger):verbose_logger.debug("VantageLogger initialized (integration_token=%s)",- resolved_token[:8] + "..." if resolved_token else "None",+ resolved_token[:4] + "***" if resolved_token and len(resolved_token) > 4 else "***",)@staticmethoddiff --git a/litellm/proxy/spend_tracking/vantage_endpoints.py b/litellm/proxy/spend_tracking/vantage_endpoints.pyindex cd78cf7ebd9..4a11bb0e9d6 100644--- a/litellm/proxy/spend_tracking/vantage_endpoints.py+++ b/litellm/proxy/spend_tracking/vantage_endpoints.py@@ -392,13 +392,14 @@ async def vantage_dry_run_export(usage_sample = data.head(min(50, len(data))).to_dicts() if not data.is_empty() else []normalized_sample = normalized.head(min(50, len(normalized))).to_dicts() if not normalized.is_empty() else []- # Compute summary from the FOCUS-normalized DataFrame.- # These use post-transform column names specific to this endpoint.+ # Use the same pre-transform column names as+ # FocusExportEngine.dry_run_export_usage_data for consistency.summary = {"total_records": len(normalized),- "total_spend": FocusExportEngine._sum_column(normalized, "BilledCost"),- "unique_teams": FocusExportEngine._count_unique(normalized, "SubAccountId"),- "unique_models": FocusExportEngine._count_unique(normalized, "ResourceType"),+ "total_spend": FocusExportEngine._sum_column(data, "spend"),+ "total_tokens": FocusExportEngine._sum_column(data, "total_tokens"),+ "unique_teams": FocusExportEngine._count_unique(data, "team_id"),+ "unique_models": FocusExportEngine._count_unique(data, "model"),}dry_run_result = {