deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
sun-zihang/dsh-cost-overlay
DeepSeek API cost overlay for the dsh web GUI: top-center floating bar with current unit prices (yuan/1M tokens, peak/off-peak) and the session's accumulated cost from real token usage (cache-hit aware). dsh plugin.
PROJECT TOPICS
PROJECT README
DeepSeek Harness Web GUI 插件:在屏幕正上方中间悬浮显示当前模型的 DeepSeek API 单价(元/百万 token,区分高峰/空闲时段与缓存命中/未命中),并按当前会话的 真实 token 用量(输入/输出/缓存命中)实时累计显示本会话花费。数据全部来自 DSH 运行时,无需 API Key。
| 模型 | 时段 | 缓存命中 | 未命中 | 输出 |
|---|---|---|---|---|
| deepseek-v4-flash | 平峰(8/17 前) | 0.02 | 1.0 | 2.0 |
| deepseek-v4-flash | 空闲(8/17 起) | 0.05 | 1.5 | 4.5 |
| deepseek-v4-flash | 高峰(8/17 起) | 0.10 | 3.0 | 9.0 |
| deepseek-v4-pro | 平峰(8/17 前) | 0.025 | 3.0 | 6.0 |
| deepseek-v4-pro | 空闲(8/17 起) | 0.15 | 4.5 | 13.5 |
| deepseek-v4-pro | 高峰(8/17 起) | 0.30 | 9.0 | 27.0 |
价格来源:DeepSeek 官方价格页。 官方调价后可在插件设置中覆盖,无需改代码。
src/index.ts):注册 deepseekCost 会话投影(折叠
request/header 取模型、assistant/chunk / assistant/message 取精确用量,
按模型分账并计价),注册插件设置区,提供 loopback-only 的重新计算路由。src/core/pricing.ts):纯函数价格模型,host 与浏览器共享。src/client/):顶部悬浮条(fixed portal,读当前会话的
deepseekCost 投影,事件驱动刷新 + 时段定时器)、设置卡(web-ui.plugin.item
槽位)。pnpm install && pnpm build && pnpm pack
将生成的 dsh-cost-overlay-0.1.0.tgz 加入 DSH web profile:
{
"dependencies": { "dsh-cost-overlay": "file:/abs/path/dsh-cost-overlay-0.1.0.tgz" },
"dsh": { "profile": { "bundles": [ "...", "dsh-cost-overlay" ] } }
}
在 profile 目录执行 pnpm install,重启 dsh web 后生效。插件行由包内
cordis.patch.yml 插入,不修改 DSH 源码。
pnpm install # 依赖(store/cache 均指向 D 盘)
pnpm typecheck # tsc --noEmit
pnpm test # vitest(计价 + 投影折叠单测)
pnpm build # tsc 声明 + tsdown(lib/index.js + lib/client.js)
Apache-2.0
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。