deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Dasooul03/dsh-plugin-deepseek-pricing
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
技术包名:
dsh-plugin-deepseek-pricing
DeepSeek 官方模型实时定价查询、会话费用统计与费用预估的 DSH(DeepSeek Harness)插件。单一插件包同时提供 Agent 工具与 Web 定价面板。
deepseek_pricing:查询 DeepSeek 官方模型实时定价(每 1M tokens,缓存命中/未命中输入、输出)at 参数按任意时刻评估、refresh 强制同步官方定价页estimate_cost:按输入 token(拆分缓存命中/未命中)+ 输出 token 预估一次调用费用,
自动套用当前峰谷价,输出 USD 与约合 CNY;也支持传 text 由文本长度粗略预估输入 tokeninputTokens 缓存未命中、cacheReadTokens 缓存命中、outputTokens 输出)
按该消息自身的 time 时间戳取当时生效的峰谷价格逐条计价后求和deepseek-v4-flash / deepseek-v4-pro),未知模型自动回退并注明# 1) 安装依赖
cd dsh-plugin-deepseek-pricing && npm install
# 2) 软链到 dsh profile 共享的 node_modules(所有 profile 通用)
ln -s "$PWD/dsh-plugin-deepseek-pricing" ~/.dsh/profiles/node_modules/dsh-plugin-deepseek-pricing
# 3) 在 profile 的 cordis.patch.yml 中登记 entry
# ~/.dsh/profiles/web/cordis.patch.yml(追加到顶层数组)
- insert:
- id: deepseek-pricing
name: dsh-plugin-deepseek-pricing
config:
liveSync: true
cacheTtlMs: 1800000
cnyRate: 7.2
headless profile 同样登记(仅 Agent 工具生效,无 Web 面板)。 需要 pnpm 时也可用
dsh plugin --profile web add <包路径>安装。
| 改动 | 生效方式 |
|---|---|
客户端 bundle(lib/client.js) |
刷新浏览器页面即可 |
host 端代码(lib/index.js / lib/ui.js,如新增路由) |
重启 dsh web |
cordis.patch.yml 配置 |
热重载,无需重启 |
| 字段 | 默认值 | 说明 |
|---|---|---|
liveSync |
true |
是否从官方定价页实时同步(失败自动回退内置表) |
pricingSourceUrl |
官方定价页 | 数据源地址 |
cacheTtlMs |
1800000 | 同步结果缓存时长(毫秒) |
fetchTimeoutMs |
8000 | 拉取超时(毫秒) |
cnyRate |
7.2 | 费用换算的 USD→CNY 参考汇率(界面人民币显示与预估均使用) |
customPricing |
null |
完整定价文档覆盖(结构见 DEFAULT_PRICING,含 periods 数组) |
| 文件 | 内容 |
|---|---|
lib/index.js |
插件入口:配置、共享定价状态(TTL 缓存)、Agent 工具注册、apply() |
lib/pricing.js |
定价数据模型与纯函数(峰谷判定、周期解析、官方页 HTML 解析、费用数学) |
lib/ui.js |
Web 路由(快照 / 会话费用)与快照、逐轮费用计算(host 半边) |
lib/client.js |
浏览器 bundle:侧边栏定价面板(经 dsh.client 声明动态加载) |
在任意对话中可直接让 Agent 查询或估算:
「查询 deepseek-v4-flash 当前是高峰价还是谷时价,每百万 token 多少钱」 「估算一下:deepseek-v4-pro,输入 5 万 token(其中 1 万缓存命中)+ 输出 2 万 token,要多少钱」
cd dsh-plugin-deepseek-pricing && npm install && node test/smoke.mjs
测试覆盖:峰谷时段边界、周期切换、费用数学、官方页面 HTML 解析、按时间戳逐轮计价、 未知模型回退、会话费用路由(活动会话/持久化兜底)、客户端 bundle 工厂、工具注册。
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。