Skip to content
dsh.fish
Bundle

deepseek-vision

本地图片理解插件:vision Service + vision_describe 工具(MiniMax-M3 → 智谱 GLM-4.6V-Flash → 本地 Ollama gemma3:4b 三层降级链)

Source
YNM10086
stars
1 stars
License
Apache-2.0
Updated
Updated 5 days ago

Readme

# 🖼️ deepseek-vision — DSH 本地图片理解插件

> 把 deepseek-mcp-serve 的视觉识别能力收编为 **DSH 宿主级 bundle 插件**:`vision_describe` 工具随 DSH 启动自动挂载,所有会话的 AI 直接可用——无需规则提醒,遇到图片自然调用。

**三层后端链自动降级**:MiniMax-M3(云)→ 智谱 GLM-4.6V-Flash(云,免费)→ 本地 Ollama gemma3:4b(完全本地,涉密图片专用)

## ✨ 特性

- ⚙️ **零配置使用**:AI 遇到图片自动调用 `vision_describe`(`imagePath` + `question` 原样传入)
- 🔁 **重启不丢**:bundle 注册进 web profile,随 DSH 启动自动挂载(与 dsh-collab-bundle 同机制)
- 🔒 **密钥安全**:keys 存 `~/.dsh/vision.config.json`,经子进程 env 注入,不进日志、不进工具输出;错误信息自动剥离 base64 图片数据
- 🧩 **可复用**:`vision` Service 可被其他插件 `ctx.get('vision')` 直接调用
- ⏱️ **超时可控**:单后端超时 + 整体链 deadline,最坏等待有界

## 🧭 后端链

| 顺序 | 后端 | 端点 | 模型 |
| --- | --- | --- | --- |
| 1 | MiniMax(云) | `https://api.minimaxi.com/v1/text/chatcompletion_v2` | MiniMax-M3 |
| 2 | 智谱(云,免费) | `https://open.bigmodel.cn/api/paas/v4/chat/completions` | GLM-4.6V-Flash |
| 3 | Ollama(本地) | `http://localhost:11434/api/chat` | gemma3:4b |

降级语义:网络错误 / 5xx / 429 → 降级下一后端;其他 4xx → fail-fast;全链失败 → 报错。强制 `ollama` 后端 = 完全本地处理(涉密图片)。

## 📦 文件结构

```
deepseek-mcp-plugin/
├── README.md
├── package.json          # bundle 包定义(dsh.bundle.patch → cordis.patch.yml)
├── cordis.patch.yml      # 挂载行(host 级:所有会话自动获得工具,重启不丢)
├── lib/
│   └── index.js          # 插件主代码(ESM)
├── src/
│   └── deepseek-vision.host.js   # 动态插件版源码(历史/机制参考)
└── docs/
    ├── 2026-08-15-deepseek-vision-plugin-design.md   # 设计文档
    └── 2026-08-15-deepseek-vision-plugin.md          # 实施计划
```

## 🚀 安装

```bash
dsh plugin --profile web add "file:D:/Deepseek-MCP-Plugin"
```

- 自动注册进 web profile 的 `dsh.profile.bundles` 与 dependencies(file: 依赖)
- **注意:安装是复制(非链接)**——修改 `lib/index.js` 源码后需重新执行上述命令才生效
- 卸载:`dsh plugin --profile web remove deepseek-vision`

## ✅ 状态

- [x] 动态插件验证通过(默认链识别与基线一致、429 降级、错误路径全部正确)
- [x] 固化:bundle 安装进 web profile,重启自动挂载(已实测)
- [x] AGENTS.md 识图规则退役(指向 `vision_describe` 工具)
- [x] 原 `deepseek-mcp-serve` 技能归档(SKILL.md 标记 RETIRED)
- [x] 推送至 GitHub(YNM10086/deepseek-mcp-plugin)

## 🔐 安全

- API keys 只从 `~/.dsh/vision.config.json` 读取,经子进程 env 注入,不落盘、不进日志、不进工具返回
- 错误信息中 base64 图片数据会被 `sanitize()` 剥离(`[image omitted]`)
- 涉密图片务必传 `backend: "ollama"`(完全本地,不经过第三方服务器)

Install

dsh plugin --profile web add github:YNM10086/deepseek-mcp-plugin

Profile: web

  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source