cdxiaodong/dsh-llm-inspector

cdxiaodong★ 2JavaScript最后同步: 2026-08-14

在 GitHub 打开

README 摘要

dsh-llm-inspector 统一 LLM 请求/响应检查器 —— DeepSeek Harness 插件 一个插件收编四类能力,全部通过配置开关:reasoning 控制、外部思考(think)导出、流量/包分析、会话落盘审计。 功能 功能 实现机制 配置项 reasoning 控制 挂 agent/request waterfall,改写 LlmCallConfig.reasoningEffort (关推理 / 调 budget) reasoningEffort 外部思考导出 注册 think 工具(schema 自动流入请求体)+ systemPrompt 注入"先调 think"指令,再从 llm/stream 抓回 thoughts 参数 externalThinking 流量/包分析 挂 llm/stream waterfall 拦截每个 chunk,按类型统计 token/字符、捕获 reasoning 与 tool-call 块 trafficAnalysis 会话落盘审计 订阅 session/event + 命中的流式块,写入 audit.jsonl persistSession 外部思考(external thinking)说明 对 明文返回 reasoning 的模型 (DeepSeek 等开源模型),本插件直接从 llm/stream 抓 reasoning 块,零侵入。 对 加密推理的模型 (OpenAI / Anthropic / Gemini),原生推理被厂商加密藏起。本插件复刻 oh-my-pi 的 externalThinking 思路: 1. reasoningEffort: 'none' 关掉原生隐藏推理; 2. 注册一个 think 工具(description 为 "private scratchpad; not shown to user"),其 schema 经 ctx.tools.register() 自动进入发往 LLM 的请求体; 3. 通过 systemPrompt.section() 注入"回答任何问题前必须先调用 think"的指令; 4. 模型把推理写进 think 的 thoughts 参数,本插件在 llm/stream 拦截该 tool-call 块并抓回、落盘。 ⚠️ 与 omp 的差异 :DSH 核心 LlmCallConfig 刻意裁剪了 tool choice ,因此本插件用 system prompt 强制 替代 omp 的 API 层 tool choice 强制。这意味着 think 触发是"软强制",触发率取决于模型遵循度,不保证 100%。这是上架前需实测验证的已知边界。 安装 配置 服务 插件对外提供两个 Service(可被其他插件 inject ): - ins…

在 GitHub 查看完整 README →
工具/开发dshdsh-pluginagent

分类