
Security News
Deno Goes the Way of the Dinosaur
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.
dsh-peak-indicator
Advanced tools
DeepSeek API 高峰/闲时(峰谷)计价标记插件 for DeepSeek Harness (DSH) Web。
安装后默认开启。 当会话上下文达到 100,000 tokens 时,插件会配置 DSH 内置
compaction-basic,将较早的对话折叠为摘要、保留最近约 15,000 tokens;不需要额外启动参数、
patch 或命令。这样后续每一步不必反复重读整段旧对话。
默认一次可从约 100k 上下文中移除约 85k tokens,因此在不计摘要自身长度的理想比较下, 后续每一步需要重读的历史上下文最多可减少约 85%。这节省的是后续请求的上下文输入费用, 不是整次请求的总费用:输出 tokens、保留的最近上下文和新生成的摘要仍会计费。
自动压缩不限 DeepSeek 模型:只要当前 DSH profile 提供 compaction-basic,DeepSeek、OpenAI、
Claude、Gemini 等长会话都可受益。插件会对内置价格表已知的模型或 config.prices 中自定义的模型
记录每一步的估算节省;未知模型仍会被压缩,但金额估算不可靠。
建议从平衡档开始:
在 DSH 设置中打开 插件 → 成本与上下文,即可实时调整开关、触发预算、保留 tokens 和参考窗口, 无需编辑 YAML 或重启。压缩会用摘要代替早期原文,涉及精确历史细节的任务应提高预算或保留更多 tokens。
在会话头部显示一个标记,标明当前处于 高峰时段 还是 闲时,并附带当前会话实际消耗费用 (保留两位小数)。鼠标悬停可查看当前模型在当前时段的 token 单价明细(输入/输出/缓存命中):
每轮聊天末尾还会显示本轮实际 token 消耗金额(如 本轮 $0.08,常显在消息统计行)。
价格表(MODEL_PRICES,来自 DeepSeek 官方价格页,单位 USD/百万 tokens):
| 模型 | 高峰 输入/输出/缓存命中 | 闲时 输入/输出/缓存命中 |
|---|---|---|
| deepseek-flash(V4.1-Flash) | 0.30 / 1.20 / 0.006 | 0.15 / 0.60 / 0.003 |
| deepseek-v4-pro | 1.32 / 3.96 / 0.044 | 0.66 / 1.98 / 0.022 |
会话与本轮费用由宿主侧 peakCost 会话投影计算:重放会话日志中的真实 token 用量,按每个事件
自身时间戳所处的时段(高峰/闲时)计价,缓存命中 token 按缓存价计算。
徽标仅在当前会话使用 DeepSeek flash/pro 模型时显示(provider 为 DeepSeek 且模型名含
flash 或 pro,如 deepseek-flash、deepseek-v4-flash、deepseek-v4-pro);使用其他模型时自动隐藏。
徽标会常驻显示距离下次切换的倒计时,并每 30 秒自动刷新;悬停可看到当前北京时间和完整价格明细(含缓存命中价)。
价格表按插件版本固定,插件不会在每次请求时联网抓取价格:这样历史会话可以按当时版本和事件时间稳定重放,
官方调价后发布新插件版本更新即可;自定义模型仍可通过 config.prices 覆盖。当前数据来自
DeepSeek 官方模型与价格页,宿主端和浏览器端价格表需同步更新。
时段规则依据 DeepSeek 官方峰谷定价公告:峰值时段为工作日北京时间 09:00–12:00、14:00–18:00,
周末全天闲时;闲时价格为高峰时段的一半。V4.1-Flash 新价格自北京时间 2026-09-10 12:00 起生效,
旧模型名 deepseek-v4-flash 和 deepseek-v4-flash-vision-exp 均按 V4.1-Flash 价格计费。
插件包放入 ~/.dsh/profiles/web/node_modules/dsh-peak-indicator/(以及 dsh 安装目录的
node_modules/),并在 ~/.dsh/profiles/web/cordis.patch.yml 增加:
- insert:
- id: peak-indicator
name: 'dsh-peak-indicator'
刷新浏览器(Ctrl+Shift+R)后,会话头部即可看到徽标。
>=22.13.0>=0.1.0-rc.7;已验证兼容 rc.7、rc.8、0.1.1-rc.1 和 0.1.1-rc.2。web在隔离的临时 Profile 中,依次执行安装、启动和卸载即可复核插件生命周期。启动时可使用 --port 0
让 DSH 自动选择空闲端口,避免占用日常 Web Profile 的端口;不要在验证期间停止或修改正在使用的 Profile。
dsh plugin --profile <temporary-profile> add dsh-peak-indicator@<version>
dsh --profile <temporary-profile> --dump-config
dsh --profile <temporary-profile> --port 0
dsh plugin --profile <temporary-profile> remove dsh-peak-indicator
已在 macOS、Node.js v24.10.0、DSH 0.1.1-rc.2 的 Web Profile 完成配置加载,并以随机端口和默认端口启动验证。实际操作记录应保留 DSH 版本、Node.js 版本、系统、Profile 名称和每一步结果;
未执行的运行验收不应标注为“通过”。
默认无需任何配置。如需调整时段(政策变更时),可在 patch 条目中传:
- id: peak-indicator
name: 'dsh-peak-indicator'
config:
peakWindows: [[9, 12], [14, 18]]
beijingOffsetMinutes: 480
offPeakDiscount: 0.5
policyEffectiveDate: '2026-08-17T00:00:00+08:00'
weekendOffPeakEffectiveDate: '2026-08-23T00:00:00+08:00'
v41FlashEffectiveDate: '2026-09-10T12:00:00+08:00'
注意:浏览器端的徽标计算使用与官方价格页一致的内置时段(工作日北京 09:00–12:00、14:00–18:00;周末全天闲时),
host 配置主要用于程序化调用 ctx.peakIndicator.current()。
默认无需配置;如需在 profile 中固定参数,可在 patch 条目中传入:
- insert:
- id: peak-indicator
name: 'dsh-peak-indicator'
config:
autoCompact:
enabled: true # 默认开启;填 false 可关闭
contextBudget: 100000 # 上下文超过该 token 数即压缩
retainTokens: 15000 # 压缩后保留最近 tokens
referenceWindow: 256000
FAQs
DeepSeek API 高峰/闲时(峰谷)计价标记 for DSH Web: 会话头部显示当前处于高峰还是闲时(半价)时段
We found that dsh-peak-indicator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.

Security News
On Front Lines’ Early Adopters: CISO podcast, Andrew Becherer shares lessons from Datadog, weighs the long-term costs of AI-built tools, and explains how founders can actually gain a CISO’s trust.