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(ui): show a malformed generated_at stamp as-is on the Price Data Reload card
mateo-berri6c1bba54c2c2
diff --git a/ui/litellm-dashboard/src/components/price_data_reload.test.tsx b/ui/litellm-dashboard/src/components/price_data_reload.test.tsxindex a85211f498c..fde69675b72 100644--- a/ui/litellm-dashboard/src/components/price_data_reload.test.tsx+++ b/ui/litellm-dashboard/src/components/price_data_reload.test.tsx@@ -75,6 +75,19 @@ describe("PriceDataReload", () => {expect(screen.getByText(new Date(provenance.loaded_at).toLocaleString())).toBeInTheDocument();});+ it("shows a malformed generated_at stamp as-is instead of Invalid Date", async () => {+ vi.mocked(getModelCostMapSource).mockResolvedValue({+ ...remoteSource,+ ...provenance,+ generated_at: "yesterday-ish",+ } as never);+ render(<PriceDataReload accessToken="sk-test" />);++ expect(await screen.findByText("Generated at:")).toBeInTheDocument();+ expect(screen.getByText("yesterday-ish")).toBeInTheDocument();+ expect(screen.queryByText("Invalid Date")).not.toBeInTheDocument();+ });+it("hides the provenance rows when the loaded map carries no stamp", async () => {render(<PriceDataReload accessToken="sk-test" />);diff --git a/ui/litellm-dashboard/src/components/price_data_reload.tsx b/ui/litellm-dashboard/src/components/price_data_reload.tsxindex 3bb70072937..c152916f271 100644--- a/ui/litellm-dashboard/src/components/price_data_reload.tsx+++ b/ui/litellm-dashboard/src/components/price_data_reload.tsx@@ -99,11 +99,8 @@ const isValidReloadInterval = (value: number) => {const formatDateTime = (dateTimeString: string | null) => {if (!dateTimeString) return "Never";- try {- return new Date(dateTimeString).toLocaleString();- } catch {- return dateTimeString;- }+ const parsed = new Date(dateTimeString);+ return Number.isNaN(parsed.getTime()) ? dateTimeString : parsed.toLocaleString();};const CostMapProvenanceRows: React.FC<{ sourceInfo: CostMapSourceInfo }> = ({ sourceInfo }) => (