pi-speedometer

Per-turn speedometer for pi: TTFT, prefill tok/s, decode tok/s, and total wall time.

Packages

Package details

extension

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

  • TTFTperformance.now() from turn_start to the first text_delta or toolcall_delta (thinking deltas are skipped so TTFT reflects perceived latency on reasoning models).
  • Prefill tok/s(input + cacheWrite) / ttft. cacheRead is excluded because those tokens didn't require real prefill work this turn. cacheWrite is included because those tokens were processed and persisted to cache.
  • Decode tok/soutput / (turn_end - first_token).
  • Total — wall-clock from turn_start to turn_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