Repository navigation
Replies: 4 comments 1 reply
|
我也遇到这个问题了,我的dsh调查结果,似乎search会被认为是工具,而不会记录usage字段,dsh检查了底层程序,工具在调用api之后把返回的总结后的文本收下,把usage之类的东西全丢掉了 所以我让dsh写了个插件,截取search的工具过程,从中获取了usage单独记账了什么的,这个search大量使用的开销绝对非常大,所以现在只能让dsh暂时减少web_search使用了,相对比之下它只是可以减少上下文占用什么的,但是会出现坏账,目前好像只能靠额外插件解决,而且似乎按照现在的记录模式的话,似乎甚至没办法往里面记这个账的样子,因为现在的session文件结构根本没给工具留存usage的位置 话说GitHub的评论怎么对颜文字这么不友好,我的颜文字预览效果都好丑😭 |
0 replies
|
啊这 欢迎用https://github.com/drscrewdriver/dsh-union-search 走bing不要钱 |
1 reply
|
当初为了给deepseek web_search单独配置key方便观察,写了个插件,https://github.com/aaronlei/dsh-web-search-diy |
0 replies
|
哦?谢谢,我现在用的好像就是这个诶_(°ω°」∠)_
Graphienerg
***@***.***
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
摘要
我特意把会话主模型换成了
minimax1/MiniMax-M3.1-Flash,但web_search工具每次调用都在调 DeepSeek 自己的模型(deepseek-v4-flash,服务端web_search_20250305工具),而 UI 上没有任何地方提示这件事。更糟的是,这些调用的 token 用量在导出的 session 日志里一条都没有——因为它在代码层就被丢弃了。结果是:用户在自己的会话里看不到、归因不了、审计不了这笔开销;账单只能到 DeepSeek 控制台看,而控制台按
deepseek-flash归集,无法与任何具体会话对应。另外附带一个可能影响更广的发现:DeepSeek 一方接口的每次搜索,注入量约为第三方网关的 5.2 倍(下方数据),也就是说社区里流传的"一次搜索约 2,000 token"这个量级,对一方接口是不成立的。
环境
0.2.1-rc.2(桌面版,macOS arm64)desktopminimax1/MiniMax-M3.1-Flash(request/context事件确认,contextWindow 262144)dsh-web-search-deepseek(ctx.web未配置searchProvider,"恰好一个可用提供方"自动选中)deepseek-v4-flash@https://api.deepseek.com/anthropic/v1/messages,max_tokens: 4096、max_uses: 5、thinking: disabledminimax1,故走DEEPSEEK_API_KEY,记在 API Key 账上,不是账号额度现象
两个会话(同一调研任务的两次运行),主模型都是 MiniMax:
web_search工具调用session-df66b404session-75de343e但这两个父会话的 GUI 导出包并不覆盖全部会话。改用本地归档
~/.dsh/sessions/**/*.session.v4.jsonl.zstd(含全部父会话与子 Agent 会话,2026-09-22 ~ 2026-10-21 共 57 个会话文件)重新统计:去重按
(time, 查询文本)指纹比对,2,717 条零重复。上表 1,833 是这两个父会话自身发出的次数;全量 2,717 次里有相当一部分来自同期的其它会话。
DeepSeek 控制台 2026-10-21 的计费:
摊到单次搜索(按 10-21 当天 2,470 次):
为什么能断定这 28,769,009 token 全部来自搜索通道:当天 41 个
request/context事件的 provider 全部是minimax1,零个 DeepSeek 主模型会话——也就是说我自己一次 DeepSeek 主模型都没调用,这笔账只可能来自搜索。与官方价目对账(DeepSeek 价目表,峰时:输入未命中 ¥2/M、输入命中 ¥0.02/M、输出 ¥8/M):
偏差 0.03%——账单可以被搜索通道 100% 解释。峰时窗口为北京时间工作日 9:00–12:00 / 14:00–18:00,而 10-21 这两次运行正落在 14:58–16:47(= 06:58–08:47 UTC),与峰时吻合。
根因
用量在代码层就被丢弃了,不是"日志没记":
packages/web/web-search-deepseek/src/index.ts事件侧只有
recordRequest,只记请求体三键(endpoint/apiVersion/body),没有recordUsage。于是web/deepseek-search-llm-request事件的data里永远没有 usage。UI 不暴露搜索 provider。模型选择器只反映主模型,
ctx.web的 provider 选择对用户不可见;dsh-web的 README 写明"未设置时仅在恰好一个可用时自动选择",而发行版只随包发布了一个搜索提供方(README 示例里的dsh-web-search-exa并未随包发布),所以等价于"强制走 DeepSeek"。存在不烧模型 token 的替代后端,但开关默认关闭。
dsh-web-deepseek-api提供专用 Search/Fetch API(https://api.deepseek.com/v1/tools/search),"每次操作只发起一次直接请求,无需辅助模型请求"。UI 路径是 插件 → 官方分组 → 网页搜索 → 「启用新版 Web 搜索 API」,默认关闭(关闭时 = Messages 模式 = 每次搜索烧一次模型轮次)。影响
deepseek-flash归集,无法与具体会话对应——这次我是靠 session 日志里的web/deepseek-search-llm-request事件反推才定位到的。建议
mapAnthropicResponse透传response.usage,事件侧补recordUsage(或扩展web/deepseek-search-llm-request带上响应 usage)。这样导出的 session 就能自证成本。<provider>提供",并显示该 provider 的 token 累计值,让"设了主模型"不再等于"只会用到主模型"。复现步骤
minimax1/MiniMax-M3.1-Flash,~/.dsh/profiles/desktop/cordis.patch.yml中web插件不设searchProvider。web_search工具调用。web/deepseek-search-llm-request事件:能看到body.model = "deepseek-v4-flash"和完整请求体,但data里没有 usage。deepseek-flash计费行——对得上,但 session 里没有任何线索指向它。~/.dsh/sessions/**复核全量搜索次数(本次 2,717 次),确认 GUI 导出包只覆盖其中一部分。English summary
web_searchsilently routes to DeepSeek's own model (deepseek-v4-flash) via the server-sideweb_search_20250305tool, while the session's main model is MiniMax. Worse, the token usage of those calls is discarded in code (mapAnthropicResponse()returns only{sources, truncated}and never readsresponse.usage; the event side hasrecordRequestbut norecordUsage), so the exportedsession.v4.jsonlcontains no usage for any of them.Correction to the first version of this post: the initial 1,833 count came only from the two parent sessions in the GUI export. Re-counting over the full local archive (
~/.dsh/sessions/**, 57 session files) gives 2,717 searches for 2026-09-22 ~ 2026-10-21, of which 2,470 fall on 2026-10-21 — the day DeepSeek's console shows 28,769,009 tokens / ¥68.30 charged todeepseek-flash. Deduplicated by(time, query text); zero duplicates.That attribution is exact rather than inferred: all 41
request/contextevents that day carry providerminimax1— zero DeepSeek main-model sessions — so the entire bill can only come from the search channel. Priced at DeepSeek's own peak rates (input cache miss ¥2/M, input cache hit ¥0.02/M, output ¥8/M) the same 28,769,009 tokens come to ¥68.28 vs the ¥68.30 actually billed — a 0.03% deviation. Amortized, that is ~11,647 tokens per search, about 5.2× the 2,059 measured for the same model family through a third-party gateway, so DeepSeek's first-party endpoint appears to inject substantially more page content per search. For scale: the main model's non-cached usage that day was 12,810,409 tokens — the hidden search channel was 2.25× that.Asks: (1) record
response.usagein the session event so search cost is auditable; (2) surface the active search provider and its cumulative spend in the UI, since picking a main model does not mean only that model is used; (3) consider defaulting the dedicated Search API on, which needs no auxiliary model request, or at least warn that Messages mode costs one model call per search.All reactions