Back to home@SCT192221

dsh-multimodal

DeepSeek harness多模态插件,接近原生体验。

Stars
1
Language
JavaScript
Created
Aug 20, 2026
Updated
Aug 20, 2026
GitHub repo

Introduction

dsh-multimodal(DeepSeek Harness 多模态插件)

给 DeepSeek Harness 的文本模型补全视觉与生图能力,不改动 harness 源码。两个包配套使用:

类型作用
dsh-multimodalhost 插件vision 识图 + generate_image 生图/改图(含参考图比例匹配)+ show_image 展示(支持多张)+ 纯文本模型 image-strip 适配 + /global-multimodal/* 配置路由
dsh-multimodal-clientclient 插件工具卡内联图 + turn-tail 图集 + 「设置 → 多模态」设置页(模型/端点/API Key/连接测试)

只装 host 也能用:工具全部可用,图片以通用卡片显示、配置走手编文件;装上 client 才有图片渲染和设置页。

目录结构

dsh-multimodal/
├── dsh-multimodal/              # host 插件(file:// 挂载)
│   ├── index.mjs
│   ├── multimodal-helper.cjs
│   ├── package.json
│   └── README.md
├── dsh-multimodal-client/       # client 插件(pnpm 依赖安装,lib/ 已构建)
│   ├── src/                     # 源码(TS + CSS Modules)
│   ├── lib/                     # 构建产物(已提交,装完即用)
│   ├── package.json
│   └── README.md
├── patches/                     # harness 补丁(贴图识别所需,见安装第 3 步)
├── .gitignore
├── LICENSE
└── README.md

安装

1. host 插件(dsh-multimodal

dsh-multimodal/ 目录放到 ~/.dsh/plugins/ 下,在 web profile 的 ~/.dsh/profiles/web/cordis.patch.yml- insert: 数组加挂载行:

- insert:
    - id: multimodal-host
      name: file:///C:/Users/<you>/.dsh/plugins/dsh-multimodal/index.mjs

host 走 file:// 挂载而非 pnpm 依赖,是为了让运行时配置 global-multimodal-config.json 稳定存在插件目录(node_modules 里的依赖每次重装会被清掉)。

2. client 插件(dsh-multimodal-client

corepack pnpm dsh plugin --profile web add github:SCT192221/dsh-multimodal#path:/dsh-multimodal-client

或手动:在 ~/.dsh/profiles/web/package.jsondependencies"dsh-multimodal-client": "github:SCT192221/dsh-multimodal#path:/dsh-multimodal-client"dsh.profile.bundles 数组加 "dsh-multimodal-client",profile 目录跑 corepack pnpm install

包内已提交构建产物 lib/ 且无 prepare 脚本,不会触发 pnpm 11 的 git-allowBuilds 闸门。

两步都完成后重启 dsh web 生效。

3. harness 补丁(贴图识别所需)

官方 harness 的模态守卫会在纯文本模型的会话里拒绝图片输入(「当前模型不支持图片,请切换支持图片的模型」),需再打一个小补丁才能贴图识图:

# 在 harness 源码树根(packages/ 的上级)执行
git apply <本仓库路径>/patches/apiproxy-modality-guard.patch

不打补丁时贴图会被拒,但 vision 传显式路径/URL、文生图、show_image 均正常。原理与手动改法详见 dsh-multimodal/README.md

新版 harness 用户注意:附件存储默认限制单边 2000px(maxImageDimension),2K/3K 生成图会超限。插件已做优雅降级(生成照常、文件照存、结果返回路径与配置提示,工具不会报错死循环)。想要 2K/3K 原图内联展示,可调大 ~/.dsh/settings.yamlattachment-localmaxImageDimension(如 4096)——调与不调的取舍详见 dsh-multimodal/README.md 的「harness 附件尺寸上限与你的选择」。

配置凭据

视觉与生图两个通道各配一个 API Key,写在 ~/.dsh/.credentials.yaml

  • DSH_VISION_API_KEY — 视觉模型
  • DSH_GENERATION_API_KEY — 生图模型

两个通道的模型 ID 与 Base URL 均可配置,支持任何 OpenAI 兼容端点(Gemini、GPT、豆包等),不预置任何默认值。装了 client 插件后在 web UI「设置 → 多模态」里填即可;没装 client 手编 ~/.dsh/.credentials.yaml 与插件目录下的 global-multimodal-config.json。首次使用需先填好模型 ID 与 Base URL,填好前工具调用会提示未配置。本开源包不含凭据与运行时配置。

License

MIT