Repository navigation
Read text in images with a vision model instead of local OCR - #448
Merged
Merged
Conversation
Images uploaded with use_colpali=false go through Docling, which runs RapidOCR on the worker's CPU and downloads its model files from modelscope.cn on first use. A CPU-only on-prem install has no way to send that work to a hosted model. A new [parser] image_ocr_model setting names a registered vision model. When set, PNG, JPEG, GIF, WebP, BMP and TIFF files are converted to PNG, scaled to at most 2048 px, and transcribed by that model through LiteLLM. The deep-parse fallback no longer reruns Docling on those images. Rate limits, timeouts and provider outages are raised as ConnectionError, so the worker retries the job; an invalid key fails the document. Unset keeps the current Docling path. Startup fails if the key is not in [registered_models]. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Images uploaded with
use_colpali=falsego through Docling, which runs RapidOCR on the worker CPU and downloads its model files from modelscope.cn the first time it runs. A CPU-only on-prem install had no way to hand that work to a hosted model. iQor asked for exactly that: OCR for Azure DevOps screenshots through OpenAI, without a GPU server.[parser] image_ocr_modelnames a key in[registered_models]. When it is set:ConnectionError, so the ingestion worker retries the job. An invalid key fails the document.[registered_models].When it is unset, nothing changes. PDFs, Office files and ColPali ingests are not affected. DOCKER.md and both example tomls document the setting.
Testing
core/tests/unit/test_image_ocr_model.py(9 tests): routing, PNG conversion of BMP/TIFF, downscaling, Docling still used when unset and for PDFs, deep fallback, retryable vs non-retryable errors, unknown key.image_ocr_modelpointing at a fake OpenAI-compatible server. A PNG and a BMP were each sent once as a high-detail PNG data URI, and their text became chunks. A PDF still went through Docling. With the fake server stopped, the image job logged a transient retry and stayedprocessing. After the server came back, it completed.test_docker_lifecyclebackup test,test_colpali_embedding,test_document_download,test_reranker,test_multivector) behave the same onmain.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.