npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pi-response-stats

v0.1.6

Published

Pi extension showing tokens-per-second and response time per agent run, plus session averages, in the footer

Readme

pi-response-stats

A lightweight Pi extension that tracks and displays LLM response performance in the footer: tokens per second and response time, per agent run and cumulative across the session.

The footer shows the current run's TPS and duration alongside session averages:

⚡123/99 ⏱32s/1m 54s

What it shows

  • Current run: TPS and duration of the most recent agent run, live while running (every thinking block and tool call counts)
  • Session totals: average TPS and total time across all runs in the current session; the total time ticks live during a run

Statistics are stored per session and branch:

| Mode | Behavior | |---|---| | New session | Resets to zero | | /resume | Restores that session's active-branch statistics | | /reload | Restores the current statistics | | /fork | Inherits statistics from the selected branch | | /tree | Restores statistics for the branch you navigate to |

If a session or branch has no stored snapshot, it starts at ⚡0/0 ⏱0s/0s.

Format

The stats line is configurable. Set format in ~/.pi/agent/response-stats.json. A leading \n renders the stats on their own line below pi's stats (the default); without the prefix they append inline to pi's stats line, after a single hardcoded space:

{ "format": "\n⚡{runTps}/{avgTps} ⏱{runDuration}/{totalDuration}" }

Placeholders

| Placeholder | Kind | No-data / zero behavior | Example (run: 1h 2m 3s · total: 0h 1m 54s · TPS 123 · 421 tok) | |---|---|---|---| | {runTps} | int | 0 | 123 | | {avgTps} | int | 0 | 99 | | {runTokens} | int | 0 | 421 | | {totalTokens} | int | 0 | 3842 | | {runDuration} | string, pre-formatted | 0s | 1h 2m | | {totalDuration} | string, pre-formatted | 0s | 1m 54s | | {runHours} {runMinutes} {runSeconds} | int | always renders, incl. 0 | 1, 2, 3 | | {totalHours} {totalMinutes} {totalSeconds} | int | always renders, incl. 0 | 0, 1, 54 | | {runHoursIfAny} | string, conditional | (empty) | 1h | | `{runMinutesIfAny}` | string, conditional | (empty) | 2m | | {runSecondsIfAny} | string, conditional | (empty) | 3s | | `{totalHoursIfAny}` | string, conditional | (empty) | (empty) | | `{totalMinutesIfAny}` | string, conditional | (empty) | 1m | | {totalSecondsIfAny} | string, conditional | `` (empty) | 54s |

Logic

  1. Substitute every {name} (and optional {name:spec} for numbers) with its value.
  2. IfAny placeholders expand to value + unit when non-zero, empty string when zero.
  3. Collapse consecutive spaces to one, trim ends (this removes the gaps left by vanished IfAny segments).
  4. Unknown placeholders stay literal so typos are visible.

Number specs follow .NET style: 0 (integer), 0.0 (one decimal), 0.## (up to two, no trailing zeros).

Examples (run: 32s · total: 1m 54s · TPS 123/99)

| Format string | Result | |---|---| | ⚡{runTps}/{avgTps} ⏱{runDuration}/{totalDuration} (default) | ⚡123/99 ⏱32s/1m 54s | | ⚡{runTps}/{avgTps} (no \n prefix) | appended inline to pi's stats line, after one space | | same, before first run | ⚡0/0 ⏱0s/0s | | ⏱{runHoursIfAny} {runMinutesIfAny} {runSecondsIfAny} | ⏱ 32s | | ⏱{runHours}h {runMinutes}m {runSeconds}s | ⏱0h 0m 32s | | {runHoursIfAny} {runMinutesIfAny} {runSecondsIfAny} / {totalHoursIfAny} {totalMinutesIfAny} {totalSecondsIfAny} | 32s / 1m 54s | | {runTps:0.0}/{avgTps} | 123.0/99 | | {runTokens} tok | 421 tok |

Install

# From npm (published releases)
pi install npm:pi-response-stats

# From git (unpinned; updates with `pi update --extensions`)
pi install git:github.com/that-lucas/pi-response-stats

Or copy response-stats.ts to ~/.pi/agent/extensions/ and run /reload.

Behavior

Works automatically, no commands or shortcuts. The line is always visible; values fill in as runs complete.