ResponseMetrics

A response's numbers on one line: time to first token, total time, tokens in and out, reasoning, cost. Empty before a response; quiet placeholders hold their place while one streams.

View source
First token
420 ms
Total
3.14 s
Tokens
1,204 → 856
Reasoning
312
Cost
$0.00973
import { ResponseMetrics, formatLatency } from "@logicplanes/kaeso-ui/playground";

Props

  • cost
    string | null

    USD as a decimal string: "0.004213".

  • duration
    number | null

    Milliseconds from sending to the last token.

  • inputTokens
    number | null

    The tokens sent, once known.

  • live
    boolean = false

    A response is arriving: values not known yet show a quiet "—" in the room they will take.

  • outputTokens
    number | null

    The tokens received, once known.

  • reasoning
    boolean

    The model reasons: while live, the reasoning item waits with a placeholder.

  • reasoningTokens
    number | null

    Of the output tokens, those spent reasoning. Shown when given, or when reasoning is set.

  • size
    "md" | "sm" = sm

    The text size.

  • startedAt
    number

    When the request was sent (Date.now()): while live, Total counts up quietly until duration arrives.

  • timeToFirstToken
    number | null

    Milliseconds from sending to the first token.