dshbase

插件目录 / UI & Skins / dsh-image-read

dsh-image-read

已验证 · 实测可装 Triple3h

✓ 持续维护 2 位贡献者 基于 2 个官方 DSH 包

查看 GitHub ↗ ← 返回插件目录

0Stars
0Forks
0未关闭 issue
—语言
2026-08-23最近推送
跨平台平台

功能简介

DSH native plugin: structured image analysis via multimodal APIs (read_image_mimo tool) with provider failover, caching, SSRF protection and a Web UI config card. DSH 原生插件:多模态识图,返回结构化 JSON 证据,支持故障转移/缓存/SSRF 防护/Web 配置卡片。

✅
我们的评价
可用 — 实测通过,早期项目

DSH native plugin: structured image analysis via multimodal APIs (read_image_mimo tool) with provider failover, caching, SSRF protection and a Web UI config card. DSH 原生插件:多模态识图,返回结构化 JSON 证据,支持故障转移/缓存/SSRF 防护/Web 配置卡片。 实测能干净安装、正常启动。早期项目,但功能可用。

「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

README

dsh-image-read

English | 中文

GitHub stars
GitHub license

A DeepSeek Harness (dsh) native plugin that analyzes images with multimodal models and returns structured JSON evidence — via a read_image_mimo tool any model can call.

vs modlens: no dependency on a (modlens vision) model variant — the image path is passed directly through a tool call, so any model can use it.

vs native image input (dsh ≥ 0.1.0-rc.8): the harness itself can now hand images to DeepSeek vision models directly (native image requests, Files-API upload reuse). This plugin is for what that path does not give you: structured JSON evidence (OCR text + layout regions), multi-provider failover, result caching, and routing to cheap dedicated vision APIs — from any model, vision or not.

What you get

  • general image understanding / ocr text extraction / multi-image comparison (max 8)
  • Structured output — summary + ocr (full_text + lines) + layout (regions with type/reading_order) + uncertainty
  • Provider failover — configure multiple providers; one fails, the next is tried automatically
  • Result caching — content-hash cache for local and remote images, 1h TTL, 60s failure cooldown
  • Cross-platform image preprocessing — long-edge downscale (default >1024px), EXIF orientation, gif/bmp → png, via optional sharp (the same library the harness attachment pipeline uses; falls back to sips on macOS, passes through elsewhere)
  • Cumulative payload budget — multi-image requests are refused up front when the combined size exceeds maxTotalImageBytes (default 20 MiB), instead of dying at the provider
  • Configurable output cap — maxTokens (default 4000, was hardcoded 2000); text-dense screenshots no longer truncate
  • SSRF protection — private IPv4 and IPv6 blocking, per-hop redirect re-validation, download size cap, hostname preservation
  • Local pre-check of fully transparent PNGs (IDAT alpha scan)
  • API key redaction — keys and URLs are replaced with *** in error messages
  • Exponential backoff retry — 429 / 5xx / timeout / network errors, 1s/2s/4s

Tool

read_image_mimo

Install (web profile)

  1. Add the dependency and bundle entry to ~/.dsh/profiles/web/package.json
  2. pnpm install
  3. Restart the web host

Or link-install in development:

npm install        # also installs the optional sharp preprocessing dependency
npm run build
npm run link-profile

Configure

Prefer the Web UI: Settings → Plugins → Plugin configuration → Image recognition — fill in the endpoint (baseUrl), model and API key; blanks fall back to the provider chain in cordis.patch.yml. If baseUrl lacks /chat/completions it is appended automatically.

The provider chain (failover) is configured under config in cordis.patch.yml:

config:
  providers:
    - name: mimo
      baseUrl: 'https://api.xiaomimimo.com/v1'
      apiKey: 'sk-...'
      model: 'mimo-v2.5'
    # optional fallback
    - name: dashscope
      baseUrl: 'https://dashscope.aliyuncs.com/compatible-mode/v1'
      apiKey: 'sk-...'
      model: 'qwen3-vl-plus'
  timeoutMs: 120000
  maxImageDimension: 1024
  # vision response cap, 256-32768 (also editable in the Web UI card)
  maxTokens: 4000
  # cumulative raw-image budget per request in bytes
  maxTotalImageBytes: 20971520

Legacy single-provider config (baseUrl / apiKey / model at the top level) is still supported.

Output shape

{
  "summary": "description of the image's core content",
  "ocr": {
    "full_text": "all text in the image...",
    "lines": [{"text": "first line", "language": "zh"}]
  },
  "layout": {
    "regions": [
      {"type": "title", "reading_order": 1, "text": "title text"},
      {"type": "paragraph", "reading_order": 2, "text": "body..."}
    ]
  },
  "uncertainness": ["notes on blurry parts"]
}

Local smoke test

MIMO_API_KEY=sk-xxx node --input-type=module -e "
import('./lib/index.js').then(async (m) => {
  const r = await m.readImage(
    { image_path: '/tmp/test.png', mode: 'general' },
    undefined,
    { providers: [{ name: 'test', baseUrl: 'https://api.xiaomimimo.com/v1', apiKey: process.env.MIMO_API_KEY, model: 'mimo-v2.5' }], timeoutMs: 120000, maxImageDimension: 1024, maxTokens: 4000, maxTotalImageBytes: 20971520 }
  );
  console.log(JSON.stringify(r, null, 2));
});
"

License

MIT

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-image-read」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:Triple3h/dsh-image-read

Headless(CLI)profile:

dsh plugin --profile headless add github:Triple3h/dsh-image-read

实测报告

验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。

安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

UI & Skins 里更多

浏览全部 7819 个插件 →