Flonger/dsh-balance-vision ↗★ 0
dsh-balance-vision
DeepSeek 余额实时显示插件(含视觉模型): 在 dsh Web UI 输入框下方的统计条实时显示账户余额与本次对话的估算消耗, 内置 deepseek-v4-flash / deepseek-v4-pro / deepseek-v4-flash-vision-exp 官方峰谷定价
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Flonger/dsh-balance-vision说明文档
阅读完整 README ↗方式一:使用 DSH CLI 自动安装与配置(推荐)
DeepSeek Harness 自带的插件管理命令可以为您一键完成下载安装和修改配置文件:
dsh plugin --profile web add dsh-balance-vision
执行完毕后,重启 dsh web 即可生效。
配置模板
在 $DSH_HOME/profiles/web/cordis.patch.yml(或指定 profile 的 patch 文件)中覆盖配置。
模板 1:标准国内人民币账户(默认开箱即用 · 包含 DeepSeek V4 系列与视觉模型)
- id: dsh-balance-vision
config:
apiKey: '' # 留空自动复用 DEEPSEEK_API_KEY
apiKeyRef: DEEPSEEK_API_KEY
baseUrl: https://api.deepseek.com
warningThreshold: 10 # 余额 < 10 元显示黄色预警灯
dangerThreshold: 5 # 余额 < 5 元显示红色告急灯
refreshIntervalMs: 300000 # 服务器向 DeepSeek 拉取余额的查询间隔(单位: 毫秒 ms,300000ms = 5分钟)
clientPollIntervalMs: 30000 # 浏览器从本地读取缓存的刷新间隔(单位: 毫秒 ms,30000ms = 30秒)
timeoutMs: 8000 # 单次网络请求超时时间(单位: 毫秒 ms,8000ms = 8秒)
currency: CNY
prices:
deepseek-v4-flash: { cacheHit: 0.1, cacheMiss: 3, output: 9 }
deepseek-v4-flash-vision-exp: { cacheHit: 0.1, cacheMiss: 3, output: 9 }
deepseek-v4-pro: { cacheHit: 0.3, cacheMiss: 9, output: 27 }
deepseek-chat: { cacheHit: 0.1, cacheMiss: 1, output: 2 }
deepseek-reasoner: { cacheHit: 1, cacheMiss: 4, output: 16 }
defaultPrices: { cacheHit: 0.1, cacheMiss: 1, output: 2 }
模板 2:海外美元账户(USD 计价与小额阈值)
- id: dsh-balance-vision
config:
apiKey: ''
apiKeyRef: DEEPSEEK_API_KEY
baseUrl: https://api.deepseek.com
warningThreshold: 2.0 # 余额 < $2.0 显示黄色预警
dangerThreshold: 0.5 # 余额 < $0.5 显示红色告急
refreshIntervalMs: 300000 # 服务器拉取余额间隔(单位: 毫秒 ms,300000ms = 5分钟)
clientPollIntervalMs: 30000 # 浏览器读取缓存间隔(单位: 毫秒 ms,30000ms = 30秒)
timeoutMs: 8000 # 请求超时时间(单位: 毫秒 ms,8000ms = 8秒)
currency: USD # 计价货币切换为美元
prices:
deepseek-v4-flash: { cacheHit: 0.014, cacheMiss: 0.44, output: 1.32 }
deepseek-v4-flash-vision-exp: { cacheHit: 0.014, cacheMiss: 0.44, output: 1.32 }
deepseek-v4-pro: { cacheHit: 0.044, cacheMiss: 1.32, output: 3.96 }
defaultPrices: { cacheHit: 0.014, cacheMiss: 0.44, output: 1.32 }
模板 3:高频重度开发者(高缓冲安全档)
- id: dsh-balance-vision
config:
warningThreshold: 50 # 余额 < 50 元预警(留足多次长任务会话缓冲)
dangerThreshold: 10 # 余额 < 10 元告急