@arhen/pi-core-tps-stats1.3.4
Minimalist pi extension: live tokens-per-second stats for the active model
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
@arhen/pi-core-tps-stats
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:
≤40red,≤80warning,<100default text,≥100success - 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):
| prompt | turn | window-based | this extension |
|---|---|---|---|
Say OK. |
1.40s | 263 t/s | 41 t/s |
List 3 fruits. |
8.81s | 801 t/s | 14 t/s |
| 900-word essay | 18.49s | 89 t/s | 55 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.