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-local-token-costs

v1.0.3

Published

Token cost tracking extension for Pi Agent — live footer display with cheapest OpenRouter pricing, cross-session history, and local model matching

Readme

pi-local-token-costs

Token cost tracking extension for Pi. Tracks token usage and estimated costs for every model in every session. Shows live costs in the powerline footer, maintains cross-session history, and always uses the cheapest available provider pricing from OpenRouter.

Key Features

  • Live pricing from 30+ providers (cheapest rate automatically selected)
  • Accurate local model matching via dot-preserved keys, GGUF stripping, and param-count-aware strategies
  • Savings comparison — see what running locally costs vs. online equivalents
  • Cross-session history with per-model breakdowns
  • Offline fallback with ~60 cloud models + Qwen family pricing

Installation

# From npm
pi install npm:pi-local-token-costs

# From git
pi install git:github.com/gunjantomer/[email protected]

Requires pi-powerline-footer for the footer display. Restart pi or run /reload after installing.

Live Footer Display

The powerline footer shows real-time token counts and estimated cost:

↑in: 142k ↓out: 28k $0.20000 · Qwen3.6-35B-A3B |
  • ↑in: = input tokens consumed this session (dynamic, updates while streaming)
  • ↓out: = output tokens generated this session (dynamic)
  • $X.XXXXX = cumulative estimated cost (cheapest provider pricing, 5 decimal places)
  • Model name shown in green if priced match, red if not

Commands

| Command | Description | |---------|-------------| | /token-stats | Show current session's token usage and cost breakdown by model | | /token-history | Show cross-session history of the last 50 messages, grouped by model with pricing source | | /token-clear | Clear all persisted token usage history (with confirmation) | | /token-price <model-id> | Show how a specific model is resolved and priced | | /token-price --set <id> $in $out | Set a custom price override for any model ID |

Documentation

License

MIT