deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
PROJECT README
English | 中文
A cost-dashboard plugin for DeepSeek Harness (dsh): aggregates model input / output / cache token usage across all local sessions, prices it with a built-in table (including DeepSeek peak/off-peak time-of-day pricing), and renders a dashboard under Settings -> Cost Dashboard.
fx.cnyPerUsd rate (default 6.79)~/.dsh/cost-dashboard.json, effective immediately
dsh plugin --profile web add <spec>
<spec> may be a local path, an npm name, or a GitHub repo:
dsh plugin --profile web add /path/to/dsh-cost-dashboard
dsh plugin --profile web add github:mike-lee0120/dsh-cost-dashboard
dsh plugin add runs pnpm in the profile directory and automatically appends any dsh.bundle-declaring package to dsh.profile.bundles. Restart dsh web and refresh the page, then open Settings -> Cost Dashboard.
Remove with dsh plugin --profile web remove dsh-cost-dashboard.
Requires dsh 0.1.0-rc.7+ and Node >= 22.15 (the node:zlib zstd API the host itself relies on for session logs).
$DSH_HOME/sessions/*/*/ (session.jsonl.zstd, session.vN.jsonl.zstd, or plaintext .jsonl); the numerically highest published generation wins, exactly as the runtime reads it, so a migrated session is never billed from its frozen older generation. Nothing is written, no projection touched.@deepseek-ai/dsh-token-meter tokenUsage projection:assistant/chunk {type:'usage'} is an early sample that survives a later request failure;assistant/message usage (or the last usage chunk of its data.stream) is the final sample for the same (turn, step) and replaces it instead of double counting, and llm/retry-started closes that slot so a retried attempt adds on top;assistant/attempt settlements are billed even when no message followed;prompt_tokens with cache hits subtracted), cache read, cache write, output. Cache write is still folded and still prices cacheWrite rates, but no DeepSeek model produces that bucket, so the dashboard and its tables do not display it.assistant/message carries message.source.provider/model; a bare usage chunk (failed request) is attributed to the latest request/header model.parentSession), so its usage is folded into that session - the session table lists real sessions, each marked with how many subagents it absorbed. A log whose parent is missing keeps its own row and is badged as a subagent.node scripts/verify-totals.mjs: it reconciles against the official session_projcache.json (a point-in-time snapshot, so newer logs are skipped and said so), folds every selected log with the token meter's semantics, checks that a migrated session resolves to its highest format generation, and pins DeepSeek's official CNY rates plus the Beijing-time weekday peak window (an actively-writing session may drift by a live-write race, which is expected).Built-in pricing for 24 entries - 21 models plus three retired DeepSeek names - per 1M tokens, checked 2026-09-24; "hit" = cache-read rate, "write" = cache-write rate, defaults to the cache-miss input rate when unset. DeepSeek rates are the official CNY list prices (模型 & 价格); every other entry is shown in CNY after conversion:
CNY-listed models
| Model | Input (miss) | Input (hit) | Output | Notes |
|---|---|---|---|---|
| deepseek-v4-pro | 4.5 | 0.15 | 13.5 | peak doubles: 9 / 0.30 / 27 |
| deepseek-flash | 1 | 0.02 | 4 | peak doubles: 2 / 0.04 / 8 |
| deepseek-v4-flash | 1 | 0.02 | 4 | retired name, served by DeepSeek-V4.1-Flash |
| deepseek-v4-flash-vision-exp | 1 | 0.02 | 4 | retired name, same Flash rates |
| deepseek-v4.1-flash-expires-on-0910 | 1 | 0.02 | 4 | expired experimental id, same Flash rates |
| kimi-k3 | 20 | 2 | 100 | Moonshot China list price |
| qwen3.8-max | 12 | 1.5 | 36 | Alibaba Bailian China price |
| doubao-seed-2.1-pro | 6 | - | 30 | Volcengine Ark |
| hy3 | 1 | 0.25 | 4 | Tencent Hunyuan |
| minimax-m3 | 3.15 | 0.63 | 12.6 | ≤512K input, half-price list rate |
USD-listed models (converted to CNY for display)
| Model | Input (miss) | Input (hit) | Cache write | Output | Notes |
|---|---|---|---|---|---|
| gpt-5.6-sol | 5 | 0.5 | - | 30 | |
| gpt-5.6-terra | 2 | 0.2 | - | 12 | |
| gpt-5.6-luna | 0.20 | 0.02 | - | 1.20 | |
| gpt-5.5 | 5 | 0.5 | - | 30 | |
| gpt-5.4 | 2.5 | 0.25 | - | 15 | |
| gpt-5.1 | 1.25 | 0.125 | - | 10 | |
| claude-opus-5 | 5 | 0.5 | 6.25 | 25 | |
| claude-sonnet-5 | 2 | 0.2 | 2.5 | 10 | temporary rate through 2026-08-31, then $3/$15 |
| claude-fable-5 | 10 | 1 | 12.5 | 50 | |
| gemini-3.6-flash | 1.5 | - | - | 7.5 | |
| gemini-3.5-flash-lite | 0.3 | - | - | 2.5 | |
| grok-4.6 | 2 | - | - | 6 | |
| grok-4.6-fast | 4 | 1 | - | 12 | |
| glm-5.3 | 1.40 | - | - | 4.40 | Z.ai list price; override for the volcengine route |
The in-dashboard Pricing config editor saves ~/.dsh/cost-dashboard.json (per-model whole-entry overrides plus the FX rate):
{
"fx": { "cnyPerUsd": 6.79 },
"models": {
"glm-5.3": { "currency": "USD", "input": 1.4, "inputHit": 0.14, "output": 4.4 },
"my-local-model": { "currency": "CNY", "input": 2, "output": 6,
"peak": { "input": 4, "output": 12 }, "peakHours": [[9, 12], [14, 18]] }
}
}
Fields: fx.cnyPerUsd (USD->CNY, default 6.79, used to display USD-listed entries in CNY); per model currency (CNY|USD), input (cache-miss), inputHit (defaults to input), cacheWrite (defaults to input), output; optional peak with its window peakHours (Beijing-time hours), peakWeekdays (0 = Sunday, weekdays by default) and peakExcludeDates (Beijing-time YYYY-MM-DD, e.g. statutory holidays). Peak hours use peak rates and unset peak fields fall back to flat; weekends and excluded dates are off-peak all day.
fx).~/.dsh/storages/cost-dashboard-catalog.json; on network failure it degrades to the cache, the status is visible in the dashboard footer, and a "Refresh prices" button retries manually./user/balance (balance), OpenRouter /api/v1/key (credits), OpenAI Cost API (daily spend), Anthropic Cost Report (daily spend).~/.dsh/cost-dashboard-credentials.json (mode 0600):{
"providers": {
"deepseek": { "apiKey": "sk-..." },
"openrouter": { "apiKey": "sk-or-..." },
"openai": { "adminKey": "sk-admin-..." },
"anthropic": { "adminKey": "sk-ant-admin-..." }
}
}
Plain .mjs, zero build step (host uses only Node builtins; the client is a hand-written module-loader bundle; charts use the vendored ECharts 5 build, Apache-2.0, served locally from /cost-dashboard/vendor/echarts - no CDN). Restart dsh web and refresh the page after any change.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。