fix: Update uvx invocation and docling extras#1041
Conversation
Replace the single-platform ocr_pkg with a platform-aware docling_extras string and expand the uvx command to explicitly include onnxruntime, easyocr and docling extras (rapidocr, vlm, ocrmac on macOS). Move the UI-pinned spec into a --from argument and stop pinning docling-serve in the package list. These changes ensure the required runtimes and optional backends are requested during installation and clarify the package sourcing.
There was a problem hiding this comment.
Pull request overview
This PR updates how the TUI launches docling-serve via uvx, aiming to request the right optional OCR/VLM backends across platforms and to make package sourcing/pinning clearer.
Changes:
- Replace single OCR-package selection with a platform-aware
docling[...]extras string. - Update
uvxinvocation to use--from docling-serve[ui]==1.5.0and add explicit--withdependencies (e.g.,onnxruntime,easyocr, anddocling[...]). - Stop passing
docling-serve==1.5.0as the command argument and rundocling-serve run ...instead.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| try: | ||
| ocr_pkg = "ocrmac" if sys.platform == "darwin" else "easyocr" | ||
| docling_extras = "ocrmac,easyocr,rapidocr,vlm" if sys.platform == "darwin" else "easyocr,rapidocr,vlm" |
There was a problem hiding this comment.
docling_extras assignment is hard to read and exceeds typical line-length limits used elsewhere in this file. Please wrap this conditional across multiple lines (e.g., using parentheses) to keep formatting consistent and easier to maintain.
| docling_extras = "ocrmac,easyocr,rapidocr,vlm" if sys.platform == "darwin" else "easyocr,rapidocr,vlm" | |
| docling_extras = ( | |
| "ocrmac,easyocr,rapidocr,vlm" | |
| if sys.platform == "darwin" | |
| else "easyocr,rapidocr,vlm" | |
| ) |
| "--from", "docling-serve[ui]==1.5.0", | ||
| "--with", "onnxruntime", |
There was a problem hiding this comment.
The command always pins --from docling-serve[ui]==1.5.0 even when enable_ui is false. This forces UI dependencies (likely heavier, e.g. Gradio) to be installed on every start. Consider selecting docling-serve==1.5.0 by default and only using [ui] when enable_ui is true.
| ocr_pkg, | ||
| "--from", "docling-serve[ui]==1.5.0", | ||
| "--with", "onnxruntime", | ||
| "--with", "easyocr", |
There was a problem hiding this comment.
easyocr is requested twice: once via --with "easyocr" and again inside docling[{docling_extras}] (both branches include easyocr). This duplication increases resolver work and makes it harder to reason about intended deps; consider removing one of the two sources (either drop easyocr from the extras string or remove the standalone --with easyocr).
| "--with", "easyocr", |
|
Issue: Docling Serve fails with uvx due to incompatible transitive dependencies The previous uvx command used bare --with flags for OCR engines (e.g. --with easyocr, --with ocrmac) and invoked docling-serve==1.5.0 directly without --from. This caused uvx to resolve transitive dependencies (particularly docling-core, onnxruntime, and OCR engine packages) to incompatible versions, resulting in runtime errors: Root cause: The OCR engine extras (easyocr, ocrmac, rapidocr, vlm) belong to the docling package, not docling-serve. Passing them as standalone --with packages allowed uvx to pull mismatched versions. Additionally, docling-core was left unpinned, allowing breaking version drift. |
|
@mpawlow please review and merge this once you start. |
mpawlow
left a comment
There was a problem hiding this comment.
Functional Review 1
- Unfortunately, the latest fixed delivered to main did not work for me on Ubuntu 24.04.4 LTS
- The same error occurred as before after fully restarting all OpenRAG services
- Note: I started Docling via
make docling
- Note: I started Docling via
Langflow Logs
langflow | 2026-02-27T14:46:52.711335Z [error ] Error running method "as_dataframe": Error splitting text: 'list' object has no attribute 'export_to_markdown'
langflow | 2026-02-27T14:46:52.733167Z [error ] Exception in ComponentVertex: Error building Component Export DoclingDocument:
langflow |
langflow | Error running method "as_dataframe": Error splitting text: 'list' object has no attribute 'export_to_markdown'
langflow | 2026-02-27T14:46:52.776548Z [error ] Task ExportDoclingDocument-zZdRg Run 0 failed with exception: Error building Component Export DoclingDocument:
langflow |
langflow | Error running method "as_dataframe": Error splitting text: 'list' object has no attribute 'export_to_markdown'
langflow | 2026-02-27T14:46:52.779824Z [error ] Error executing tasks in layer 1
langflow | 2026-02-27T14:46:52.781602Z [error ] Exception in Graph: Error running graph: Error building Component Export DoclingDocument:
langflow |
langflow | Error running method "as_dataframe": Error splitting text: 'list' object has no attribute 'export_to_markdown'
Other Observations
- First Docling start-up crashed when the Frontend was loaded for the first time.
- New command:
uv tool uvx --from docling-serve[ui]==1.5.0 --with onnxruntime --with easyocr --with docling[easyocr,rapidocr,vlm] --with docling-core==2.48.1 --override /tmp/docling_cv_override_oq0ql0ut.txt --with opencv-python-headless docling-serve run --host 0.0.0.0 --port 5001 --workers 1 - Docling now takes ~45 seconds to start-up compared to < 10 seconds before
Functional Review 2
(1) An unsupported / out of sync version of Langflow was being used
(2) Default value for new
|

Replace the single-platform ocr_pkg with a platform-aware docling_extras string and expand the uvx command to explicitly include onnxruntime, easyocr and docling extras (rapidocr, vlm, ocrmac on macOS). Move the UI-pinned spec into a --from argument and stop pinning docling-serve in the package list. These changes ensure the required runtimes and optional backends are requested during installation and clarify the package sourcing.