LightClear/dsh-token-pricing 预览 preview

LightClear/dsh-token-pricing

DeepSeek Harness模型定价插件·配置token价格并显示会话费用 | DeepSeek Harness的Token定价插件——按模型设置token费率,并实时显示会话成本。

Project Overview项目介绍

dsh-token-pricing is a community-maintained unofficial native plugin built exclusively for DeepSeek Harness’s web interface. Its core function is to calculate and display token usage costs per model and provider, with configurable separate rates for cache miss input, cache hit input, and output tokens. It also supports custom peak pricing for multiple flexible time windows, and shows session costs across multiple different views for users to review. Before installation, you need to have Node.js 22 or newer, pnpm, and a working DSH installation set up on your machine. You can install it directly via the official DSH CLI to your web profile, or pull a specific branch or commit from the git repository for installation.

After installation, you can configure your model pricing in the Settings > Model Pricing page of DSH. Once configured, DSH will show the current session’s total cost at three different places: the bottom data bar of the dialog, a collapsible and draggable floating window, and a global cost dashboard accessible from the sidebar. The floating window supports two views: cost per turn and cost per model. The global dashboard covers all projects and conversations, not just the active session, and can group costs by project or by model, with full CSV export of any current view. All cost data is persisted with the session and retained after archiving, and any changes to pricing will automatically recalculate all historical session costs.

This plugin only declares two direct runtime dependencies, schemastery and zod. All other DSH-related dependencies are provided by the base DSH installation, so no extra internal packages are pulled during installation. The plugin does not modify any prompt content, tool schemas, or messages sent to the model, it only displays existing persistent usage data collected by DSH. It is released under the permissive open-source MIT license, and currently only supports pricing in USD. The project roadmap includes adding support for multiple currencies and automatic exchange rate conversion in future updates.

dsh-token-pricing 是一款由社区维护的非官方 DeepSeek Harness 原生插件,核心功能是为 DSH Web 界面提供按提供方和模型的 token 计价与会话费用统计。它支持配置未命中输入、缓存命中输入、输出三种 token 的基础价格,还可自定义多时段高峰定价规则,能从多个维度查看会话费用数据。

安装需要满足前置环境要求:Node.js ≥ 22、pnpm 以及已安装好的 DSH,可通过官方 DSH CLI 一键安装到 web profile,也支持从 git 源安装特定分支或提交。安装完成后可在「设置→模型定价」中配置各模型价格,对话时就能在界面查看实时费用统计。费用数据会随会话持久化存储,归档后也会保留,修改价格后会自动重算历史费用。

本插件提供三种费用展示入口:对话框底部数据栏、可折叠拖拽的浮窗(支持按轮和按模型两种计价视图),还有跨全部项目和对话的全局费用统计面板,支持 CSV 导出数据。插件仅依赖 schemastery 和 zod 两个运行时包,其余依赖由 DSH 本身提供,遵循 MIT 许可开源发布。目前仅支持美元计价,未来计划增加多货币和自动汇率功能。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
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 dsh-token-pricing

把 LightClear/dsh-token-pricing 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-token-pricing

中文 | English

dsh-token-pricing 是一款第三方(非官方)插件,由社区维护,与 deepseek-ai 官方发布无关。

Web 界面的按提供方/模型 token 定价:按提供方/模型配置美元价格(未命中输入、缓存命中输入、输出,以及可在任意多个高峰时段内生效的高峰价格档),并在三个表面查看会话费用——底部数据栏,以及一个可折叠可拖拽的浮窗(「按轮计价」与「按模型计价」两种视图)。按轮用量由 tokenPricing 投影从会话日志派生,随会话持久化、随归档一并保留。node 半身注册设置命名空间与投影单元,其余全部复用现有 Host 服务。

安装

前置:Node ≥ 22、pnpm、可用的 dsh 安装(官方 CLI npm i -g @deepseek-ai/dsh,或源码启动 pnpm dsh)。

# 1. 安装到 web profile(自动初始化 profile、安装依赖、注册补丁层)
dsh plugin --profile web add dsh-token-pricing

# 2. 启动(已在运行则重启后生效)
dsh web

dsh plugin add 走官方插件机制:把本包装进 $DSH_HOME/profiles/web/ 的依赖 → 依据 dsh.bundle 声明加入 profile 补丁层 → 补丁层的一行 row 同时挂载 node 半身(Host)与浏览器半身(dsh.client 扫描)。本包只声明两个自用运行时依赖(schemastery、zod);其余 @deepseek-ai/dsh-* 由 dsh 安装本身提供(官方机制的双锚点解析),因此安装不会拉取任何内部包。

验证安装:启动后打开 设置 → 模型定价 配置价格;右下角出现费用小球,对话底部数据栏显示费用读数。

更新与卸载:

dsh plugin --profile web update dsh-token-pricing
dsh plugin --profile web remove dsh-token-pricing

npm 之外,也可用 git 源安装(装某个分支/提交;仓库内已提交构建好的 lib/):

dsh plugin --profile web add github:LightClear/dsh-token-pricing

注意事项:

  • 若 profile 中已存在 id 为 token-pricing 的插件行,安装后会产生冲突——移除其一即可。
  • 若需要把插件直接编译进 harness 主仓库(开发/集成),见 INTEGRATION.md。

功能亮点

配置模型价格与高峰时段规则

设置页:展示具体模型的设置页面,读取已设置的模型配置,并配置模型价格与高峰期计价规则

设置 → 模型定价 把模型目录按提供方分组为卡片,每个模型带已配置/未配置圆点。展开某个模型打开编辑器,自动载入已存配置,可编辑三档基础费率——输入未命中、输入命中、输出(美元/每百万 token)——以及高峰期计价规则:启用高峰定价后,可按需增删任意多个高峰时段(添加高峰时段 / 删除时段),全部时段共享一套高峰费率。默认只有一段,时段支持跨午夜(22:00–08:00),当前时间落入任一时段即按高峰价计费。

会话底部数据栏的实时费用

会话底部数据栏:展示对话框底部数据区域的计价数据

对话框底部数据栏在出厂统计行旁显示会话的 输入 $X · 输出 $Y · 总计 $Z。每一步按自身时间、在其派发路由下计价,读数对每个已计价步骤求和,因此与浮窗总计永远一致;未配置计价路由的用量不计入该数字。

可折叠、可拖拽的费用浮窗

费用浮窗折叠态:右下角小球显示会话总费用

折叠态是小球形状,显示当前会话的累计费用;点击小球展开面板。

费用浮窗展开态:完整窗口,含标题栏、视图切换与底部总计

展开态面板包含两个视图切换页签与底部总计栏。标题栏(顶部)与总计栏(底部)都是拖拽区域。

按轮计价与按模型计价

悬浮窗提供两种计价方式:按对话轮数计价与按模型计价。

费用浮窗的按轮计价页面

「按轮计价」按对话轮次列出每轮(轮次号与开始时间)使用的路由、token 数与费用;一轮中途切换模型时按路由拆分为多行。

费用浮窗的按模型计价页面

「按模型计价」按会话中使用过的所有模型聚合 token 数与费用,按首次使用顺序排列。两种视图中,未配置计价规则的模型仍显示 token 数并提示 未设置计价。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-desktop 下一个 Next dsh-skin-blue-whale →