pi-speedometer
Per-turn speedometer for pi: TTFT, prefill tok/s, decode tok/s, and total wall time.
Package details
Install pi-speedometer from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-speedometer- Package
pi-speedometer- Version
0.1.0- Published
- May 25, 2026
- Downloads
- not available
- Author
- cpepper1017
- License
- MIT
- Types
- extension
- Size
- 11 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./extensions/pi-speedometer.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-speedometer
A per-turn speedometer for pi: TTFT(Time-to-first-token), prefill tok/s, decode tok/s, and total wall time.
Pi's built-in footer already shows tokens, cache, cost, context, and model. This extension surfaces the timing numbers it doesn't show.
Status line
After each turn, pi's status area shows:
ttft 1967ms prefill 412 tok/s decode 63.8 tok/s total 14.2s
Commands
/speed— show recent turns and per-model session averages/speed clear— reset history/speed csv— dump full history to~/.pi/pi-speedometer-<timestamp>.csv
Install
pi install npm:pi-speedometer
Or try it without installing:
pi -e npm:pi-speedometer
How it's measured
- TTFT —
performance.now()fromturn_startto the firsttext_deltaortoolcall_delta(thinking deltas are skipped so TTFT reflects perceived latency on reasoning models). - Prefill tok/s —
(input + cacheWrite) / ttft.cacheReadis excluded because those tokens didn't require real prefill work this turn.cacheWriteis included because those tokens were processed and persisted to cache. - Decode tok/s —
output / (turn_end - first_token). - Total — wall-clock from
turn_starttoturn_end, including any tool round-trips inside the turn.
Numbers come from AssistantMessage.usage (provider-agnostic) plus pi's own event timings, so any provider pi supports will report.
License
MIT