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

opencode-token-speed

v0.0.4

Published

[![OpenCode](https://img.shields.io/badge/OpenCode-%E2%89%A51.3.14-blue?style=flat-square)](https://opencode.ai/) [![npm version](https://img.shields.io/npm/v/opencode-token-speed?logo=npm&style=flat-square)](https://www.npmjs.com/package/opencode-token-s

Readme

opencode-token-speed

OpenCode npm version

English

OpenCode TUI 插件:在会话侧边栏或输入框底部右侧显示生成速度指标 —— 实时 TPS、会话平均 TPS、平均 TTFT。

显示效果

  • 侧边栏打开时:指标位于 Context 块下方,在 Speed 区块中分三行显示,并保留 tok/s 和 s 单位。
  • 侧边栏关闭时:指标在输入框底部、模型信息同一行的右侧显示,例如 TPS: 42.0 · AVG: 38.5 · TTFT: 1.2。
  • 空间不足时:依次隐藏 TTFT、AVG,优先保留 TPS;极窄时截断显示,始终保持单行。空间恢复后自动显示更多指标。

显示位置随侧边栏自动显隐、手动开关和终端尺寸变化自动切换,无需配置,统计数据不会因切换而重置。终端宽度 > 120 时,OpenCode 默认自动显示侧边栏。

侧边栏显示效果:

演示效果

  • TPS:实时生成速度
  • AVG:本会话平均生成速度
  • TTFT:本会话平均首 token 延迟

注:TTFT/TPS 均为估算值,实际数值可能因模型、网络和运行环境而有所差异。

安装

opencode plugin opencode-token-speed@latest --global

要求 opencode >= 1.3.14。

卸载

从 ~/.config/opencode/tui.json 删除插件配置,然后删除本地缓存 ~/.cache/opencode/packages/opencode-token-speed@latest。

参考项目

  • https://github.com/Tarquinen/oc-tps
  • https://github.com/ChiR24/opencode-tps-meter
  • https://github.com/XiaomiMiMo/MiMo-Code