dsh-token-usage-ledger 0.0.0-stage → 0.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1081 -0
- package/LICENSE +21 -0
- package/README.md +247 -2
- package/cordis.patch.yml +30 -0
- package/docs/token-usage-image01.png +0 -0
- package/docs/token-usage-image02.png +0 -0
- package/lib/client.js +4469 -0
- package/lib/host/aggregate.d.ts +132 -0
- package/lib/host/aggregate.js +840 -0
- package/lib/host/api.d.ts +118 -0
- package/lib/host/api.js +346 -0
- package/lib/host/backfill.d.ts +54 -0
- package/lib/host/backfill.js +265 -0
- package/lib/host/collector.d.ts +139 -0
- package/lib/host/collector.js +441 -0
- package/lib/host/ledger-io.d.ts +125 -0
- package/lib/host/ledger-io.js +211 -0
- package/lib/host/operation-error.d.ts +22 -0
- package/lib/host/operation-error.js +28 -0
- package/lib/host/paths.d.ts +35 -0
- package/lib/host/paths.js +63 -0
- package/lib/host/pricing-module.d.ts +112 -0
- package/lib/host/pricing-module.js +63 -0
- package/lib/host/pricing-modules/deepseek-2026-09-10.d.ts +31 -0
- package/lib/host/pricing-modules/deepseek-2026-09-10.js +67 -0
- package/lib/host/pricing-modules/index.d.ts +27 -0
- package/lib/host/pricing-modules/index.js +30 -0
- package/lib/host/pricing.d.ts +192 -0
- package/lib/host/pricing.js +287 -0
- package/lib/host/records.d.ts +47 -0
- package/lib/host/records.js +116 -0
- package/lib/host/runtime-marker.d.ts +67 -0
- package/lib/host/runtime-marker.js +71 -0
- package/lib/host/schema.d.ts +77 -0
- package/lib/host/schema.js +158 -0
- package/lib/host/store.d.ts +171 -0
- package/lib/host/store.js +337 -0
- package/lib/host/workspace-titles.d.ts +38 -0
- package/lib/host/workspace-titles.js +136 -0
- package/lib/host/zstd.d.ts +41 -0
- package/lib/host/zstd.js +134 -0
- package/lib/index.d.ts +82 -0
- package/lib/index.js +512 -0
- package/lib/shared/format.d.ts +415 -0
- package/lib/shared/format.js +714 -0
- package/lib/shared/protocol.d.ts +646 -0
- package/lib/shared/protocol.js +129 -0
- package/package.json +87 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mizukishun
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,248 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-token-usage-ledger
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> 兼容基线:dsh `0.2.2-rc.2`(2026-11-12)。需要带 Web 界面的 dsh(桌面版或 `dsh web`)。
|
|
4
|
+
> 数据只保存在本机:插件不联网、不上报。许可证:MIT。
|
|
5
|
+
|
|
6
|
+
**给 DeepSeek Harness(dsh)用的 Token 用量账本与统计看板。**
|
|
7
|
+
|
|
8
|
+
它会在每一轮对话结束后,自动把这一轮消耗的 token 与折算费用记到本地账本里,并在 dsh 侧栏提供一个看板:累计用量、日历热力图、Token / 费用趋势、按模型与按工作区的明细。安装后不需要任何操作,聊过的每一轮都会自动记账。
|
|
9
|
+
|
|
10
|
+
## 效果预览
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
*看板上半部分:累计 Token / 费用 / 轮次、缓存命中率、固定 365 天的日历热力图,以及 Token 与费用趋势。顶部可切换工作区、接入方、模型、粒度和日期范围。*
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
*继续向下:缓存命中率趋势、调用与轮次效率、24 小时活跃时段、Agent 模式以及高峰 / 空闲占比。截图使用深色主题,浅色主题同样适配。*
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 功能
|
|
23
|
+
|
|
24
|
+
- **自动记账**:每轮对话结束后记录 token 用量(未命中输入 / 缓存命中 / 缓存写入 / 输出 / 推理)、费用、时间、工作区、模型与接入方、会话与轮次、Agent 模式。
|
|
25
|
+
- **侧栏入口**:左侧栏新增「Token消耗统计」,位置在「插件 / 自动化任务」下方、工作区列表上方。点击后中央面板切换到看板,右上角 `×` 返回对话。
|
|
26
|
+
- **总览卡片**:累计 Token、累计费用、累计轮次、缓存命中率、连续使用天数。
|
|
27
|
+
- **日历热力图**:固定展示最近 365 天,可「上一段 / 下一段 / 回到今天」翻看更早年份;深浅两套主题都适配。
|
|
28
|
+
- **趋势图**:Token 柱状图(堆叠显示缓存命中 / 未命中 / 写入 / 输出)与费用柱状图,支持按天 / 周 / 月切换。
|
|
29
|
+
- **筛选**:工作区、接入方(provider)、模型级联筛选;日期范围支持近 7 / 30 / 90 天、本月、全部与自定义区间。
|
|
30
|
+
- **明细表**:「按模型」会区分同一模型的不同接入方;「按工作区」按当前显示名合并同名工作区,可展开查看每条原始路径,并可「只看此路径」。
|
|
31
|
+
- **费用说明**:看板头部的 `i` 按钮会说明费用公式、峰谷时段、价格来源与估算口径。
|
|
32
|
+
- **更多统计**:轮次效率、调用次数 / 耗时分布、24 小时活跃时段、Agent 模式的费用与轮次、高峰 / 空闲费用占比。
|
|
33
|
+
- **备份与补录**:一键导出完整账本 JSON;导入只追加缺失记录(按「会话 + 轮次」去重);「补录」可扫描本机会话日志,把安装插件之前或停用期间漏记的轮次补进账本。
|
|
34
|
+
- **不影响对话**:只读取会话事件;采集或渲染出错只会在插件内部提示,不会影响对话,也不会影响 dsh 其它功能。
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 环境要求
|
|
39
|
+
|
|
40
|
+
| 项 | 要求 |
|
|
41
|
+
|---|---|
|
|
42
|
+
| dsh | `0.2.2-rc.2` 及以上(0.2.x,含桌面版与 `dsh web`)。低于该版本时 dsh 会在安装阶段直接拒绝 |
|
|
43
|
+
| 界面 | 需要 dsh 的 Web 界面(桌面应用或 `dsh web`);纯 headless 运行只能记账,看不到面板 |
|
|
44
|
+
| 系统 | Windows / macOS / Linux |
|
|
45
|
+
| 网络 | 安装时需要能访问 npm(推荐官方源);运行时不联网 |
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 安装
|
|
50
|
+
|
|
51
|
+
### 图形界面(推荐)
|
|
52
|
+
|
|
53
|
+
1. 打开 dsh,左侧点「插件」→「添加插件」。
|
|
54
|
+
2. 在「包名或地址」里输入:
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
dsh-token-usage-ledger
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
3. 安装源(Registry)选择 **npm 官方源 / Official npm registry**。
|
|
61
|
+
- 中国大陆镜像可能还没有同步刚发布的版本;自定义地址只用于私有源。
|
|
62
|
+
- dsh 会记住上一次的选择,安装前请确认当前选中项。
|
|
63
|
+
4. 点「安装」,等待完成。
|
|
64
|
+
5. **完全退出 dsh 再重新打开**(桌面版关窗口不够,要在托盘图标上退出)。插件在启动时加载,不重启不会生效。
|
|
65
|
+
|
|
66
|
+
### 命令行
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
dsh plugin --profile <profile> add dsh-token-usage-ledger
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
- 把 `<profile>` 换成你要安装到的 profile 名;不知道时用默认 profile 即可。
|
|
73
|
+
- 桌面版如果命令行里找不到 `dsh`,请直接用上面的图形界面方式。
|
|
74
|
+
- 命令行安装前请先完全退出 dsh,装完再重新打开。
|
|
75
|
+
|
|
76
|
+
装好后,左侧栏会出现「Token消耗统计」。**第一次对话结束之后**账本里才会有数据,安装完立刻打开看板为空是正常的。
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 使用
|
|
81
|
+
|
|
82
|
+
### 打开看板
|
|
83
|
+
|
|
84
|
+
左侧栏点「Token消耗统计」,中央面板显示看板;点右上角 `×` 返回对话。
|
|
85
|
+
|
|
86
|
+
### 看板内容
|
|
87
|
+
|
|
88
|
+
| 区域 | 说明 |
|
|
89
|
+
|---|---|
|
|
90
|
+
| 顶部卡片 | 累计 Token / 累计费用 / 累计轮次 / 缓存命中率 / 连续使用天数 |
|
|
91
|
+
| 日历热力图 | 最近 365 天的用量深浅;可翻页查看更早年份 |
|
|
92
|
+
| Token 消耗 | 按天 / 周 / 月的堆叠柱状图:缓存命中、未命中、写入、输出 |
|
|
93
|
+
| 费用 | 按天 / 周 / 月的费用柱状图 |
|
|
94
|
+
| 按模型 | 模型 + 接入方、token、轮次、费用;同一模型经不同接入方时分行显示 |
|
|
95
|
+
| 按工作区 | 工作区、轮次、token、费用;同名工作区合并,可展开原始路径 |
|
|
96
|
+
| 调用与轮次效率 | 每轮调用次数、耗时、中位数、90% 分位、会话数等 |
|
|
97
|
+
| 24 小时活跃时段 | 一天中各小时的活跃分布 |
|
|
98
|
+
| Agent 与时段 | 各 Agent 模式的费用 / 轮次,以及高峰 / 空闲费用占比 |
|
|
99
|
+
|
|
100
|
+
看板头部会显示当前插件版本。各模块右上角的 `i` 是口径说明。
|
|
101
|
+
|
|
102
|
+
### 筛选
|
|
103
|
+
|
|
104
|
+
筛选行从左到右是:工作区 → 接入方 → 模型 → 粒度 → 日期范围。
|
|
105
|
+
|
|
106
|
+
- 选定接入方后,模型下拉只列出该接入方下的模型;切换接入方会清空不属于新接入方的已选模型。
|
|
107
|
+
- 热力图使用自己的固定一年窗口,不跟随上面的日期范围(面板内会说明这一点)。
|
|
108
|
+
- 筛选只影响当前看板展示,不会改变账本内容。
|
|
109
|
+
|
|
110
|
+
### 备份、导入与历史补录
|
|
111
|
+
|
|
112
|
+
- **导出**:下载完整账本 JSON 备份。备份包含会话 ID、工作区路径等明细,请妥善保管。
|
|
113
|
+
- **导入**:先显示待导入记录数,确认后只追加缺失记录;同一「会话 + 轮次」会跳过,重复导入不会重复计数。
|
|
114
|
+
- **补录**:两阶段(扫描预览 → 确认补录)。用于补装插件之前的历史,以及停用期间漏记但日志仍可还原的轮次;重复执行是安全的。
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 数据与隐私
|
|
119
|
+
|
|
120
|
+
- 账本默认位于 `<dsh home>/token-usage/records.jsonl`,通常是 `~/.dsh/token-usage/records.jsonl`(Windows:`%USERPROFILE%\.dsh\token-usage\records.jsonl`)。一行一条 JSON,只追加。
|
|
121
|
+
- 看板通过 dsh 自带的 Web 服务读取一个本机端点(默认 `/dsh-token-usage`)。该端点受 dsh 的浏览器信任围栏保护:没有有效页面会话返回 401,主机校验不通过返回 403;响应不包含 CORS 头。
|
|
122
|
+
- 插件**不会**保存提示词、消息内容、附件或任何凭据;只记录 token 数量、模型 / 接入方、工作区路径、时间与金额。工作区**绝对路径**会出现在看板数据中(用于筛选与显示),这是有意的取舍。
|
|
123
|
+
- 插件不向任何外部服务器发送数据,也不会在运行时联网核对价格。
|
|
124
|
+
- 卸载插件**不会删除账本**;重新安装后继续使用同一份数据。
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## 费用是怎么算的
|
|
129
|
+
|
|
130
|
+
- 按 DeepSeek 官方公开价目估算(价目 id `deepseek-2026-09-10`,2026-09-13 核对,单位:每百万 token)。
|
|
131
|
+
- **峰谷时段**:周一至周五 09:00–12:00、14:00–18:00(北京时间)为高峰;其余时间(含周末)按高峰价的 50% 计算。判定按每次请求的结算时刻,与运行机器的时区无关。
|
|
132
|
+
- 缓存写入按「未命中输入」计价;推理 token 不单独计价(它是输出的一部分)。
|
|
133
|
+
- 默认人民币(CNY)。费用在记账时冻结:之后改价目或改币种,都不会改写历史记录。
|
|
134
|
+
- **这是估算,不是账单**:不包含账户级折扣、赠送额度等;请以 DeepSeek 官方账单为准。
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## 配置(可选)
|
|
139
|
+
|
|
140
|
+
插件默认不需要配置。如果需要改币种、价格或账本位置,在 dsh 的配置层里按行 id 覆盖即可。
|
|
141
|
+
|
|
142
|
+
1. 打开或新建文件:
|
|
143
|
+
|
|
144
|
+
- Windows:`%USERPROFILE%\.dsh\cordis.patch.yml`
|
|
145
|
+
- macOS / Linux:`~/.dsh/cordis.patch.yml`
|
|
146
|
+
|
|
147
|
+
2. 写入(示例:改成美元计价):
|
|
148
|
+
|
|
149
|
+
```yaml
|
|
150
|
+
- id: token-usage
|
|
151
|
+
config:
|
|
152
|
+
currency: USD
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
3. 完全退出并重新打开 dsh。
|
|
156
|
+
|
|
157
|
+
可用字段:
|
|
158
|
+
|
|
159
|
+
| 字段 | 默认值 | 说明 |
|
|
160
|
+
|---|---|---|
|
|
161
|
+
| `currency` | `CNY` | `CNY` 或 `USD`;官方中英文页面各自发布一套价格,不是汇率换算 |
|
|
162
|
+
| `dataDir` | `<dsh home>/token-usage` | 账本目录;建议用绝对路径,Windows 路径用正斜杠 |
|
|
163
|
+
| `fallbackModel` | `deepseek-flash` | 不认识的模型按哪个模型的价格估算(该轮会标为估算) |
|
|
164
|
+
| `models` | `{}` | 覆盖或新增模型的高峰价,每百万 token:`{ cacheHit, cacheMiss, output }` |
|
|
165
|
+
| `pricingModule` | 最新价目 | 指定价目 id;一般不需要改 |
|
|
166
|
+
|
|
167
|
+
示例:新增一个模型的价格。
|
|
168
|
+
|
|
169
|
+
```yaml
|
|
170
|
+
- id: token-usage
|
|
171
|
+
config:
|
|
172
|
+
models:
|
|
173
|
+
your-model: { cacheHit: 0.04, cacheMiss: 2, output: 8 }
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
> 配置写错不会让插件或对话加载失败:插件会把无法识别的值退回默认值。改完配置需要重启 dsh 才会生效。
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## 升级
|
|
181
|
+
|
|
182
|
+
- **图形界面**:左侧「插件」→ 找到本插件 → 打开版本列表 → 更新到新版本,然后**完全退出并重新打开** dsh。
|
|
183
|
+
- **命令行**:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
dsh plugin --profile <profile> add dsh-token-usage-ledger@latest
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
装完同样需要完全重启 dsh。
|
|
190
|
+
|
|
191
|
+
升级只替换插件代码,不会动账本。
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## 卸载
|
|
196
|
+
|
|
197
|
+
- **图形界面**:左侧「插件」→ 找到本插件 → 卸载,然后完全退出并重新打开 dsh。
|
|
198
|
+
- **命令行**:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
dsh plugin --profile <profile> remove dsh-token-usage-ledger
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
账本会保留在 `~/.dsh/token-usage/`。如果确定不再需要,可以手动删除该目录。
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## 常见问题
|
|
209
|
+
|
|
210
|
+
| 现象 | 处理 |
|
|
211
|
+
|---|---|
|
|
212
|
+
| 左侧栏没有「Token消耗统计」 | 确认安装成功后,**完全退出并重新打开** dsh;只刷新页面不够 |
|
|
213
|
+
| 看板是空的 | 账本还没有轮次:先聊一轮,或使用「补录」导入安装前的历史 |
|
|
214
|
+
| 费用显示为 0 或标记为估算 | 该模型没有内置价目,插件按 `fallbackModel` 估算;可在配置里用 `models` 补充价格 |
|
|
215
|
+
| 面板显示错误提示 | 插件渲染失败只影响本面板,不影响 dsh 其它功能;重启 dsh 后重试 |
|
|
216
|
+
| 升级后版本号没变 | 确认已更新到新版本,并完全重启 dsh |
|
|
217
|
+
| 导入或补录失败 | 导入只接受本插件导出的 JSON 备份;补录依赖本机会话日志,日志不可还原的轮次会被如实计为「无法判定」 |
|
|
218
|
+
| 想确认插件是否在运行 | 查看页面侧栏入口与看板头部的版本号是否出现 |
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## 已知限制
|
|
223
|
+
|
|
224
|
+
- 只统计**安装并启动之后**发生的轮次;安装前的历史需要用「补录」按钮从会话日志补出来。
|
|
225
|
+
- 费用是根据公开价目表与上报用量计算的**估算值**,不是官方账单。
|
|
226
|
+
- 同名工作区按显示名合并;需要精确区分时,展开原始路径或使用「只看此路径」。
|
|
227
|
+
- 同一模型经不同接入方接入时分行显示,不会自动合并。
|
|
228
|
+
- 账本只追加、不自动压缩或轮转;长期使用请定期导出备份,并按需归档该文件。
|
|
229
|
+
- 不统计 dsh 之外直接调用 DeepSeek API 的消耗。
|
|
230
|
+
- 数据只在本机,不跨设备同步。
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## English
|
|
235
|
+
|
|
236
|
+
**dsh-token-usage-ledger** records the token usage and estimated cost of every turn in DeepSeek Harness (dsh) into a local, append-only ledger, and adds a dashboard to the sidebar: summary cards, a 365-day calendar heatmap, token/cost charts, per-model and per-workspace tables, and export / import / backfill actions.
|
|
237
|
+
|
|
238
|
+
- **Requirements**: dsh `0.2.2-rc.2` or newer (0.2.x; desktop app or `dsh web`). The plugin is rejected at install time on older versions.
|
|
239
|
+
- **Install**: open dsh → **Plugins → Add plugin** → enter `dsh-token-usage-ledger` → choose the **official npm registry** → install → fully quit and reopen dsh.
|
|
240
|
+
- **Privacy**: all data stays on your machine; the plugin never sends it anywhere and never stores prompts, messages, attachments, or credentials.
|
|
241
|
+
- **Costs are estimates** based on DeepSeek's public price list, not your bill.
|
|
242
|
+
- **License**: MIT.
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## License
|
|
247
|
+
|
|
248
|
+
MIT
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# dsh-token-usage-ledger — 交付层(bundle 包随附的 patch)
|
|
2
|
+
#
|
|
3
|
+
# 安装方式(隔离验证见维护手册「构建与自测」):
|
|
4
|
+
# dsh plugin --profile <profile> add ./plugins/token-usage
|
|
5
|
+
# 随后该包会进入 profile 的 dsh.profile.bundles,重启 dsh 后生效。
|
|
6
|
+
#
|
|
7
|
+
# ⚠️ 安装/发布前先 `npm run build`:main = lib/index.js(编译产物),
|
|
8
|
+
# exports["./client"] = lib/client.js(esbuild 闭包工厂 bundle)。
|
|
9
|
+
# Node 在 node_modules 下拒绝执行 .ts,未构建会解析不到入口。
|
|
10
|
+
#
|
|
11
|
+
# 行 name 用【包名】,Node 按 package.json 的 main 解析。
|
|
12
|
+
- insert:
|
|
13
|
+
- id: token-usage
|
|
14
|
+
name: dsh-token-usage-ledger
|
|
15
|
+
# 本插件不导出 Config schema(零 dsh 运行时依赖,见 README「设计取舍」),
|
|
16
|
+
# 下面的字段由插件自身校验并补默认值;留空即全部使用默认值。
|
|
17
|
+
# config:
|
|
18
|
+
# pricingModule: deepseek-2026-09-10 # 价格纪元 id(留空 = 最新;旧纪元可回切)
|
|
19
|
+
# currency: CNY # CNY | USD
|
|
20
|
+
# offPeakRatio: 0.5 # 空闲时段计价倍率
|
|
21
|
+
# peakOffsetMinutes: 480 # 峰谷计价时区相对 UTC 的分钟偏移(480 = 北京时间)
|
|
22
|
+
# fallbackModel: deepseek-flash # 未知模型的兜底价格
|
|
23
|
+
# dataDir: ~/.dsh/token-usage # 账本目录
|
|
24
|
+
# apiPath: /dsh-token-usage # 浏览器侧只读端点的路径前缀
|
|
25
|
+
# extraAllowedHosts: [] # 额外允许的 Host(默认仅回环地址)
|
|
26
|
+
# allowAnyHost: false # true = 关闭 Host 校验(仅在刻意对其它机器提供服务时使用)
|
|
27
|
+
# maxPendingWrites: 4096 # 写入队列上限
|
|
28
|
+
# debug: false # 输出详细日志
|
|
29
|
+
# models: # 按模型覆盖/新增价格(每百万 token,高峰价)
|
|
30
|
+
# deepseek-flash: { cacheHit: 0.04, cacheMiss: 2, output: 8 }
|
|
Binary file
|
|
Binary file
|