pi-metrics-footer
Live model speed (tokens/s), token/cost/context stats, and configurable model labels in the pi TUI footer
Package details
Install pi-metrics-footer from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-metrics-footer- Package
pi-metrics-footer- Version
0.1.3- Published
- Aug 18, 2026
- Downloads
- 442/mo · 13/wk
- Author
- nxxxsooo
- License
- MIT
- Types
- extension
- Size
- 10.7 KB
- Dependencies
- 0 dependencies · 0 peers
Pi manifest JSON
{
"extensions": [
"./extensions"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-metrics-footer
Live model speed and usage metrics in the pi TUI footer: tokens/sec while streaming, per-turn average speed, token/cost/context stats, and model name — with configurable model labels.
Features
- Live tokens/sec while the model streams (
⚡ 45t/s), computed from a 2s rolling window oftext_delta/thinking_deltaevents. - Per-turn average once a reply finishes: the last turn's average speed stays visible until the next turn replaces it — so a speed reading is always on screen, and it also works when the provider doesn't stream deltas.
- Token / cost / context line: input, output, cache read/write, cost, and context usage, plus the current model (emoji label + thinking level).
- Configurable model labels: map
provider/modelIDs to your own display names.
Install
pi install npm:pi-metrics-footer
Then restart pi. The footer is replaced on session start.
Update
pi update npm:pi-metrics-footer
Updates are manual; the package does not auto-update.
Uninstall
Remove pi-metrics-footer from the packages list in ~/.pi/agent/settings.json, then restart pi.
Configuration
Create <pi-agent-dir>/pi-metrics-footer.json (default: ~/.pi/agent/pi-metrics-footer.json):
{
"modelLabels": {
"anthropic/claude-sonnet-5": "🎭 Sonnet 5",
"openai/gpt-5.5": "🧠 GPT-5.5"
}
}
Keys are provider/model exactly as shown by pi (e.g. from /model). User labels override the built-in defaults for the same key and add new ones. Restart pi (or /reload) after editing.
How It Works
- Live TPS uses a 2s rolling window of streaming token events; it needs at least 2 samples within the window, so very short replies may not show it.
- Average TPS = output tokens ÷ wall time of the last finished assistant message. It persists while idle and is replaced when the next turn produces a new reading.
- Before the first reply of a session there is no reading yet, so nothing shows.
License
MIT