better-er/dsh-live-token-stats1

dsh-live-token-stats

DSH Web 插件:在 composer 下方渲染实时 token 状态带,显示流式 TPS、输出 token 与首字延迟,并对比上次 step 的估算与实际偏差;纯插件自包含,不改 DSH 源码

包名
dsh-live-token-stats
版本
0.2.1
许可证
MIT
最近更新
2026年8月26日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:better-er/dsh-live-token-stats

配置

在 profile 的 cordis.yml 或 overlay 中配置:

  • enabled:boolean,默认 true,总开关。
  • tokenizerMode'bpe''density',默认 'bpe'
    • bpe:用内置的 DeepSeek V4 词表做真实 BPE 切分,与 provider usage 最接近。
    • density:回退到双密度字符估算,下方两个配置项仅在此模式生效。
      • asciiTokenPerChar:number,默认 0.3,每个 ASCII 字符折算的 token 数。
      • cjkTokenPerChar:number,默认 0.6,每个 CJK 字符折算的 token 数。
  • rateWindowMs:number,默认 3000,实时 TPS 的滑动窗口毫秒数。
  • debug:boolean,默认 false,诊断日志开关。也可用环境变量 DSH_LIVE_TOKEN_STATS_DEBUG=1 免改配置打开。