Skip to content

[Bug]: TPS can be misleading when the first effective output arrives late or output is buffered #3672

Closed

Description

@QZQ-go

Summary

The chat TPS indicator can report an implausibly high "Average output" rate when the first effective output event arrives late or the provider buffers output. The numerator is the provider-reported output token count for the whole turn, while the denominator sums only streamDurationMs - firstVisibleOutputMs for each round. That can omit most of the time during which the model generated output.

Reproduction or evidence

Observed on OpenBitFun 1.0.8 (cbe1fb8972b22609fcd2f5d7fc1ac703e18b1d2d) with a Responses-compatible model, across six model calls in one turn:

  • Provider-reported output: 2,479 tokens
  • Sum of stream durations: 93,922 ms
  • Sum of first-effective-output offsets: 92,556 ms
  • Time used by the TPS formula: 1,366 ms
  • Displayed result: 2,479 / 1.366 = 1,814.8 tokens/s
  • Turn wall time: about 104 seconds

The value is reproducible from the saved round timing fields. The 362.4K token badge for this turn is total input plus output (362,396), not the output numerator.

Expected behavior

Please clarify or adjust the metric so it is not presented as model generation speed when the client only measures post-first-event stream receipt. A provider that buffers deltas can make receipt speed differ sharply from decode speed. Consider labeling it as observed post-first-event throughput, or only reporting model TPS when token counts and timing cover the same output scope. If timing or usage breakdown is unavailable, suppress the speed value or mark it approximate.

The Responses usage adapter also currently keeps aggregate output_tokens but does not deserialize output_tokens_details.reasoning_tokens into the unified usage model. If a gateway includes hidden reasoning in aggregate output usage, those tokens can be in the numerator while their generation happens before the first visible event. I could not verify whether the gateway used for this observation returned that breakdown, so I am not claiming the 2,479-token count itself is wrong.

Environment

  • OpenBitFun version/commit: 1.0.8 / cbe1fb8972b22609fcd2f5d7fc1ac703e18b1d2d
  • OS: macOS
  • Model/protocol: gpt-6.1-sol, Responses-compatible gateway

No conversation text, credentials, session identifiers, or raw logs are included.

Activity

  1. self-assigned this
    on Nov 3, 2026
  2. linked a pull request that will close this issuefix: include TTFT in flow chat output speed #3701on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions