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-tokometer

v0.2.0

Published

A live token-speed meter for the Pi coding agent footer.

Readme

pi-tokometer

A live token-speed meter for the Pi coding agent.

Pi + token + speedometer = Tokometer.

Pi Tokometer adds decode throughput and time-to-first-token readings such as ↯12.3tok/s TTFT1.2s to Pi's footer while preserving the footer's existing session, usage, context, model, and Git information.

Features

  • Updates decode speed while an assistant response is streaming when the provider supplies cumulative usage
  • Separates generation throughput from time to first token (TTFT)
  • Aggregates multi-step tool turns by tokens and decode time, rather than averaging per-request rates
  • Restores the latest turn's metrics when a session is resumed, reloaded, or its branch changes
  • Preserves Pi's standard footer information
  • Uses no third-party runtime dependencies

Token speed is calculated as provider-reported output tokens divided by the monotonic-clock interval between the first and last non-empty text, thinking, or tool-call delta. Tokometer stores the resulting decode duration and TTFT beside the finalized assistant message, so the same reading survives reloads and branch changes. If a provider supplies its own duration and ttft, duration - ttft remains a compatibility fallback. Samples below 50 ms are ignored, and live updates are limited to four per second to keep rendering lightweight.

For a turn containing multiple model requests, Tokometer uses the weighted aggregate sum(output tokens) / sum(decode time). It never averages the individual request rates. Streaming speed is a running average, not an instantaneous rate; providers that report usage only at completion produce their first accurate reading at completion.

Install

pi install npm:pi-tokometer

Try it without installing:

pi -e npm:pi-tokometer

Restart Pi after installation, or run /reload from an existing session.

Compatibility

Pi Tokometer is designed for the interactive TUI. The extension still loads in print, JSON, and RPC modes, but it only installs its footer in TUI mode.

Because Pi currently exposes custom footers as replacements, Pi Tokometer recreates the standard footer and adds the speed reading. Only one custom-footer extension should be enabled at a time.

Display

The added metric looks like:

↯24.8tok/s TTFT1.2s

The current turn's speed remains visible until the next response has enough data for a stable replacement. TTFT is the first measurable model request in that turn.

Development

Clone the repository and load it directly:

git clone https://github.com/harrykwokdev/pi-tokometer.git
cd pi-tokometer
pi -e .

Validate the npm package contents:

npm run check

中文说明

Pi Tokometer 为 Pi 的状态栏增加解码速度与首 Token 延迟,例如 ↯24.8tok/s TTFT1.2s。速度按“提供方上报的输出 Token ÷ 首 Token 后的生成时长”计算;包含多次模型调用的工具回合使用 Token 与解码时长的加权聚合。插件会保留 Pi 原有的会话、用量、上下文、模型和 Git 信息。由于 Pi 的自定义 Footer API 是替换式的,建议不要同时启用其他自定义 Footer 插件。

License

MIT