diff --git a/litellm/proxy/spend_tracking/spend_management_endpoints.py b/litellm/proxy/spend_tracking/spend_management_endpoints.py index 76eaf273628..2201324aef4 100644 --- a/litellm/proxy/spend_tracking/spend_management_endpoints.py +++ b/litellm/proxy/spend_tracking/spend_management_endpoints.py @@ -3,7 +3,6 @@ import collections import json import os from datetime import datetime, timedelta, timezone -from functools import lru_cache from typing import TYPE_CHECKING, Any, Dict, List, Literal, Optional import fastapi diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx index e5c5deaf380..bd30eb9ba8b 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx @@ -85,7 +85,7 @@ export function LogDetailsDrawer({ // Lazy-load log details (messages/response) only when drawer is open // This fetches data for a single log on-demand instead of prefetching all 50 const logDetails = useQuery({ - queryKey: ["logDetails", logEntry?.request_id, startTime], + queryKey: ["logDetails", logEntry?.request_id, startTime, accessToken], queryFn: async () => { if (!accessToken || !logEntry?.request_id || !startTime) return null; return await uiSpendLogDetailsCall(accessToken, logEntry.request_id, startTime); diff --git a/ui/litellm-dashboard/src/components/view_logs/index.tsx b/ui/litellm-dashboard/src/components/view_logs/index.tsx index cc40981fa3c..8389ed5f16c 100644 --- a/ui/litellm-dashboard/src/components/view_logs/index.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/index.tsx @@ -72,7 +72,7 @@ export default function SpendLogsTable({ const quickSelectRef = useRef(null); // New state variables for Start and End Time - const [startTime, setStartTime] = useState(moment().subtract(24, "hours").format("YYYY-MM-DDTHH:mm")); + const [startTime, setStartTime] = useState(moment().subtract(4, "hours").format("YYYY-MM-DDTHH:mm")); const [endTime, setEndTime] = useState(moment().format("YYYY-MM-DDTHH:mm")); const [isCustomDate, setIsCustomDate] = useState(false); @@ -107,7 +107,7 @@ export default function SpendLogsTable({ }, [isLiveTail]); const [selectedTimeInterval, setSelectedTimeInterval] = useState<{ value: number; unit: string }>({ - value: 24, + value: 4, unit: "hours", });