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

@jumpmaster/opencode-throughput

v2.2.0

Published

Real-time LLM performance monitoring plugin for OpenCode. Tracks TTFT, TPS, latency, token usage and cost per model with a TUI sidebar display.

Readme

Forks from opencode-throughput

Why fork? I want the simpler realtime stats bar, instead of complete.

opencode-throughput

Real-time LLM performance monitoring plugin for OpenCode. Tracks TTFT, TPS, latency, token usage, and cost with a live readout in the prompt status bar. Supports both OpenCode 1.x (V1 TUI plugins) and OpenCode 2.x (V2 CLI plugins) from one package.

Features

  • TTFT (Time To First Token) — measures how fast the model starts generating
  • TPS (Tokens Per Second) — generation throughput during streaming
  • Total Latency — end-to-end request time
  • Token Usage — input, output, reasoning, cache read/write
  • Cost Tracking — per-request and cumulative cost
  • Status Bar Readout — live TTFT · ↓tokens · TPS while streaming, plus a per-turn summary when idle

Installation

OpenCode 2.x — add to ~/.config/opencode/cli.json:

{
  "$schema": "https://opencode.ai/v2/cli.json",
  "plugins": ["@jumpmaster/opencode-throughput"]
}

OpenCode 1.x — add to tui.json:

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": ["@jumpmaster/opencode-throughput"]
}

OpenCode installs the plugin from npm at startup. Requires opencode >= 1.18.0; OpenCode 2.x needs no extra configuration.

Usage

Once installed, the plugin runs automatically. While a model generates, the prompt status bar shows the live readout:

TTFT 1.2s · ↓1.2k tok · 58.3 tok/s

When idle it shows the last turn's summary:

TTFT 2.1s · ↓1.5k tok · 57.3 tok/s
  • TPS is generation throughput: it excludes prefill (TTFT) and tool-execution time
  • The turn summary resets on each new user message / execution
  • While the next prompt is still in prefill (no first token yet), the previous turn's token and TPS values stay on screen in muted color, so nothing blanks out

How It Works

The plugin is a TUI plugin (@opentui/solid + solid-js) with two implementations behind one entrypoint:

  • V1 (src/v1.tsx) subscribes to message.part.updated, message.part.delta, session.next.*.delta, and message.updated, and renders into session_prompt_right / home_prompt_right
  • V2 (src/v2.tsx) subscribes to session.step.started, session.text.delta, session.reasoning.delta, session.tool.input.delta, session.step.ended, and session.execution.*, and renders into prompt.footer.status / home.footer.status

Both share the pure TTFT/TPS helpers in src/stats.ts. V1 reads the first token time and the completed message totals; V2 uses the step start time as the TTFT anchor and session.step.ended for real token usage per step.

Development

Local development

V1 — add to tui.json (TUI plugins are loaded from tui.json, not opencode.json):

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": ["file:///absolute/path/to/opencode-throughput/src/index.ts"]
}

V2 — add to ~/.config/opencode/cli.json:

{
  "$schema": "https://opencode.ai/v2/cli.json",
  "plugins": ["file:///absolute/path/to/opencode-throughput/src/tui.tsx"]
}

Edits to src/** only take effect after restarting opencode. Keep exactly one registration (published package or local file) while developing.

Build

bun install
bun run build
bun run typecheck
bun test

bun test includes a render test that drives the V2 slot with synthetic events via @opentui/solid's testRender.

Publish

npm login          # once
bun run release    # bump + build + typecheck + test + npm publish

bun run release [patch|minor|major|x.y.z] [--dry-run] [--yes] [--tag=beta]

License

MIT