[FEATURE]: Add Tokens-Per-Second (tok/s) Metric to Kilo CLI
Feature hasn't been suggested before.
- [x] I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Summary
Kilo CLI currently does not expose a tokens-per-second (tok/s) performance metric. Latency alone is insufficient for evaluating model performance, especially when comparing different prompts, models, or hardware configurations. You can also add these details to the sidebar within the conversation.
Proposal
Add token-level performance metrics to the CLI output:
- Input tokens
- Output tokens
- Generation time (seconds)
- Tokens per second (output_tokens / generation_time)
Optional: enable via --metrics or --verbose flag to avoid cluttering default output.
Example Output
Latency: 4.21s
Output tokens: 512
Tokens/sec: 121.6
Rationale
Exposing tok/s enables reliable benchmarking, regression testing, hardware comparison, and optimization analysis. This metric is a de facto standard in LLM tooling.
+1 on this. Two extensions to consider while it's being scoped:
Extend to the VSCode top bar, not just CLI. The same numbers belong next to the existing Tokens ↑ 316 ↓ 351 ↓ cache 144.2K line in the VSCode UI — local-LLM users live in that view and currently have to tail llama-server's stdout to see throughput. Something like:
Tokens ↑ 316 ↓ 351 ↓ cache 144.2K PP 412 t/s TG 38 t/s
Split prompt-processing speed from generation speed. llama.cpp returns both as separate fields (prompt_per_second and predicted_per_second in the timings object on each non-streaming response, also surfaced in streaming events with stream_options: { include_usage: true }). They behave very differently — PP is bottlenecked by batch size and KV cache, TG by memory bandwidth — so one combined number hides exactly the information that's useful for tuning quantization, -ngl GPU offload, and batch settings. Two values, label them PP and TG.
For providers that don't return timings (Anthropic, OpenAI, Gemini), the row hides — no new config needed, opportunistic detection on the timings field. Bonus if it lands: a session-level rolling average on hover, since power users comparing quants want medians over a turn or two, not just the last value.
Happy to test on Windows + a couple of common llama.cpp builds when there's something to try.
+1 on this. Two extensions to consider while it's being scoped:
Extend to the VSCode top bar, not just CLI. The same numbers belong next to the existing Tokens ↑ 316 ↓ 351 ↓ cache 144.2K line in the VSCode UI — local-LLM users live in that view and currently have to tail llama-server's stdout to see throughput. Something like:
Tokens ↑ 316 ↓ 351 ↓ cache 144.2K PP 412 t/s TG 38 t/s
Split prompt-processing speed from generation speed. llama.cpp returns both as separate fields (prompt_per_second and predicted_per_second in the timings object on each non-streaming response, also surfaced in streaming events with stream_options: { include_usage: true }). They behave very differently — PP is bottlenecked by batch size and KV cache, TG by memory bandwidth — so one combined number hides exactly the information that's useful for tuning quantization, -ngl GPU offload, and batch settings. Two values, label them PP and TG.
For providers that don't return timings (Anthropic, OpenAI, Gemini), the row hides — no new config needed, opportunistic detection on the timings field. Bonus if it lands: a session-level rolling average on hover, since power users comparing quants want medians over a turn or two, not just the last value.
Happy to test on Windows + a couple of common llama.cpp builds when there's something to try.
@remesis I have a PR open, I tested already, but do you have any additional feedback?
it will help with performance management+1
Really great demand feature.
@remesis I have a PR open, I tested already, but do you have any additional feedback?
Noice man, ty
Maybe something for MTP draft acceptance ##% as well, not sure what the appetite for that is though
@Githubguy132010 any chance you're working on a new PR for this?