anomalyco / anomalyco/opencode

[FEATURE]: Local OCR fallback for images when no vision model is available

Open
#48,333 0 comments 0 reactions 1 assignee View on GitHub

@jlongster is already working on this.

Since Sep 10, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

Follow-up to the image transcription feature (#48332). When no vision-capable model exists in the selected model's provider, images are still not readable.

This is the same goal as #46785 (RapidOCR-json) but with a bundled Tesseract engine instead of a separately installed OCR binary, so it works out of the box.

Request: a fully local OCR fallback that runs on the user's machine, so the image never leaves the device.

Findings from a prototype:

  • tesseract.js does not work in the compiled bun build --compile binary. The worker thread cannot resolve wasm-feature-detect and other modules because the on-disk node_modules paths are not present in the binary. The build succeeds but createWorker hangs.
  • tesseract-wasm is a better fit: its core WASM is ~1.8MB (vs ~43MB for tesseract.js-core), it exposes a synchronous createOCREngine({ wasmBinary }), and it worked in a source run. Its WASM is not exported from the package exports, so embedding it in the binary needs either vendoring the WASM or a build step that copies it next to the binary.
  • Language data (eng.traineddata.gz, ~14MB) can be bundled and loaded with loadModel, no network needed.
  • Image input needs decoding to RGBA before loadImage; photon-node is already a dependency and can decode.

Open questions: where to put the OCR engine (main thread vs worker), how to embed the WASM in the compiled binary, and whether OCR should be opt-in via config.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.