anomalyco / anomalyco/opencode
[FEATURE]: Local OCR fallback for images when no vision model is available
@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.jsdoes not work in the compiledbun build --compilebinary. The worker thread cannot resolvewasm-feature-detectand other modules because the on-disknode_modulespaths are not present in the binary. The build succeeds butcreateWorkerhangs.tesseract-wasmis a better fit: its core WASM is ~1.8MB (vs ~43MB fortesseract.js-core), it exposes a synchronouscreateOCREngine({ wasmBinary }), and it worked in a source run. Its WASM is not exported from the packageexports, 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 withloadModel, no network needed. - Image input needs decoding to RGBA before
loadImage;photon-nodeis 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.