Skip to content

[FEATURE]: Real-time token generation speed (tok/s) in TUI status bar, like Hermes #47914

Open

Description

@phpoh

Describe the enhancement you want to request

I want opencode to show real-time token generation speed (tok/s, tokens per second) while a response is streaming, like DeepSeek Hermes agent does.

Hermes shows it directly in the status bar, e.g.:

deepseek-v4-flash | 12.5K/128K | 68% | 3m 42s | 15.2 t/s

Reference implementations:

Proposed behavior in opencode

  1. TUI: live rolling tok/s while streaming (in the status line / session footer), plus final per-response average once complete (next to existing token counts).
  2. Desktop / web: same t/s indicator for parity.
  3. Optional session-wide average (e.g. via /stats or footer) for comparing models/providers.
  4. Config toggle, e.g. display.show_output_speed (default off to avoid clutter), and hide when terminal width is too small.

Why

Alternatives considered

  • Timing requests manually or benchmarking provider APIs directly — does not reflect real usage inside opencode.
  • Only showing total tokens / cost after completion — no sense of live speed.

Activity

  1. github-actions commented on Sep 8, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Consider adding your thoughts and +1 to those issues rather than opening a new one.

  2. differs commented on Sep 9, 2026

    @differs

    Implementation notes from a hands-on attempt (opencode 1.18.29, Linux)

    Third-party code currently has no supported way to render any of this, which is worth capturing in the design:

    1. No config/env toggle exists today for a live tok/s indicator.
    2. @opencode-ai/plugin/tui advertises a slot/statusline host (TuiSlotMap incl. home_footer, session_prompt_right, app_bottom; api.slots.register, api.event.on), but the runtime does not deliver it: an auto-discovered plugin exporting tui is invoked with the server PluginInput and api.slots / api.event are undefined.
    3. The only rendering-ish control available to plugins, client.tui.showToast, neither resolves nor draws when called from a plugin (awaits forever; no toast appears).
    4. Streaming events carry only cumulative part.text (message.part.updated); real tokens.output arrives only on the final message.updated. For an accurate live rate, expose a per-message.part.delta token delta + timestamp (most providers stream usage; opencode currently drops it).

    A minimal stop-gap for headless/scripted use (live ⇣ N tok/s + exact final average, calibrated on provider usage) is oc-meter — source shown in the now-duplicate #48067 and mirrored in the meter described there. Happy to turn it into a PR against whatever statusline surface wins here.

  3. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for the detailed request and the Hermes references!

    You're asking for a live tok/s figure while a response streams, a session-wide average for comparing models and providers, desktop/web parity and a display toggle.

    Part of this is already in v2. The TUI shows each response's average throughput in the assistant message footer (e.g. Build · model · 4.0s · 20.0 tok/s). The session.tps setting turns it on or off, and it is on by default. If you don't see it, update with npm i -g @opencode/cli@latest.

    The live rolling speed in the status line and the session-wide average aren't there yet. Maintainers will consider them.

    Related issues:

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