给 DeepSeek Harness 的纯文本模型装上眼睛,让它们能直接看懂用户粘贴的图片并基于图像内容回答问题。
$ dsh plugin --profile web add github:oil-oil/dsh-vision在终端中运行以上命令,通过 dsh CLI 安装此插件。可在右上角切换 Profile。 第一次用 dsh?看这篇新手教程
给 DeepSeek Harness 中的纯文本模型(例如 deepseek-official)装上眼睛,让它们能直接看懂用户粘贴的图片并基于画面内容回答;已经支持图片的模型则继续走原生视觉,完全不绕路。
@deepseek-ai/dsh-llm-deepseek(被替换的目标适配器)、@deepseek-ai/dsh-attachment(图片附件读取)、@deepseek-ai/dsh-credentials(API Key 解析)、@deepseek-ai/schemastery(配置 Schema)cordis.patch.yml 禁用官方 llm-deepseek 后,以 dsh-vision 身份注入;以 LlmAdapter 子类 VisionBridgeAdapter 接管 deepseek-official 路由,先判断原模型输入模态再决定直通还是桥接;同时为 Web Profile 注册"视觉识别"设置卡片src/index.ts(服务端 apply 钩子),前端扩展在 src/client/index.tsx当你在用 DeepSeek 等纯文本模型,又希望它能直接读懂粘贴的截图(界面报错、设计稿、表格、代码截图等)时,这个插件让聊天窗口获得接近原生视觉模型的体验;如果你常用 Harness 已经有别的支持图片的模型,桥接会自动让位,不会与原生路径冲突。
| 依赖 | 最低版本 | 说明 |
|---|---|---|
| DeepSeek Harness | = 0.1.0-rc.6 | 通过 peerDependencies 固定到这一精确版本,DSH 仍在 Developer Preview |
| Node.js | >= 22.19 | 来自 package.json engines 字段 |
| 操作系统 | macOS / Windows / Linux | 云端桥接与界面无平台限制;macOS 上本地 OCR 走系统 Vision,其他系统需要预装 Tesseract 与语言包 |
| 原生模块 | 无 | 没有 node-pty、sqlite 之类的本地编译依赖 |
| Tesseract | 可选 | 仅在 macOS 之外的本地降级场景需要,自带语言数据不足时会报"没有语言数据" |
dsh plugin --profile web add github:oil-oil/dsh-vision
| 配置 | 类型 | 说明 | 默认值 |
|---|---|---|---|
| visionBackend | 字符串(zenmux / bailian / tokendance / openrouter) | 文本模型的主视觉平台;留空表示"自动选择",按 Harness 其他视觉 → see 配置 → 本地 OCR 顺序尝试 | 未设置 |
| visionBackendModel | 字符串 | 主视觉平台使用的模型 ID,留空使用平台默认模型 | 平台默认值(ZenMux/OpenRouter 用 qwen/qwen3.7-plus,百炼/TokenDance 用 qwen3.7-plus) |
| visionBackendBaseURL | 字符串 | 视觉平台的 API 地址(http/https),用于私有网关或代理 | 平台默认地址 |
| visionProvider | 字符串 | 把 Harness 中某个具体的支持图片的模型固定为视觉路由;与 visionModel 必须同时填写,且不能选 deepseek-official | 未设置 |
| visionModel | 字符串 | 上面选定的 Harness 视觉模型 ID | 未设置 |
| visionConfigFile | 字符串 | see 兼容配置文件路径,留空读取 ~/.config/see/config.env 或 SEE_CONFIG_FILE 环境变量 | ~/.config/see/config.env |
| visionTimeoutMs | 整数(毫秒,≥ 1) | 单次外部视觉调用的最大等待时间 | 600000 |
| maxImages | 整数(1–32) | 一次请求里能联合分析的最大图片数;超过会直接报错 | 8 |
| cacheEntries | 整数(1–1024) | 重复请求视觉识别结果的内存缓存条目上限,按 LRU 淘汰 | 64 |
这些字段都落在
$DSH_HOME/settings.yaml的llm-deepseek段落里;前 4 项(visionBackend、visionBackendModel、visionBackendBaseURL、maxImages)可以在界面"设置 → 插件 → 插件配置 → 视觉识别"卡片里直接改,其余需要在配置文件中手工编辑。
Q: 安装后还需要自己申请视觉模型的 API Key 吗?
A: 默认不需要。把"视觉平台"留成"自动选择"即可,插件会先尝试 Harness 里已经配置且声明支持图片的模型,再读取 see 私有配置,最后才走本地 OCR;只有手动指定 ZenMux / 百炼 / TokenDance / OpenRouter 之一时,才需要在卡片里填对应平台的 API Key。
Q: 当前主模型已经支持图片,插件还会插手吗?
A: 不会。VisionBridgeAdapter 在转发前会先调用原生适配器的 resolveModel 检查输入模态,只要包含 image 就直接把整条消息(包含图片)透传给 DeepSeek 适配器,桥接代码完全不参与。
Q: 多张图片会分开识别还是联合分析?
A: 联合分析。一次请求里所有图片会打包成同一个外部视觉调用,因此适合做前后对比、组合证据这类需要同时看到多张图的场景;这也意味着超出会直接报错而不是逐张处理。
Q: macOS 上不联网能识别图片吗?
A: 可以。macOS 上本地降级走系统内置 Vision OCR,无需额外安装;系统 OCR 失败时再尝试 Tesseract。Windows / Linux 用户需要自行安装 Tesseract 与对应语言包,否则会报"本地视觉不可用"。
Q: 单次请求最多能发几张图片?
A: 默认 8 张,可在 1–32 之间调整。超过上限会抛 VISION_IMAGE_LIMIT 错误而不是静默截断,所以粘贴截图前留意 maxImages 设置。
Q: API Key 会被保存到哪里?安全吗?
A: 通过 Harness 官方凭据服务保存,写入后只能看到"是否存在",不会被读回聊天、设置页面或会话日志;也可以用 see 私有的 ~/.config/see/config.env 或同名环境变量提供。本仓库与构建产物都不会写入任何 Key。
Q: 配置改了之后需要重启吗?
A: 不需要。$DSH_HOME/settings.yaml 的 llm-deepseek 段落或界面卡片里改完会自动生效,重启 Web Profile 只在切换 Provider/Model 时偶尔需要刷新模型列表。
Q: 如何卸载或停用?
A: 卸载用 dsh plugin --profile web remove github:oil-oil/dsh-vision;想临时关掉可以在 cordis.patch.yml 里把 dsh-vision 那一段标 disabled: true 后重启 Profile。
入门 — 安装命令一行即可启用,默认"自动选择"模式不需要任何额外配置就能用上本地 OCR;想用云端视觉只需在设置卡片里选个平台、填个 Key。
visionProvider 与 visionModel 必须同时配置,且不能选 deepseek-official 作为外部视觉模型(src/harness-vision.ts:58-79)image 输入模态,否则视为文本模型(src/harness-vision.ts:74-79)visionBackendModel、visionBackendBaseURL、visionTimeoutMs、visionConfigFile、cacheEntries、visionProvider、visionModel 不在设置卡片里,需要手工编辑 $DSH_HOME/settings.yaml 的 llm-deepseek 段落(README.md:51-61)0.1.0-rc.6,DSH 主线版本变化需要等待插件同步(README.md:37)
English | 中文
dsh-vision is a plugin for DeepSeek Harness. Vision-capable models keep receiving images natively. When the selected main model is text-only, the plugin asks a separate vision model to observe the original images, then lets the original DeepSeek model produce the final answer.
| Main model | Image path | Final answer |
|---|---|---|
| Supports images | Original images are sent directly, without preprocessing or OCR | Current model |
deepseek-official or another text-only model | A configured vision model observes the original images; its output is injected as untrusted attachment context | DeepSeek |
| Cloud vision unavailable | Falls back to macOS Vision or Tesseract | DeepSeek |
The plugin does not replace the main model selected in Harness. Multiple image attachments are analyzed together, so comparisons and combined evidence work naturally. The user's task is forwarded unchanged instead of being wrapped in a fixed report template.
Use the plugin manager built into DeepSeek Harness:
npx @deepseek-ai/dsh plugin --profile web add github:oil-oil/dsh-vision
Restart Harness, then paste or drag images into the composer as usual. The plugin replaces the official deepseek-official adapter while preserving its model catalog, settings, and credentials. It also adds a Vision Recognition card to Settings → Plugins → Plugin configuration.
DeepSeek Harness is still in Developer Preview. This release targets
0.1.0-rc.6exactly.
Open Settings → Plugins → Plugin configuration → Vision Recognition. Select ZenMux, Alibaba Cloud Model Studio, TokenDance, or OpenRouter, then enter its API key. The same card lets you change the model ID, API endpoint, and image limit.
The API key is stored through Harness's official credential service. It is write-only in the browser: the plugin can report whether a key exists, but never reads it back into the page, chat, settings document, or session log.
Routing follows the user's choice. A provider selected in Vision Recognition is primary for text-only models. Other enabled Harness vision routes, an existing see configuration, and local OCR are failover only. When the current main model supports images, the original images pass through natively and none of these bridge routes are used.
Choose Automatic to skip plugin-managed cloud credentials. The bridge then tries image-capable models already configured in Harness, followed by see-compatible private configuration and local OCR. A Harness custom model must declare image as an input modality or it remains a text model.
Most setups should use the UI. The equivalent non-secret fields live in the existing llm-deepseek section of $DSH_HOME/settings.yaml:
llm-deepseek:
visionBackend: zenmux
visionBackendModel: qwen/qwen3.7-plus
visionBackendBaseURL: https://zenmux.ai/api/v1
maxImages: 8
Do not put API keys in this file. Save them in the Vision Recognition card or provide the matching environment variable. Changes apply without a restart.
If Harness has no usable vision model, the plugin also reads ~/.config/see/config.env. It supports ZenMux, Alibaba Cloud Model Studio, OpenRouter, and TokenDance. Environment variables override the private config file.
export SEE_PROVIDER=zenmux
export ZENMUX_API_KEY=your-key
SEE_PROVIDER selects the primary provider. Other providers with configured keys are failover routes only. If no provider is selected and only one is configured, that provider is used.
When no cloud key is available, or every cloud route fails, the plugin tries local capabilities:
Local fallback is primarily OCR and is not equivalent to full multimodal understanding.
pnpm install
pnpm check
The project is available under the MIT License. Cloud routing, joint multi-image analysis, and local fallback behavior are based on the MIT-licensed oil-oil/see-skill. The DeepSeek icon comes from the official deepseek-ai/deepseek-harness repository.