Skip to content

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]

Include time window in export filename to prevent Vantage overwrites

Harshit28j118d8114f8d6
diff --git a/litellm/integrations/focus/export_engine.py b/litellm/integrations/focus/export_engine.py
index 1f51e1bac96..8b77fad9e17 100644
--- a/litellm/integrations/focus/export_engine.py
+++ b/litellm/integrations/focus/export_engine.py
@@ -101,13 +101,17 @@ class FocusExportEngine:
await self._destination.deliver(
content=payload,
time_window=window,
- filename=self._build_filename(),
+ filename=self._build_filename(window),
)
- def _build_filename(self) -> str:
+ def _build_filename(self, window: FocusTimeWindow) -> str:
if not self._serializer.extension:
raise ValueError("Serializer must declare a file extension")
- return f"usage.{self._serializer.extension}"
+ # Include time window in filename so Vantage (which deduplicates
+ # by filename) doesn't overwrite previous uploads.
+ start_str = window.start_time.strftime("%Y%m%dT%H%M%SZ")
+ end_str = window.end_time.strftime("%Y%m%dT%H%M%SZ")
+ return f"usage_{start_str}_{end_str}.{self._serializer.extension}"
@staticmethod
def _sum_column(frame: pl.DataFrame, column: str) -> float: