Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

feat(ui): add time to first token to observation detail view (#878)

Max Deichmann0862370ad676
diff --git a/src/components/trace/ObservationPreview.tsx b/src/components/trace/ObservationPreview.tsx
index 0f61451c08..3ff2adb8b3 100644
--- a/src/components/trace/ObservationPreview.tsx
+++ b/src/components/trace/ObservationPreview.tsx
@@ -61,8 +61,19 @@ export const ObservationPreview = (props: {
projectId={preloadedObservation.projectId}
/>
) : undefined}
+ {preloadedObservation.completionStartTime ? (
+ <Badge variant="outline">
+ Time to first token:{" "}
+ {formatInterval(
+ (preloadedObservation.completionStartTime.getTime() -
+ preloadedObservation.startTime.getTime()) /
+ 1000,
+ )}
+ </Badge>
+ ) : null}
{preloadedObservation.endTime ? (
<Badge variant="outline">
+ Latency:{" "}
{formatInterval(
(preloadedObservation.endTime.getTime() -
preloadedObservation.startTime.getTime()) /