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

@jack-yang/opencode-tps-meter

v0.1.1

Published

Live TPS/AVG/TTFT meter plugin for OpenCode TUI with color-coded speed tiers

Readme

opencode-tps-meter

A TUI plugin for opencode that displays real-time LLM output speed metrics next to the session prompt.

Display

TPS 42.5 | AVG 38.2 | TTFT 0.8s
  • TPS — current tokens per second (live, color-coded)
  • AVG — session-wide cumulative average from completed messages (color-coded)
  • TTFT — time to first token, shown immediately on first token, persists until next generation (color-coded)

Color Tiers

TPS & AVG (higher is better):

| Tier | Range | Color | |------|-------|-------| | Slow | < 20 TPS | Red | | Normal | 20–50 TPS | Yellow | | Fast | 50–100 TPS | Green | | Faster | > 100 TPS | Cyan |

TTFT (lower is better):

| Tier | Range | Color | |------|-------|-------| | Fast | < 0.5s | Green | | OK | 0.5–2s | Yellow | | Slow | > 2s | Red |

Installation

This plugin must be configured in tui.json (not opencode.json).

Option 1: Local file

  1. Copy tui.tsx to your opencode config directory:
cp tui.tsx ~/.config/opencode/tps-meter.tsx
  1. Add to ~/.config/opencode/tui.json:
{
  "plugin": [
    "./tps-meter.tsx"
  ]
}
  1. Restart opencode.

Option 2: Project-local

Add a .opencode/tui.json in your project root with the same plugin path (relative to the config file location).

How It Works

Live TPS

Tracks text/reasoning delta events in a rolling 5-second window. Uses wall-clock duration (now - oldest sample) instead of inter-arrival time sums to avoid inflation from network buffering.

Token estimation uses ceil(byteLength / 4) with a calibration factor: when a message completes, the estimated token count is compared against actual tokens.output + tokens.reasoning from the message metadata, and a running median ratio corrects future estimates.

AVG

Session-wide cumulative average from all completed messages: sum(actual tokens) / sum(generation durations). Updates only when a message completes. Generation duration = last delta - first delta per message (excludes tool execution time and TTFT).

TTFT

Time from message creation (info.time.created) to the first text/reasoning delta. Displayed immediately when the first token arrives, and persists until the next generation starts.

Development

npm install
npm test

Pure measurement functions (measure.ts) have 29 unit tests. The TUI plugin (tui.tsx) is a standalone single file (all functions inline) for direct deployment — copy it to your config directory.

Requirements

  • opencode >= 1.4.3
  • The plugin file must be placed where tui.json can reference it via relative path

License

MIT