前言¶
在 DeepSeek Harness(DSH)的 Composer 裏切換模型時,原生模型按鈕會把各 Provider 的模型名攤成一張扁平列表。配置了兩個以上 Provider 之後,光看模型名往往分不清屬於哪家;要改 base URL、API Key 或模型列表,又得離開當前對話去 Settings 裏找菜單。
下面介紹社區插件 dsh-provider-model-switcher:在不動平臺原有控件的前提下,把當前選型標成 provider · model,並在 Composer 旁加一套按 Provider 分組的 picker,方便展開選模型、一鍵跳轉 Settings → Models。
這是什麼¶
dsh-provider-model-switcher 是面向 DSH Composer 的純客戶端、純增量插件:不替換平臺自帶的模型位,只增強展示與切換路徑。讀寫走與會話綁定的 ctx.modelDirectories,與原生控件同一套實例,在此處的切換會立刻反映到原生按鈕上。
- 倉庫:bingying-project/dsh-provider-model-switcher
- 維護者:bingying-project
- 分類:模型推理(DSH 插件目錄中的歸類)
- 許可證:MIT(見倉庫)
- 當前包版本:1.0.0(
package.json) - 宿主要求:DSH
0.2.2-rc.1或兼容的0.2.x構建(engines.dsh:^0.2.2-rc.1)
插件目錄頁(社區站點,與 DeepSeek / 幻方無官方從屬):
https://www.skillhub.cn/plugins/bingying-project/dsh-provider-model-switcher
核心功能¶
README 中歸納的兩點能力如下。
1. 原生模型位標籤變爲 provider · model¶
觸發按鈕上會同時顯示 Provider 與模型名,避免在扁平列表裏「對不上號」。
2. 左側 Provider 優先的 picker¶
- 每個已配置的 Provider 佔一行;展開行可列出該 Provider 下的模型,單擊切換。
- 每行帶 Edit,直接進入 Settings → Models,改 base URL、Key 或模型列表,無需在菜單裏逐層找。
- 面板右上角也可點 Models settings 進入同一設置頁。
兼容與降級行爲¶
- 無 host capability、無網絡請求、無遙測。
- 對
modelDirectories、locale、shortcuts等可選服務先做探測;缺失時相關能力降級爲 no-op,不拖垮 Composer。 engines.dsh限定測試過的宿主範圍;不匹配時由插件管理器報出版本衝突,而非強行加載。
安裝與啓用¶
需要 Node >=20(插件包 engines.node),以及上文的 DSH 版本。
側邊欄(推薦)¶
- 在 DSH 側邊欄打開 Plugins。
- 點擊 Add plugin,輸入
dsh-provider-model-switcher,再 Enable now。
Bundle 會自動啓用,無需改配置文件。
CLI¶
dsh plugin --profile desktop add dsh-provider-model-switcher
從 Git 安裝第三方包¶
在 Add plugin → Install a third-party plugin 中粘貼下列任一形式(不要只寫 owner/repo,DSH 會把它當成 registry 包名而拒絕):
github:bingying-project/dsh-provider-model-switcher
https://github.com/bingying-project/dsh-provider-model-switcher
若要釘住發行版,可在 URL 後加 fragment,例如:
github:bingying-project/dsh-provider-model-switcher#v1.0.0
本地 tarball 或目錄¶
在 Add plugin → Install a third-party plugin 粘貼絕對路徑,或:
dsh plugin --profile desktop add /absolute/path/to/dsh-provider-model-switcher-1.0.0.tgz
典型用法¶
啓用後:
- Composer 上的模型按鈕文案爲
provider · model。 - 點擊其左側滑塊圖標,打開 Provider 優先的 picker。
- 點擊某 Provider 行展開模型列表;點擊模型名完成切換。
- 在某 Provider 行點 Edit,或面板右上角 Models settings,打開 Settings → Models。
卸載可用側邊欄 Plugins 關閉 bundle,或執行:
dsh plugin --profile desktop remove dsh-provider-model-switcher
卸載後 Composer 恢復默認行爲,不改動其他文件。
適用場景與注意¶
適合誰: 常在 DSH 裏配置多個推理 Provider、需要在對話中快速分辨「當前用的是誰家的哪個模型」,並頻繁回到模型設置頁改 Key 或模型列表的開發者。
使用注意:
- 插件以當前 DSH 進程/客戶端上下文運行;安裝前建議自行瀏覽倉庫源碼與 MIT 許可證,確認符合你的安全與合規要求。
- DSH 生態主張「一切皆插件」;目錄站與 GitHub 上的條目由社區維護,安裝第三方插件時請自行評估來源。
- 本文安裝命令與行爲描述均來自項目 README 與
package.json;宿主小版本若與^0.2.2-rc.1不一致,以插件管理器的兼容性提示爲準。
結尾¶
dsh-provider-model-switcher 不替代平臺控件,只在 Composer 旁補上 Provider 維度的可讀性與設置捷徑,讀寫仍走官方 modelDirectories。若你正被「扁平模型列表 + 離開對話找設置」折騰,可按上文步驟從側邊欄或 CLI 啓用。
- 目錄頁:https://www.skillhub.cn/plugins/bingying-project/dsh-provider-model-switcher
- GitHub:https://github.com/bingying-project/dsh-provider-model-switcher