pi-clean-tps
v1.0.0
Published
Elegant inline TTFT & TPS tracker for pi — no extra lines, just clean stats in the footer.
Maintainers
Readme
pi-clean-tps
Elegant inline TTFT & TPS tracker for the pi coding agent.
Unlike other TPS extensions that add extra lines to the footer, pi-clean-tps integrates directly into pi's existing stats line — after token counts and cache hit ratio — keeping the footer clean.
~ ↑2.3k ↓8.8k CH45.2% 45.3%/128k TTFT:0.8s TPS:52.3 DeepSeek-V4-Pro · high
^^^^^^^^^^^^^^^^^^^^
pi-clean-tpsFeatures
- Inline display — TTFT and TPS appended to pi's native stats line, no extra rows
- Live TPS during streaming — configurable time-based sliding window with display throttling
- Thinking-aware — counts reasoning/thinking tokens for DeepSeek, Claude, and Qwen models
- Configurable window —
/tps time <ms>to adjust smoothing (100–30000ms, default 1000ms) - Stats panel —
/tpsshows last turn and aggregate metrics - Color-blind friendly — plain text, no color coding needed
Install
pi install npm:pi-clean-tpsUsage
| Command | Effect |
|---------|--------|
| /tps | Show stats panel (last turn + aggregate) |
| /tps toggle | Show/hide TTFT/TPS in footer |
| /tps on / off | Force enable/disable footer display |
| /tps reset | Clear accumulated stats |
| /tps time <ms> | Set TPS sliding window (default 1000ms) |
How It Works
pi-clean-tps hooks into pi's event lifecycle:
before_provider_request→ records send timemessage_update(text_delta / thinking_delta / toolcall_delta) → detects first token, tracks cumulative outputmessage_end→ records final TTFT and TPS from provider-reported token counts
The live TPS uses a time-based sliding window with a 1-second display throttle to avoid jitter. Values stabilize within the first second of streaming.
Why Another TPS Extension?
Most TPS extensions use setStatus() which adds a separate line to the footer. pi-clean-tps replaces the footer entirely to inline TTFT/TPS into the existing stats line, matching pi's native look and feel.
It also:
- Handles thinking/reasoning tokens properly (DeepSeek, Claude, Qwen)
- Throttles display updates to prevent jitter
- Supports configurable smoothing windows
- Works with all pi providers (OpenAI-compatible, Anthropic, Gemini)
License
MIT
