Skip to content

fix: Update uvx invocation and docling extras#1041

Merged
lucaseduoli merged 2 commits into
mainfrom
fix-docling-easy-ocr
Feb 27, 2026
Merged

fix: Update uvx invocation and docling extras#1041
lucaseduoli merged 2 commits into
mainfrom
fix-docling-easy-ocr

Conversation

@edwinjosechittilappilly

Copy link
Copy Markdown
Collaborator

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.

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.
Copilot AI review requested due to automatic review settings February 27, 2026 00:57
@github-actions github-actions Bot added backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) bug 🔴 Something isn't working. labels Feb 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 uvx invocation to use --from docling-serve[ui]==1.5.0 and add explicit --with dependencies (e.g., onnxruntime, easyocr, and docling[...]).
  • Stop passing docling-serve==1.5.0 as the command argument and run docling-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"

Copilot AI Feb 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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"
)

Copilot uses AI. Check for mistakes.
Comment on lines +294 to +295
"--from", "docling-serve[ui]==1.5.0",
"--with", "onnxruntime",

Copilot AI Feb 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
ocr_pkg,
"--from", "docling-serve[ui]==1.5.0",
"--with", "onnxruntime",
"--with", "easyocr",

Copilot AI Feb 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
"--with", "easyocr",

Copilot uses AI. Check for mistakes.
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Feb 27, 2026
@edwinjosechittilappilly

Copy link
Copy Markdown
Collaborator Author

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:
EasyOCR is not installed -- despite being specified as an extra
onnxruntime is not installed -- RapidOCR (the new default OCR engine) couldn't find its backend
called add_log but no component context found -- context propagation failure in Langflow components
404 Not Found on /v1/result/... -- docling-serve task failures due to OCR engine crashes

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.

@edwinjosechittilappilly

Copy link
Copy Markdown
Collaborator Author

@mpawlow please review and merge this once you start.

@lucaseduoli lucaseduoli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lucaseduoli lucaseduoli merged commit a5b1fd6 into main Feb 27, 2026
10 checks passed
@github-actions github-actions Bot added the lgtm label Feb 27, 2026
@github-actions github-actions Bot deleted the fix-docling-easy-ocr branch February 27, 2026 12:11

@mpawlow mpawlow left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edwinjosechittilappilly

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

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

@mpawlow

mpawlow commented Feb 27, 2026

Copy link
Copy Markdown
Collaborator

@edwinjosechittilappilly

Functional Review 2

  • ✅ Successfully ingested sample / sanity documents on Ubuntu 24.04.4 LTS Fyre VM
image
  • After a detailed investigation with @lucaseduoli, there were 2 issues with my development environment that needed to be resolved

(1) An unsupported / out of sync version of Langflow was being used

  • I was using Langflow 1.8.0 (latest) - which is not supported by OpenRAG yet
  • The resolution was to downgrade and use Langflow 1.7.0.dev21 (latest)

(2) Default value for new OPENSEARCH_HOST .env value doesn't work in remote VM

  • My Ubuntu 24.04.4 LTS Fyre VM is hosted remotely and accessed via public IP address
  • The default opensearch value is the internal Docker network address; but, it cannot be resolved by the Frontend application when running in an external web browser hosted on another machine
    • It did work fine for intra-application communication between the other backend OpenRAG dependencies
OPENSEARCH_HOST=opensearch
  • This didn't work either
OPENSEARCH_HOST=0.0.0.0
  • But using the external public IP address of the Fyre VM worked both in the Frontend and Backend contexts
OPENSEARCH_HOST=9.46.110.49
  • Pain Point: The .env file is shared between all OpenRAG dependencies rather than each application having a unique environment / config file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) bug 🔴 Something isn't working. lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Unable to ingest documents in my development environment due to Docling changes

4 participants