Small-tailqwq/dsh-tps 预览 preview

Small-tailqwq/dsh-tps

Plugin插件 Native原生 ⭐ 3 BSD-3-Clause Data & Analysis数据与分析Dev Workflow开发与代码工作流

只是一个 tps 插件

Project Overview项目介绍

dsh-tps is a native plugin built exclusively for DSH Web that adds a real-time tokens per second (TPS) counter next to the "Generating" status bar. To install it, run the command dsh plugin --profile web add 'github:Small-tailqwq/dsh-tps' in your terminal, then restart your DSH Web instance and reload the web page. If pnpm blocks the build script during installation, you will need to enable the allowBuilds option in your DSH Web profile configuration before retrying. You can also install a pre-built local .tgz package by replacing the GitHub URL with your local file path.

This plugin uses a 5-second rolling window to count output tokens during streaming generation, and it includes the DeepSeek-V3 tokenizer built in for counting. It automatically appears after the first token count is generated, and disappears when the generation task ends. If your mouse hovers over the TPS display for 2 seconds, the display fades out to allow click-through interactions with underlying page elements. It locates the status bar via semantic DOM selectors, so it works regardless of text content or CSS class names.

dsh-tps is a pure front-end plugin that only reads existing DSH session context, so it does not send any extra network requests to external services. TPS counts from this plugin are not the same as official billing counts from DeepSeek's servers, and may differ from counts generated by other tokenizers. The plugin is distributed under the open-source BSD-3-Clause license, and it was split out from the early DeepSeek Harness monorepo for independent distribution. Regular installation does not require a full checkout of the DSH source code.

dsh-tps 是一款专为 DSH Web 开发的原生插件,作用是在“深度求索中…”状态行旁显示实时 TPS(每秒生成 token 数)。用户可以通过 DSH 命令行工具执行 dsh plugin --profile web add 'github:Small-tailqwq/dsh-tps' 完成在线安装,也可以添加预构建的本地压缩包安装。安装完成后需要重启 DSH Web 并重打开页面,若 pnpm 提示构建脚本被阻止,需配置 Web 配置文件开启 allowBuilds 后重试。

本插件使用 5 秒滚动窗口统计流式输出的 token 数量,内置 DeepSeek-V3 分词器,会在首个有效数值生成后自动显示,任务结束后随状态行一同消失,鼠标悬停 2 秒后会淡出并允许点击穿透。它通过语义 DOM 定位状态行,不依赖特定文案或 CSS 哈希类名,因此适配不同语言版本的 DSH Web,兼容性较好。

本插件是纯前端实现,仅读取 DSH 会话上下文数据,不会发起额外网络请求,也不会修改 DSH 原生节点,仅管理自身容器。它的 TPS 统计基于内置分词器,结果不等同于服务端计费统计,也不代表其他模型分词器的精确结果。本插件采用 BSD-3-Clause 许可证分发,从早期 Harness monorepo 独立出来单独分发。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add 'github:Small-tailqwq/dsh-tps'

把 Small-tailqwq/dsh-tps 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-tps

在 DSH Web 的“深度求索中…”状态行旁显示实时 TPS(每秒生成 token 数)。

English: README.en.md

演示

安装

适用于 DSH 0.1.2-rc.1。在终端执行:

dsh plugin --profile web add 'github:Small-tailqwq/dsh-tps'

安装完成后,重启正在运行的 DSH:

dsh web

重新打开页面并发起一轮任务,开始流式输出后即可看到:

深度求索中… 24秒  TPS 132

从 GitHub 安装时会自动构建插件。如果 pnpm 提示构建脚本被阻止,按提示配置 Web profile 的 allowBuilds 后重试。

安装本地包

如果拿到的是预构建 .tgz 文件,将路径替换为实际文件位置:

dsh plugin --profile web add './dsh-tps-0.3.0-rc1-dom.tgz'

预构建包已包含运行时代码,不需要下载 Harness 源码或自行编译。

功能

  • 实时速率:使用滚动 5 秒窗口统计流式输出,内置 DeepSeek-V3 分词器。
  • 自然显隐:首个数值产生后显示,任务结束时随状态行消失;输出暂停约 1.5 秒后显示 --。
  • 悬停淡出:鼠标停留 2 秒后淡出并允许点击穿透,移开后等待 3 秒恢复。
  • 语言无关的挂载:通过语义 DOM 定位状态行,不匹配中文、英文文案或 CSS 哈希类名。
  • 纯前端:读取 DSH 会话快照,无额外网络请求。平均速率、首 token 时延和总用量仍由原生统计栏提供。

已安装但不显示

  1. 确认任务正在产生流式输出;空闲或尚未收到输出时不会显示徽标。
  2. 确认 TPS 已启用。如果使用 dshmarket,也需要在插件市场中启用 TPS:市场会恢复自己保存的禁用状态,仅修改 profile 配置不能覆盖它。
  3. 安装或替换包后重启 DSH,再重新打开页面。
  4. 确认宿主版本及当前皮肤保留聊天状态行。其他版本或改变页面结构的皮肤可能需要适配。

计数说明

TPS 按内置 DeepSeek-V3 分词器统计,不等同于服务端计费用量,也不代表其他模型分词器的精确计数。分词器初始化期间使用 UTF-8 字节数近似,就绪后切换为 BPE 计数。

极长且没有分词边界的连续文本可能增加主线程计算开销。悬停和恢复时间目前为固定值,没有配置界面。

开发

普通安装不依赖 Harness 源码。开发时的类型检查和测试通过相邻 checkout 解析宿主接口:

<parent>/
  deepseek-harness/  # dsh-v0.1.2-rc.1
  dsh-tps/

在本仓库执行:

pnpm install
pnpm run typecheck
pnpm test
pnpm run build

pnpm run prepare 是 Git 安装使用的自包含构建,不读取相邻 checkout;它应与完整构建生成一致的运行时代码。pnpm run dev 可监听源码变化。

插件通过 conversation.composer.dock 获取会话上下文,再以 React Portal 挂到当前 [data-conversation-scroll] 内 [data-chat-flow] 的直接子元素 [role="status"][aria-live="polite"]。只管理插件自己的容器,不移动宿主节点。

重新生成分词数据

准备官方 DeepSeek-V3 tokenizer.json 后执行:

node scripts/build-tokenizer-data.mjs <https://github.com/Small-tailqwq/dsh-tps/blob/HEAD/path/to/tokenizer.json>
python scripts/gen-golden.py <https://github.com/Small-tailqwq/dsh-tps/blob/HEAD/path/to/tokenizer.json> tests/fixtures/deepseek-golden.json

许可

BSD-3-Clause。本插件从早期 Harness monorepo 的 packages/client/ui-tps 独立分发。

← 上一个 Prev solo-memory 下一个 Next DSHGuard →