YUCONG-28/dsh-skills-plugins--plugins-dsh-vision-bridge ↗★ 0
dsh-vision-bridge
DeepSeek Harness plugin: when the main (text-only) model receives images, automatically caption them with a Qwen VL model and let DeepSeek continue the task.
AI Analysis
核心用途是为纯文本模型补充图像理解能力。适合在使用不支持多模态的 DeepSeek 模型时,仍需处理图片输入的用户。
Install
This plugin has no verified bundle, or compatibility checks failed. Read the repository notes first. Read the full README ↗
README
Read the full README ↗4. 配置 Qwen provider(复用内置 llm-pi-ai 适配器)
编辑 ~/.dsh/settings.yaml,追加:
llm-pi-ai:
providers:
qwen:
apiKeyEnv: DASHSCOPE_API_KEY
displayName: Qwen (DashScope)
api: openai-completions
baseURL: https://dashscope.aliyuncs.com/compatible-mode/v1
models:
- id: qwen-vl-max
name: Qwen-VL-Max
input: [text, image]
contextWindow: 32768
maxTokens: 8192
settings.yaml 热更新,保存即生效;也可在 Web 设置 → Models 页面添加 (协议 openai-completions,Base URL 填
https://dashscope.aliyuncs.com/compatible-mode/v1)。
配置项
| 键 | 默认值 | 说明 |
|---|---|---|
qwenProvider | qwen | llm-pi-ai 中配置的 provider 键名 |
qwenModel | qwen-vl-max | 用于识别的 Qwen VL 模型 id |
mode | native | native 整轮路由(推荐)/ caption 仅描述转发(旧行为)/ off 关闭 |
captionFormat | structured | 兜底转述格式:structured 结构化 JSON 证据(推荐,OCR 逐字/版面/实体/uncertainty)/ prose 自由文本(旧行为) |
strictJson | true | structured 下强制证据形状:结果不是 JSON 时强化提示重试一次,仍失败报错 |
fallbackProviders | [] | 识别故障转移链:主引擎失败后依次尝试的备用引擎 [{provider, model}] |
nativeContextRatio | 0.8 | 整轮路由的上下文上限比例:对话估算 token 超过「视觉模型窗口 × 该值」时改走描述兜底;0 关闭上限检查(总是路由) |
maxTokens | 4096 | 兜底描述请求的输出 token 上限(思考类视觉模型偶发思考时需余量) |
temperature | 0.2 | 兜底描述请求的采样温度 |
prompt | 留空 | 自定义兜底提示词;留空则按 captionFormat 用内置默认(structured/prose) |
localOcr | true | 本地 OCR 先行:文字密集图片(截图/文档)先本地识别,零 API 成本;false 关闭 |
ocrMinChars | 40 | 本地 OCR 文本达到该字符数即判定文字密集、直接注入并跳过视觉引擎 |
ocrTimeoutMs | 30000 | 本地 OCR 单次超时(毫秒);超时/失败自动降级到视觉引擎 |
ocrScript | 留空 | 本地 OCR 工具路径;留空自动定位(优先 ~/.dsh/vision-bridge-ocr 编译二进制,否则 swift scripts/ocr.swift) |
cacheSize | 256 | 描述结果内存缓存条数上限 |
captionTimeoutMs | 120000 | 单次识别超时(毫秒),0 关闭 |
热配置:改参数不用重启
除 mode 外,其余键都可以在 ~/.dsh/vision-bridge.json 中按请求动态覆盖——
保存文件后立即生效,无需重启 dsh web。文件不存在时用 cordis 配置(即
cordis.patch.yml 里的 vision-bridge: 段);文件被删除则恢复 cordis 配置。
{
"captionFormat": "structured",
"qwenModel": "qwen3.7-flash",
"maxTokens": 8192,
"temperature": 0.1,
"fallbackProviders": [
{ "provider": "gemini-api", "model": "gemini-2.5-flash" }
],
"prompt": "请逐字转写图中的全部文字……"
}
- 非法值(如
qwenModel: ""、temperature: 99、fallbackProviders缺字段)会被 忽略,不影响其他键; mode决定启动时注册哪些监听器,改mode需要改 cordis 配置并重启;- 插件每次请求最多检查一次该文件(≥1 秒节流),日常使用零感知。