qizhen2021/dsh-plugin-vision ↗★ 0
@qizhen2021/dsh-plugin-vision
The see tool for the DeepSeek Harness: offline OCR with positions (macOS Vision) + ASCII layout art (PIL) + vision-model semantic description (mimo-v2.5 via the opencode-go gateway). Works with any model, including text-only ones.
AI 분석
核心用途是为纯文本模型或多模态模型增强图像理解与定位能力。适合需要处理复杂图表、网页截图或进行高精度OCR识别的用户。
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:qizhen2021/dsh-plugin-vision方式 C:clone + file: 软链(方便本地改配置/二次开发)
git clone https://github.com/qizhen2021/dsh-plugin-vision
cp ~/.dsh/profiles/web/package.json ~/.dsh/profiles/web/package.json.bak-$(date +%Y%m%d-%H%M%S)
ln -sfn "$(pwd)/dsh-plugin-vision" ~/.dsh/profiles/web/vendor/dsh-plugin-vision
## 配置(全部可选)
| 键 | 默认 | 含义 |
|---|---|---|
| `defaultModel` | `mimo-v2.5` | 默认视觉模型(0.14/0.28 每 1M token,与 flash 同价) |
| `fallbackModels` | `["qwen3.6-plus", "kimi-k3"]` | 兜底链,逐个尝试 |
| `gatewayBaseUrl` | `https://opencode.ai/zen/go/v1` | OpenAI 兼容网关 |
| `credentialPath` | `~/.dsh/.credentials.yaml` | 密钥文档(仅当 credentials 服务未挂载时直读) |
| `credentialKeys` | `["OPENCODE_GO_API_KEY", "OPENCODE_API_KEY"]` | 候选密钥名,按序尝试 |
| `maxImageSide` | `1600` | VLM 预处理最长边(`SEE_MAX_SIDE` 传给 prep.py) |
| `asciiWidth` | `88` | ASCII 布局图列数(`SEE_ASCII_WIDTH` 传给 ascii.py) |
| `vlmMaxTokens` | `1200` | VLM 最大输出 token |
| `vlmMaxChars` | `4000` | `vlm.text` 截断长度 |
| `ocrTimeoutMs` | `90000` | swift 首调含编译,超时给足 |
| `asciiTimeoutMs` | `30000` | ascii/prep/dims 超时 |
| `vlmTimeoutMs` | `120000` | 网关调用总超时(prep 另计 ≤30s) |
密钥读取双层策略:优先 `ctx.credentials` 服务(热重载、0600 权限约束);服务未挂载时回退到 `credentialPath` 的 YAML 直读(`yaml` 包)。密钥**不进代码、不进日志、不进 schema、不进 presentationMeta**。
## GUI 配置(设置 → 通用 → 视觉模型)
v0.2.0 起插件在 `ctx.settings` 注册命名空间 `dsh-plugin-vision`(schema:`defaultModel`,`applies: 'live'`):
- **GUI**:设置 → 通用页出现「视觉模型」下拉行(由轻量设置桥渲染,本机 loopback 可用),选择立即生效并持久化;
- **持久层**:用户选择写入 settings 存储(`~/.dsh/settings.yaml` 的 `dsh-plugin-vision` 段),跨重启保留;也可手工编辑该文件;
- **优先级**:settings 用户层 > composition base(loader 配置,如 `cordis.patch.yml` 的 `defaultModel`)> schema 默认(`mimo-v2.5`);
- **运行时**:Host 端 `watch` 设置变更,工具无需重启即用新默认值;单次调用仍可用 `see` 的 `model` 参数覆盖。