feat: show token throughput metrics#9773
Draft
Githubguy132010 wants to merge 3 commits intoKilo-Org:mainfrom
Draft
feat: show token throughput metrics#9773Githubguy132010 wants to merge 3 commits intoKilo-Org:mainfrom
Githubguy132010 wants to merge 3 commits intoKilo-Org:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-finishparts. 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 asprompt_per_secondandpredicted_per_second.The SDK/OpenAPI schema is regenerated so clients can consume the new
metricsfield. The Kilo CLI sidebar and VS Code expanded task header render compactPPandTGvalues when those metrics are available, falling back to computed output throughput forTGwhen provider generation timing is absent.Screenshots
How to Test
PP <rate> t/sandTG <rate> t/swhen rates are available.PPandTGrows when metrics are available.TGwhen 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.tspackages/opencode:bun run typecheckpackages/kilo-vscode:bun test tests/unit/session-utils.test.tspackages/kilo-vscode:bun run typecheckpackages/kilo-vscode:bun run lintbun run script/check-opencode-annotations.tsbun turbo typecheckGet in Touch
N/A