Skip to content

[Feature] Per-turn duration, token usage, and prompt-cache miss notices #392

Open

Description

@sm23444

Request

Please add per-turn execution statistics, prompt-cache diagnostics, and inline generation metrics beside assistant responses.

The goal is to make turn duration, token usage, and generation speed visible without opening a separate details panel.

Suggested UI

1. Total turn duration

Extend the collapsed Process details summary with the total elapsed time for the turn, for example:

“4 messages · 5 tool calls · 1m 12s”

This should represent the full elapsed time from submitting a message until the turn finishes, including waiting, model requests, and tool execution.

2. Per-turn token usage

Show the following totals for each turn:

  • Uncached input tokens
  • Output tokens
  • Cache-read tokens

A turn may contain multiple model requests because of tool calls. These totals should include all model requests in that turn, not only the final assistant response.

Please use the provider-reported usage data, accounting for whether its input-token total includes cached tokens, so cached input is not counted twice. Missing usage data should be shown as unavailable rather than zero.

3. Prompt-cache diagnostics

When there is reliable evidence of a significant, unexpected loss of a previously cached prompt prefix, show a notice with the affected token count when available.

For example:

“Possible prompt-cache loss: approximately 283k input tokens were processed without a cache hit.”

Please distinguish between:

  • A normal first request with no existing cached prefix
  • Ordinary uncached input, such as newly added content
  • An unexpected loss of a previously cached prefix
  • Missing or unsupported cache-usage reporting

A large uncached-input count alone should not be treated as proof of unexpected cache loss. If the available data cannot establish this reliably, show the uncached input usage without presenting it as a confirmed cache-loss event.

4. A setting for cache notices

Add a setting to enable or disable prompt-cache notices.

Disabling these notices should not hide the underlying token-usage statistics.

5. Inline generation metrics

Show generation metrics directly beside each assistant response:

  • Model name
  • Output token count
  • Live generation speed while streaming, for example “43.6 t/s”
  • Final average generation speed after completion

Please keep generation speed separate from total turn duration. Generation speed describes model output generation; total turn duration also includes waiting, tool execution, and potentially multiple model requests.

Please make the timing basis clear and avoid including tool execution in the generation-speed calculation. If live token counts are unavailable, label estimates as estimated or show the metric as unavailable.

I understand ompweb already exposes generation speed in the context details panel. This request is to make it visible directly beside each response, without opening that panel.

Why

I use ompweb through a custom API gateway. These statistics would help me understand slow turns, repeated tool calls, and unexpectedly high input costs without checking gateway logs.

Separating total turn duration from generation speed would also help distinguish time spent generating output from time spent waiting or executing tools.

Scope

This request is for visibility and diagnostics only.

It should not enable cache warming, send additional model requests, or change the existing prompt-caching behavior. Cache diagnostics should rely on usage data and execution information already available to ompweb.

Environment

  • ompweb: 0.6.0
  • OMP: 18.16.0
  • OS: Windows 10
  • API: OpenAI Responses through a custom gateway

Activity

  1. added
    enhancement
    on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions