opencode-token-speed-pluginOpenCode TUI plugin that displays real-time LLM output token speed (tok/s)
GitHub 星标
3
近 30 天 +1
月装机量
90
近 7 天 14
综合评分SCORE
32.7
生态多维模型
最近提交
4 个月前
2026-04-21
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-token-speed-plugin@1.0.4"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-token-speed-plugin@1.0.4"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-token-speed-pluginopencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
README.md
查看原始文件→A OpenCode TUI plugin that displays real-time LLM output token speed (tok/s) in the session prompt area.
Features
- Real-time speed display — Shows output token speed during streaming using a 2-second sliding window.
- Persistent display — When streaming ends, the last measured speed is kept visible.
- Non-intrusive — Uses the
session_prompt_rightslot (append mode), so it doesn't replace any built-in UI.
Setup
Add the plugin to your tui.json (not opencode.json):
{
"plugin": ["opencode-token-speed-plugin"]
}
That's it. OpenCode will automatically install the plugin on next run.
Note: This is a TUI plugin, so it must be configured in
~/.config/opencode/tui.json, notopencode.json.
How it works
- Listens to
message.part.deltaevents to count characters as they stream in. - Estimates tokens using the
chars / 4heuristic within a 2-second sliding window. - Displays
▲ XX.X tok/sto the right of the session prompt.
License
MIT