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]

Time taken column logs (#11723)

Gustavo Brian22460a73f9ae
diff --git a/ui/litellm-dashboard/src/components/view_logs/columns.tsx b/ui/litellm-dashboard/src/components/view_logs/columns.tsx
index 30bd48f7c7f..af383284e7e 100644
--- a/ui/litellm-dashboard/src/components/view_logs/columns.tsx
+++ b/ui/litellm-dashboard/src/components/view_logs/columns.tsx
@@ -46,6 +46,7 @@ export type LogEntry = {
proxy_server_request?: string | any[] | Record<string, any>;
session_id?: string;
status?: string;
+ duration?: number;
onKeyHashClick?: (keyHash: string) => void;
onSessionClick?: (sessionId: string) => void;
};
@@ -160,6 +161,15 @@ export const columns: ColumnDef<LogEntry>[] = [
<span>${Number(info.getValue() || 0).toFixed(6)}</span>
),
},
+ {
+ header: "Duration",
+ accessorKey: "duration",
+ cell: (info: any) => (
+ <Tooltip title={String(info.getValue() || "-")}>
+ <span className="max-w-[15ch] truncate block">{String(info.getValue() || "-")}</span>
+ </Tooltip>
+ ),
+ },
{
header: "Team Name",
accessorKey: "metadata.user_api_key_team_alias",
diff --git a/ui/litellm-dashboard/src/components/view_logs/index.tsx b/ui/litellm-dashboard/src/components/view_logs/index.tsx
index 295fd755c0d..61e11b7115f 100644
--- a/ui/litellm-dashboard/src/components/view_logs/index.tsx
+++ b/ui/litellm-dashboard/src/components/view_logs/index.tsx
@@ -369,6 +369,7 @@ export default function SpendLogsTable({
}).map(log => ({
...log,
+ duration: (Date.parse(log.endTime) - Date.parse(log.startTime)) / 1000,
onKeyHashClick: (keyHash: string) => setSelectedKeyIdInfoView(keyHash),
onSessionClick: (sessionId: string) => {
if (sessionId) setSelectedSessionId(sessionId);
@@ -931,6 +932,10 @@ export function RequestViewer({ row }: { row: Row<LogEntry> }) {
<span className="font-medium w-1/3">End Time:</span>
<span>{row.original.endTime}</span>
</div>
+ <div className="flex">
+ <span className="font-medium w-1/3">Duration:</span>
+ <span>{row.original.duration} s.</span>
+ </div>
</div>
</div>
</div>