<h1 align="center">dsh-token-dashboard</h1>
<p align="center"> <strong>让 DeepSeek Harness 的每一个 Token 都清晰可见。</strong> </p>
<p align="center"> 在 DSH Web 中集中查看会话用量、缓存效率、上下文压力、请求性能与跨会话对比。 </p>
<p align="center"> <a href="https://www.npmjs.com/package/dsh-token-dashboard"><img alt="npm version" src="https://img.shields.io/npm/v/dsh-token-dashboard?style=flat-square&logo=npm&logoColor=white&color=cb3837"></a> <a href="https://github.com/tsja2001/dsh-token-dashboard/actions/workflows/ci.yml"><img alt="CI status" src="https://img.shields.io/github/actions/workflow/status/tsja2001/dsh-token-dashboard/ci.yml?branch=main&style=flat-square&logo=githubactions&logoColor=white&label=CI"></a> <a href="./LICENSE"><img alt="MIT license" src="https://img.shields.io/github/license/tsja2001/dsh-token-dashboard?style=flat-square&color=22c55e"></a> <a href="https://nodejs.org/"><img alt="Node.js 22.19+" src="https://img.shields.io/badge/Node.js-22.19%2B-339933?style=flat-square&logo=nodedotjs&logoColor=white"></a> <a href="https://github.com/topics/dsh-plugin"><img alt="DSH plugin" src="https://img.shields.io/badge/DSH-plugin-4f6ef7?style=flat-square"></a> </p>
<p align="center"> <strong>简体中文</strong> · <a href="README.en.md">English</a> </p>
---
<p align="center"> <a href="./统计数据.png"><img src="./统计数据.png" alt="dsh-token-dashboard 统计界面" width="100%"></a> </p>
<p align="center"><sub>无需离开当前会话,即可理解 Token 消耗发生在哪里。</sub></p>
核心能力
| 能力 | 说明 | |
|---|---|---|
| 📊 | 本会话分析 | 汇总计费输入、输出、缓存命中率与上下文占用,并展示 Token 构成。 |
| ⚡ | 请求效率 | 查看轮次、步骤、LLM / 工具耗时、首 Token 延迟与解码吞吐。 |
| 🔍 | 逐步骤明细 | 按步骤追踪模型、状态、输入输出、缓存读写、推理 Token、TTFT 与 tok/s。 |
| 🧭 | 跨会话对比 | 对全部会话进行排序和对比,并识别当前、运行中及子代理会话。 |
| 🔒 | 本地只读 | 直接读取 DSH 已有投影,不调用外部 API,不上传数据,也不发起模型请求。 |
快速开始
从 npm 安装(推荐)
dsh plugin --profile web add dsh-token-dashboard> [!IMPORTANT] > 安装完成后请重启 DSH Web。随后 统计 / Statistics 选项卡会出现在对话和轨迹选项卡旁边。
<details> <summary><strong>从 GitHub 安装或卸载</strong></summary>
# 从 GitHub 安装
dsh plugin --profile web add github:tsja2001/dsh-token-dashboard
# 卸载
dsh plugin --profile web remove dsh-token-dashboard</details>
你会看到什么
本会话
- Token 概览:计费输入、输出、缓存命中率、上下文占用。
- Token 构成:未缓存输入、缓存读取、缓存写入与输出的占比和明细。
- 请求效率:轮次、步骤、LLM / 工具耗时、平均 TTFT 与解码吞吐。
- 逐步诊断:定位高输入、低缓存命中或高延迟的具体请求步骤。
全部会话
- 汇总所有带用量投影的会话。
- 按轮次、计费输入、缓存命中、输出或更新时间排序。
- 查看所选会话的四类 Token 明细,并区分当前、运行中和子代理会话。
数据口径与隐私
> [!NOTE] > 这是一个纯展示插件。所有数据都来自 DeepSeek Harness 已经计算的标准投影;插件本身没有服务端、数据库、遥测或网络请求。
- 计费输入 = 未缓存输入 + 缓存读取 + 缓存写入。
- 持久化总量覆盖完整会话日志;逐步骤明细只覆盖当前已加载窗口。
- 缺失的投影值显示为
—,不会被误认为 0。 - 本插件统计 Token 用量,不提供 API 余额或金额费用。
兼容性
- 需要可以正常运行的 DSH Web。
- 需要 Node.js
^22.19.0或>=24.0.0。 - 不要与
@deepseek-ai/dsh-client-usage-dashboard同时安装;两者提供的是同一个视图。
License
[MIT](LICENSE) © tsja2001