前言¶
在 DeepSeek Harness(DSH)中,思考強度不是任意運行時開關,而是嚴格的模型能力聲明(reasoningEfforts)。官方目錄中的模型(如 DeepSeek Reasoner、OpenAI o1/o3)自帶該聲明,在 DSH 的模型選擇器中會直接顯示二級菜單「Reasoning Effort >」。但第三方或自定義模型(如 StepFun 的 step-5-preview、智譜的 glm-5.3,或代理網關)在 DSH 的自定義模型設置界面中不暴露 reasoningEfforts 字段,導致 DSH 將其當作純文本模型處理,隱藏了思考強度選擇器。若強行發送參數,上游網關會返回 UNSUPPORTED_REASONING_EFFORT 錯誤。
dsh-think-intensity 是一個 DSH 思考強度策略插件,通過在已聲明模型中補充 reasoningEfforts 聲明,讓 DSH 原生顯示「Reasoning Effort >」菜單。插件由 fengzhiyushui 維護,當前版本爲 0.1.0,採用 MIT 許可證。
插件定位¶
- 名稱:dsh-think-intensity
- 維護者:fengzhiyushui
- 分類:模型推理
- 倉庫:https://github.com/fengzhiyushui/dsh-think-intensity
- 簡介:在模型已有檔位之上決定每次請求用哪一檔思考強度,支持可觀測、可回滾
核心功能¶
- 原生菜單激活:通過補充
reasoningEfforts聲明,讓 DSH 在模型選擇器中顯示「Reasoning Effort >」二級菜單。插件不使用浮層或自定義滑塊,而是完全使用 DSH 官方原生 UI 組件。 - 明確選擇優先級:當用戶在 UI 中手動選擇某一檔時,插件 100% 保持該選擇,不做覆蓋。
- 默認策略注入:當用戶未手動選擇時,插件根據配置注入默認檔位。支持全局默認檔位(
defaultLevel)、子代理會話專用檔位(subagentLevel)以及按任務目的映射(purposeLevels)。 - 自愈回退機制:在會話中自動記錄被上游網關拒絕的檔位,並在後續請求中避免重試,防止無限循環。
- 可逆與隔離:安裝與卸載不會留下殘留覆蓋,卸載後配置迴歸 DSH 原生行爲。
安裝與啓用¶
插件依賴 DSH 版本 >=0.1.7-rc.1 且 <0.3.0,Node.js 版本 >=22.19.0 或 >=24。推薦通過 npm 安裝。
- 安裝插件
桌面應用安裝:
dsh plugin --profile desktop add dsh-think-intensity
Web 應用安裝:
dsh plugin --profile web add dsh-think-intensity
- 通過 GitHub Release 標籤安裝(鎖定版本)
dsh plugin --profile desktop add github:fengzhiyushui/dsh-think-intensity#v0.1.0
- 通過本地目錄安裝
dsh plugin --profile desktop add /path/to/dsh-think-intensity
- 卸載插件
dsh plugin --profile desktop remove dsh-think-intensity
# 驗證卸載乾淨
dsh --profile desktop --dump-config
典型用法¶
- 配置文件路徑
DSH 在各操作系統下將配置補丁存儲在對應配置文件中:
| OS | Desktop App (desktop profile) |
Web App (web profile) |
|---|---|---|
| Windows | %USERPROFILE%\.dsh\profiles\desktop\cordis.patch.yml |
%USERPROFILE%\.dsh\profiles\web\cordis.patch.yml |
| macOS | ~/.dsh/profiles/desktop/cordis.patch.yml |
~/.dsh/profiles/web/cordis.patch.yml |
| Linux | ~/.dsh/profiles/desktop/cordis.patch.yml |
~/.dsh/profiles/web/cordis.patch.yml |
- 基礎配置示例
在對應配置文件中添加 think-intensity 插件配置:
- id: think-intensity
config:
defaultLevel: high # 未手動選擇時的全局默認檔位;空 = 不干預
subagentLevel: max # 子代理會話的專用檔位;空 = 回退到 defaultLevel
providers: [] # 白名單路由;空 = 所有路由
purposeLevels: # 按內部任務目的映射檔位
compaction: low # 內存壓縮時降低思考強度以節省 token
session-title: off # 會話標題生成時不開啓思考
backfillEnabled: true # 自動回填缺失的 reasoningEfforts 聲明(默認爲 dry-run)
- 手動聲明 reasoningEfforts(不使用自動回填)
如果不想啓用自動回填,也可在 cordis.patch.yml 中手動爲模型添加 reasoningEfforts 字段:
- id: llm-pi-ai
name: "@deepseek-ai/dsh-llm-pi-ai"
config:
providers:
stepfun:
models:
- id: step-5-preview
name: step-5-preview
contextWindow: 1024000
reasoningEfforts:
off: null # off 表示不發送任何思考參數
low: low
medium: medium
high: high
max: max
重啓 DSH 後,模型選擇器中的「Reasoning Effort >」菜單將立即生效。
適用場景與注意¶
- 適用場景:需要爲第三方或自定義模型統一管理思考強度檔位、希望避免手動拼接
reasoningEfforts聲明,或在子代理、特定任務(如會話標題生成、內存壓縮)中差異化控制思考強度的場景。 - 注意事項:
- 插件以當前 DSH 進程權限運行,安裝前應檢查倉庫源碼與許可證(MIT)。
- 升級 DSH 時需確認版本範圍(>=0.1.7-rc.1 <0.3.0)與插件兼容性。
- 配置項中
defaultLevel與subagentLevel可爲空,此時插件不會干預,僅依賴 DSH 原生行爲。 - 插件通過
cordis.patch.yml修改配置,修改後建議重啓 DSH 以確保生效。
結尾¶
dsh-think-intensity 提供了一套可觀測、可回滾的思考強度管理方案,在不改變 DSH 原生 UI 交互的前提下,爲第三方模型補全能力聲明。如需查看更多細節或貢獻代碼,可訪問插件目錄頁或 GitHub 倉庫。