ysr666/dsh-vision-router
ysr666/dsh-vision-router为纯文本 Agent 提供视觉能力:内置免 Key 视觉链 + 像素级视觉工具(看图问答、定位、裁剪、像素对比、取色、OCR、矢量化、抠图、截图);粘贴图片即可用。
让纯文本模型处理视觉任务:粘贴图片后自动切换到 Vision Toolkit 变体,支持图片问答、多图比较、长截图 OCR、截图还原前端 UI、元素定位与像素对比。默认无需 API Key——图片经作者自建的免费服务处理,每台机器每天 100 张;也可改为指向自己的服务商。
A more powerful vision toolkit—give text-only models in DeepSeek Harness eyes: image Q&A, long-screenshot OCR, UI restoration, and GUI visual tasks in one toolkit and Skill.
🚀 Paste an image and ask directly | Install with one command | Broad use cases
Highlights | Quick start | Toolbox | Configuration and limits | Troubleshooting | Community
🌐 English | 中文
🏆 This project is the first comprehensive vision-tool plugin in the DeepSeek Harness ecosystem: it was initiated before internal beta and built during the beta with reference to agent-vision-toolkit.
Original work: The system and division of responsibilities behind these visual tools, together with the vision-skills Skill, were personally created and continuously refined by the author through long-term real-world use and repeated iteration.If this project helps you or gives you some inspiration, feel free to star 🌟 & fork.
(Vision Toolkit) variant automatically — no manual path copying or model changes. Native thumbnails, session history, and workspace paths stay intact; Web can preview artifacts.agent-vision-toolkit gives an agent more than image captions: it can read, locate, crop, trace, rebuild, and verify visual work. DSH Vision Toolkit is its native DeepSeek Harness integration, bringing that workflow into Web and Headless Profiles.
This project has two layers:
dsh plugin --profile web add @anionex/dsh-vision-toolkitUpstream toolkit: Anionex/agent-vision-toolkit · Project website: agent-vision.anionex.me
Want to sponsor this project? See FUNDING.md or email davidyang042@gmail.com.
Click to collapse
Thanks to AIHubMix for sponsoring this project! AIHubMix is a stable, high-concurrency AI model API gateway that connects Claude, GPT, Gemini, DeepSeek, and other mainstream models through a single API key, compatible with multiple protocols, with free model options available. To sign up, use the AIHubMix entry outside mainland China or the Inferera entry within mainland China. Thanks to E-API for sponsoring this project! E-API aggregates mainstream AI models behind OpenAI-, Anthropic-, and Codex-compatible APIs, with selected Claude models up to 98% below official prices and DeepSeek V4 models about 25% below official prices.
Contents
read_image) works without manually switching to a (Vision Toolkit) variant. Disable “Transparent variant routing” in advanced settings → image input to restore the explicit entries.(Vision Toolkit) variant and keep a workspace path, fixing blocked pastes and images that could not be reused later.429 responses./models request to a model that still cannot process images.The bundled vision-skills Skill carries the complete upstream playbooks, explaining when to use each workflow, in what order to call the tools, and how to verify the result:
Playbook · What the agent learns to do Read long screenshots, chat histories, and scrolling pages · Find low-content cut bands, OCR each chunk in order, preserve chat speakers/timestamps/quotes, merge only duplicated overlap, and surface risky boundaries for verification Rebuild a UI from a screenshot or design · Reuse project components and assets first, then combine code-native UI, extracted visuals, rendered screenshots, and visual comparison to align a page or component Restore an icon, logo, illustration, or other graphic · Extract a transparent PNG from the source image, or rebuild an editable/scalable SVG when needed, then verify shape, color, and alpha edges Turn a sketch, diagram, or whiteboard into structured code · Recover nodes, labels, connections, and directions as editable Mermaid, Graphviz, or another structured representation Operate a GUI from screenshots · Locate a control, perform one action, capture the screen again, and verify the resulting state before continuing
*Paste an image into the conversation. A text-only model can switch to its Vision Toolkit variant and inspect the image in the context of the user's question.*
Prompt example: “(Use vision-skills) Rebuild this image into HTML.”
*Left: the reference screenshot. Right: an editable HTML/CSS result. The result can continue into screenshot rendering and pixel comparison instead of ending as an image description.*
*Left: a hand-drawn reference. Right: the working interface reconstructed from it.*
Prompt example: “(Use vision-skills) Turn this sketch into a working front-end page.”
Prompt example: “(Use vision-skills) Quickly rebuild this image into HTML.”
*Left: the original page. Right: a fast reconstruction that preserves the main layout, content, and visual hierarchy while allowing approximate colors and library icons. Fast mode targets a first screenshot in about three minutes.*
dsh plugin --profile web add @anionex/dsh-vision-toolkitYou can install it into a Headless Profile too:
dsh plugin --profile headless add @anionex/dsh-vision-toolkitUsing DSH Desktop? It bundles its own dsh CLI and intentionally does not add it to your system PATH. Open DSH Terminal from the tray and run the command there, targeting the Desktop profile:
dsh plugin --profile desktop add @anionex/dsh-vision-toolkitThen restart DSH Desktop. The built-in plugin marketplace in DSH Desktop 2.0.1 has known installation issues; the terminal command above is the reliable path until a fixed Desktop release is available.
For the full Desktop install, update, and troubleshooting walkthrough, see Installing and updating in DSH Desktop.
Restart a running Web Profile, then open Settings → Vision Toolkit, configure a vision provider, and run Test vision model to confirm it is reachable.
The first start prepares an isolated runtime: the plugin prefers a system Python 3.11+; when none is found, it downloads a hash-verified standalone Python (about 35 MB) from the domestic mirror (dsh-vision-python-bootstrap-1317715800.cos.ap-guangzhou.myqcloud.com) on first use, falling back to the GitHub release when the mirror is unreachable. The locked runtime dependencies (Pillow, NumPy, vtracer) are installed from the Tencent Cloud PyPI mirror (mirrors.cloud.tencent.com/pypi/simple) first and fall back to the official PyPI index. A normal installation does not require an agent-vision-toolkit source checkout or a local path setting.
Paste a screenshot into the conversation or place an image in the session workspace, then invoke /vision-skills. For example:
Inspect this screenshot. Explain the error and tell me what to fix first.
Find the login button in the top-right corner, return original pixel coordinates, and make a boxed preview.
Crop this icon and convert it to SVG.
Rebuild the page from reference.png. After each pass, render it and run a pixel diff until the major differences are gone.The plugin provides 10 tools that can be called independently or composed into a workflow:
Tool · Best question to ask · Main result vision_glance · “What is happening in this image?” · Focused answer, description, OCR, or multi-image comparison vision_ground · “Where is the thing I need?” · Original pixel coordinates and optional boxed preview vision_detect · “Which buttons, icons, or elements are present?” · Numbered element inventory, coordinates, and optional preview vision_crop · “Extract this region as its own image” · PNG or JPEG crop vision_trace · “Turn this shape into an editable vector” · SVG vision_pixel_diff · “Where does the implementation differ from the reference?” · Difference percentage, ranked regions, heatmap, and JSON vision_long_screenshot_ocr · “Read this entire long screenshot” · Markdown, chunks, manifest, and audit output vision_extract_foreground · “Remove the background from this subject” · Transparent PNG vision_dominant_colors · “Which colors dominate this area?” · Palette or ranked candidate colors vision_html_screenshot · “Render this local page at an exact viewport or capture the full page” · PNG and optional CSS pageHeight
Coordinates always use original-image pixels in x1,y1,x2,y2 form, so grounding output can feed directly into cropping, tracing, or later automation.
For a long HTML document, pass fullPage=true. The requested width and height remain the layout viewport, while the resulting PNG covers the complete document and reports pageHeight in CSS pixels.
The plugin keeps image understanding and deterministic local image processing in one Agent workflow. The diagram below shows the implementation boundary.
Most vision bridges for text-only models ask a multimodal model for a generic description and hand it to the text model, adding a semantic layer where information is lost. Vision Toolkit instead recovers why the agent wants to look at the image: the user message or the model's stated reason becomes a focus hint passed to the vision model. The result is a task-aware description that emphasizes what matters for the current step — with fewer tokens, higher accuracy, and faster responses.
Architecture and image-input behavior
flowchart LR
Image["Screenshot or local HTML"] --> Skill["vision-skills Skill"]
Skill --> Agent["Text agent selects a task"]
Agent --> Vision["Use a vision model when image understanding is needed"]
Agent --> Local["Run crop, SVG, and pixel work locally"]
Vision --> Result["Answer, OCR, coordinates"]
Local --> Artifact["PNG, SVG, heatmap, JSON"]
Result --> Session["Continue reasoning and acting"]
Artifact --> SessionThe visual capabilities come from a packaged, pinned agent-vision-toolkit snapshot. The DSH plugin handles installation, session-scoped tool exposure, Credentials, path checks, cancellation, timeouts, result files, and Web presentation. The runtime never fetches upstream main in the background.
The bundled vision-skills Skill is the DSH adapter of the upstream vision-tools Skill: its SKILL.md plus all five upstream playbooks. Tool names, argument syntax, Artifact delivery, progressive exposure, and DSH path/lifecycle boundaries are adapted; the upstream tool-selection rules, coarse-to-fine method, and task SOPs remain intact. The exact upstream Skill commit, source hashes, adapted hashes, and reviewable adapter patch are recorded in assets/skill/UPSTREAM.json and patches/vision-tools-dsh.patch.
For routes that DSH positively identifies as text-only, the plugin registers a sibling (Vision Toolkit) variant. By default, pasting an image in DSH Web switches to that variant and gives the model both a reusable workspace path and a visual description focused on the current task.
The bridge note describes only the image blocks converted for the current request, not the assistant’s capabilities on other routes or turns. Native-image models and models with unknown input modalities are not wrapped. Conversion happens on the outgoing message copy; it does not rewrite the stored conversation. This wording change does not remove earlier descriptions or statements already present in a conversation.
Configure the vision provider in Settings → Vision Toolkit and store the API key as a DSH Credential. Settings stores the Credential reference and never reads the saved secret back into the browser.
Step-by-step AIHubMix tutorial: Get an AIHubMix API key and configure Gemini 3.7 Flash for vision. It includes screenshots for account/API-key setup, the exact Vision Toolkit settings, model selection, and troubleshooting.
You can also configure a Profile patch:
- id: vision-toolkit
config:
provider:
baseUrl: https://api.example.com/v1
credential: MY_VISION_KEY
model: your-vision-model
protocol: openaiOpenAI Chat Completions-compatible endpoints, OpenAI Responses, and Anthropic Messages are supported. Existing configurations continue to use Chat Completions. To use a Responses-compatible endpoint, set protocol: responses; the plugin appends /responses to the configured base URL. An optional reasoningEffort is sent only for Responses requests:
protocol: responses
reasoningEffort: mediumLeaving reasoningEffort blank uses the model or proxy default. Common values are none, minimal, low, medium, high, and xhigh, but the field intentionally accepts provider-specific values made from letters, digits, ., _, and - (up to 64 characters). Support and billing vary by model or proxy; higher effort may increase reasoning tokens, latency, and cost. The Responses request sets store: false, but that flag does not replace reviewing the provider's own data-retention policy. The Web Settings panel exposes the full provider, runtime, timeout, image-limit, and image-input-variant configuration. Profile patches can also supply non-secret deployment metadata in provider.headers. A gateway that routes by conversation can name one or more generated headers in provider.sessionHeaders; OpenCode Zen, for example, requires x-opencode-session:
- id: vision-toolkit
config:
provider:
headers:
x-tenant: acme
sessionHeaders:
- x-opencode-sessionStatic header values are ordinary plaintext Settings, not Credentials. Do not put API keys, bearer tokens, cookies, or other secrets in provider.headers; continue to use provider.credential for the vision API key. The plugin rejects client-owned authentication headers and HTTP routing/framing headers, case-insensitive duplicates, conflicts between the two fields, invalid names or values, more than 32 combined entries, names over 128 bytes, values over 4096 bytes, or more than 16384 bytes in total.