← Catalog

@arhen/pi-core-tps-stats

Minimalist pi extension: live tokens-per-second stats for the active model

Extension

Install

Install with PiG

pig install npm:@arhen/pi-core-tps-stats

Install with Pi

pi install npm:@arhen/pi-core-tps-stats
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./src/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 1.3.4 (README.md). PiG does not review it.

@arhen/pi-core-tps-stats

npm version license

Install

Requires the pi coding agent — install it first: npm install -g @earendil-works/pi-coding-agent.

pi install npm:@arhen/pi-core-tps-stats

Live token-per-second stats for active model. Status bar shows median effective t/s + median TTFT; /tps-stats shows full stats (samples, avg/median/min/max, TTFT). Stats reset on model change.

  • Status-bar speed is colour-banded: ≤40 red, ≤80 warning, <100 default text, ≥100 success
  • The ring buffer keeps the last 200 samples, and the bars report over that window
  • A model change flashes t/s reset <provider>/<id> for 2 s
  • Before any sample exists: t/s Stats: no data yet. Send a prompt first.

One rate, deliberately. Effective t/s is all output tokens (thinking + text + tool-call arguments) divided by assistant-response time from turn start to message end. Queue, prefill, and TTFT are included; tool execution is excluded. It reads lower than provider marketing numbers because it is rate you actually wait for.

There is no separate "streaming t/s", because SSE arrival times measure the gateway's flush schedule rather than the model. Measured against vantis/deepseek-v4-flash-0731-fast (median inter-chunk gap: 0.01ms — chunks land in instant batches separated by long pauses):

promptturnwindow-basedthis extension
Say OK.1.40s263 t/s41 t/s
List 3 fruits.8.81s801 t/s14 t/s
900-word essay18.49s89 t/s55 t/s

The window-based column swings 9x on one model within a minute. Versions before v1.3.0 shipped that math and reported four-digit rates no local model can reach.

TTFT stays a direct observation — first streamed token minus turn start. On reasoning models that first token is usually thinking, not visible text.

npm test --workspace @arhen/pi-core-tps-stats

License

MIT.