@sugarforever/pi-throughput-meter

Per-turn TTFT and output token throughput for Pi

Packages

Package details

extension

Install @sugarforever/pi-throughput-meter from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@sugarforever/pi-throughput-meter
Package
@sugarforever/pi-throughput-meter
Version
0.1.1
Published
Sep 11, 2026
Downloads
305/mo · 305/wk
Author
verysmallwoods
License
MIT
Types
extension
Size
5.9 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./dist/index.js"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-throughput-meter

pi-throughput-meter is a small Pi extension that displays per-turn latency and output throughput in Pi's TUI status area.

After each assistant turn it shows:

TTFT 312 ms · ↓428 · 186.4 tok/s
  • TTFT: milliseconds from Pi's turn_start event to the first streamed message update.
  • ↓ tokens: output tokens reported by the provider for the completed assistant message.
  • tok/s: output tokens divided by the time from the first streamed update to turn_end.

These are client-observed measurements, so network latency, provider chunking, and Pi event timing affect the result. The extension does not report input tokens per second because input/prefill is not exposed as a token stream; TTFT is the useful observable proxy for that phase.

Install

After the package is published:

pi install npm:@sugarforever/pi-throughput-meter

For local development from this repository:

pi -e ./pi-throughput-meter

You can also load the built entry point explicitly:

npm --prefix pi-throughput-meter run build
pi --extension ./pi-throughput-meter/dist/index.js

Development

cd pi-throughput-meter
npm install
npm run check

License

MIT