跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    中文English
    heimoshuiyu

    Token Speed

    v1.0.4模型接入
    opencode-token-speed-plugin

    OpenCode 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"]
    }

    opencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。

    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_right slot (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, not opencode.json.

    How it works

    • Listens to message.part.delta events to count characters as they stream in.
    • Estimates tokens using the chars / 4 heuristic within a 2-second sliding window.
    • Displays ▲ XX.X tok/s to the right of the session prompt.

    License

    MIT