Skip to content

ferstar/dsh-tool-ocr

30Last commit Aug 15, 2026

dsh-tool-ocr DSH plugin

dsh-tool-ocr is a standalone plugin that adds an `ocr` tool to DeepSeek Harness, allowing models without vision input (like DeepSeek chat models) to extract text from local images or attached conversation images. It uses the newbee-ocr engine (PP-OCRv6) and supports both path-based and attachment_id-based input. The plugin requires an external nbocr binary and can be configured with various options like language, detection model, and timeout.

How to install the dsh-tool-ocr DSH plugin

dsh plugin --profile web add dsh-tool-ocr

Copying does not run this command. Review the repository and version before installing the dsh-tool-ocr DSH plugin.

dsh-tool-ocr DSH plugin data source

dsh-tool-ocr DSH plugin snapshot date: Aug 16, 2026

discovered

What the dsh-tool-ocr DSH plugin can do

  • Provides `ocr` tool with actions: `recognize`, `status`, `install`/`check`.
  • Supports image input via local file path (resolved against session workspace) or `attachment_id` (materialized from conversation attachment).
  • Outputs reading-ordered text, engine facts, per-block bounding boxes, review flags, and heuristic Markdown table.
  • Handles MNN diagnostics pollution of engine stdout and respects caller cancellation and timeout.
  • Configurable parameters: command, args, env, language, detection model, max image size, max output size, max text chars, timeout.

Where the dsh-tool-ocr DSH plugin fits

  • Enable DeepSeek chat models to read text from screenshots or scanned documents in a conversation.
  • Extract text from images in automated workflows, such as processing receipts, forms, or captchas.
  • Combine with the dsh fork's image placeholder feature to deliver a drag-and-drop OCR experience similar to multimodal models.
  • Use as a building block for custom tools that require OCR capabilities within DeepSeek Harness.

Who the dsh-tool-ocr DSH plugin is for

  • Users of DeepSeek Harness who want to add OCR capabilities to text-only models.
  • Developers building automation or scripts that need to extract text from images in a DSH environment.

dsh-tool-ocr DSH plugin limitations

  • Requires manual installation of the nbocr binary (prebuilt or from source) and configuration of its path.
  • On official DeepSeek Harness, only supports file path input; attachment_id input requires a specific fork with image placeholder support.
  • Image format and size are limited by maxImageBytes (default 25MB) and maxTextChars (default 12000) settings.
  • OCR accuracy depends on the PP-OCRv6 model and input image quality; may not handle all languages or fonts equally well.

dsh-tool-ocr DSH plugin: from the repository README

Quoted from the ferstar/dsh-tool-ocr README, the upstream source of the dsh-tool-ocr DSH plugin. Copyright remains with the original authors.

English | [中文](README.zh.md) A standalone [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) plugin: local image text recognition for models **without vision input** (e.g. DeepSeek chat models), backed by the standalone [newbee-ocr](https://github.com/zibo-chen/newbee-ocr-cli) (`nbocr`) engine over PP-OCRv6 models. Fully out-of-tree: depends only on published dsh base packages (`@deepseek-ai/cordis`, `@deepseek-ai/dsh-tools`, `@deepseek-ai/dsh-subprocess`, …). No coupling to the deepseek-harness repository. ## What it provides | Item | Description | |---|---| | `ocr` tool | Model-facing tool: `recognize` / `status` / `install` (alias of check) / `check` actions | | Image inputs | Local `path` (resolved against the session workspace) or `attachment_id` (image already attached to the conversation, materialized to a temp file) | | Output | Reading-ordered `<text>`, engine facts, per-block bounding boxes (`include_boxes`), review flags (low-confidence / amount / numeric / date / quantity, `needsReview`), heuristic Markdown table (`table`) | | Robustness | Survives MNN diagnostics polluting engine stdout; honors caller cancellation and timeout | ## Two ways to use

Read the full READMERepository license: MIT

dsh-tool-ocr DSH plugin questions

How do I install dsh-tool-ocr?

First, install the nbocr binary from the newbee-ocr-cli releases (e.g., using the one-line installer). Then, run `dsh plugin --profile web add dsh-tool-ocr` to add the plugin to your DSH profile. Finally, add the plugin configuration to your `cordis.patch.yml` file as described in the README.

Why does the ocr tool not work with image attachments in the official DeepSeek Harness?

The official DeepSeek Harness blocks image uploads for models that do not declare image input. This plugin cannot override that. You can only use the `path` input method (e.g., `ocr { path: "C:/image.png" }`). To use `attachment_id`, you need to use the forked version of DeepSeek Harness that supports image placeholders.

What languages does the OCR support?

The plugin is language-agnostic; the actual language support depends on the nbocr engine and the PP-OCRv6 model. You can configure the `language` option (e.g., 'chinese', 'english') based on the models available in nbocr. Refer to the newbee-ocr-cli documentation for a full list of supported languages.

How can I debug if the OCR engine fails to produce output?

First, check that the nbocr binary is correctly installed and the `command` path is valid. Run the tool with `action: "status"` to verify engine readiness. If the engine produces output but the plugin returns nothing, check the `maxOutputBytes` and `maxTextChars` limits. You can also run the nbocr binary directly with a test image to isolate the issue.

Can I use dsh-tool-ocr with models other than DeepSeek chat models?

Yes, the plugin works with any text-only model in DeepSeek Harness, as long as the model can call tools. The `ocr` tool is available to the model as a function. It is not limited to DeepSeek chat models.