Skip to content

feat: show token throughput metrics#9773

Draft
Githubguy132010 wants to merge 3 commits intoKilo-Org:mainfrom
Githubguy132010:feat/token-throughput-metrics
Draft

feat: show token throughput metrics#9773
Githubguy132010 wants to merge 3 commits intoKilo-Org:mainfrom
Githubguy132010:feat/token-throughput-metrics

Conversation

@Githubguy132010
Copy link
Copy Markdown
Contributor

@Githubguy132010 Githubguy132010 commented May 1, 2026

Context

Add token throughput metrics for #6579 so CLI and VS Code users can compare generation performance across models, prompts, and local-LLM configurations.

Implementation

The backend now records optional per-step metrics on step-finish parts. It computes output throughput from server-side step duration and normalized output/reasoning tokens, and opportunistically preserves provider-reported prompt-processing and generation rates when metadata includes llama.cpp-style fields such as prompt_per_second and predicted_per_second.

The SDK/OpenAPI schema is regenerated so clients can consume the new metrics field. The Kilo CLI sidebar and VS Code expanded task header render compact PP and TG values when those metrics are available, falling back to computed output throughput for TG when provider generation timing is absent.

Screenshots

before after

How to Test

  • Run an assistant response against a provider that returns timing metadata, such as a llama.cpp-compatible OpenAI endpoint.
  • Expand the VS Code conversation header and confirm the token row includes PP <rate> t/s and TG <rate> t/s when rates are available.
  • Open the Kilo CLI sidebar usage panel and confirm token usage includes PP and TG rows when metrics are available.
  • For providers without timing metadata, confirm the UI continues to show normal token usage and only shows computed TG when server-side output throughput is available.

Verification run locally:

  • packages/opencode: bun test ./test/kilocode/session-metrics.test.ts ./test/session/session.test.ts ./test/cli/tui/usage.test.ts
  • packages/opencode: bun run typecheck
  • packages/kilo-vscode: bun test tests/unit/session-utils.test.ts
  • packages/kilo-vscode: bun run typecheck
  • packages/kilo-vscode: bun run lint
  • Repo root: bun run script/check-opencode-annotations.ts
  • Push hook: bun turbo typecheck

Get in Touch

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant