diff --git a/litellm/constants.py b/litellm/constants.py index c092290617d..03ada854764 100644 --- a/litellm/constants.py +++ b/litellm/constants.py @@ -140,6 +140,9 @@ MCP_OAUTH2_TOKEN_CACHE_MIN_TTL = int(os.getenv("MCP_OAUTH2_TOKEN_CACHE_MIN_TTL", LITELLM_UI_ALLOW_HEADERS = [ "x-litellm-semantic-filter", "x-litellm-semantic-filter-tools", + "x-litellm-overhead-duration-ms", + "x-litellm-response-duration-ms", + "x-litellm-callback-duration-ms", ] # Gemini model-specific minimal thinking budget constants diff --git a/ui/litellm-dashboard/src/components/PerformanceDashboard/PerformanceDashboardView.tsx b/ui/litellm-dashboard/src/components/PerformanceDashboard/PerformanceDashboardView.tsx index 11d9e29d85d..9823661f195 100644 --- a/ui/litellm-dashboard/src/components/PerformanceDashboard/PerformanceDashboardView.tsx +++ b/ui/litellm-dashboard/src/components/PerformanceDashboard/PerformanceDashboardView.tsx @@ -59,9 +59,10 @@ async function runTestRequest(accessToken: string, model: string, messages: { ro const captured: Record = {}; resp.headers.forEach((v, k) => { if (k.startsWith("x-litellm")) captured[k] = v; }); const overheadRaw = resp.headers.get("x-litellm-overhead-duration-ms"); + const overheadParsed = overheadRaw && overheadRaw !== "None" ? parseFloat(overheadRaw) : NaN; return { status: resp.status, - overheadMs: overheadRaw ? Math.round(parseFloat(overheadRaw)) : null, + overheadMs: isNaN(overheadParsed) ? null : Math.round(overheadParsed), wallMs, model, responseText, @@ -410,14 +411,39 @@ export default function PerformanceDashboardView() { {testResult && ( <> {/* Status bar */} -
- - {testResult.status === 200 ? "200 OK" : `${testResult.status} Error`} - - · - {testResult.wallMs}ms - · - {testResult.model} +
+
+ + {testResult.status === 200 ? "200 OK" : `${testResult.status} Error`} + +
+
+ Total + {testResult.wallMs}ms +
+
20 ? "bg-orange-50" : "bg-white"}`}> + LiteLLM Overhead + {testResult.overheadMs !== null ? ( + 20 ? "text-orange-500" : "text-gray-800"}`}> + {testResult.overheadMs}ms + + ) : ( + + not available ⚠ + + )} +
+ {overheadPctTest !== null && testResult.overheadMs !== null && ( +
20 ? "bg-orange-50" : "bg-white"}`}> + Overhead % + 20 ? "text-orange-500" : "text-green-600"}`}> + {overheadPctTest}% + +
+ )} +
+ {testResult.model} +
{/* OTEL-style trace waterfall */}