Skip to content

fix(vlm): default the Unlimited-OCR presets to a local server - #5608

Merged
dolfim-ibm merged 1 commit into
mainfrom
fix/unlimited-ocr-preset-url
Nov 26, 2026
Merged

dolfim-ibm merged 1 commit into
mainfrom
fix/unlimited-ocr-preset-url

Conversation

@dolfim-ibm

@dolfim-ibm dolfim-ibm commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

The unlimited_ocr and unlimited_ocr2 presets set default_engine_type=VlmEngineType.API_OPENAI and no address. Thus ApiVlmEngineOptions used its default URL for that engine, https://api.openai.com/v1/chat/completions. These models run only on a self-hosted OpenAI-compatible server. When a user selected one of these presets with --enable-remote-services and gave no address, Docling sent the page images to api.openai.com, and the request failed. The other presets for self-hosted servers use the generic VlmEngineType.API engine, or API_OLLAMA, and both default to a local address. This change makes the two presets do the same.

Changes

  • docling/datamodel/stage_model_specs.py:
    • unlimited_ocr and unlimited_ocr2 now set default_engine_type=VlmEngineType.API. Without a URL, the preset uses the default address of that engine, http://localhost:11434/v1/chat/completions.
    • The API overrides of both presets are keyed on VlmEngineType.API and VlmEngineType.API_OPENAI, so the served model name and skip_special_tokens=False apply with either engine. For unlimited_ocr, the override is now a shared constant, as it already was for unlimited_ocr2.
  • docs/usage/model_catalog.md: the text no longer says that the CLI uses the OpenAI URL. It names the local default address.
  • No change to ApiVlmEngineOptions, to the API_OPENAI default URL for other users, or to the CLI.

Tests

  • tests/test_unlimited_ocr2.py: for both presets with no engine options, the engine is VlmEngineType.API, the URL host is localhost, and the API parameters keep the served model name and skip_special_tokens=False.
  • tests/test_unlimited_ocr2.py, tests/test_unlimited_ocr_markdown.py and tests/test_vlm_presets_and_runtime_options.py: 112 passed, 1 skipped. No test uses the network.
  • make validate passes.

Thanks @lucagattoni for reporting this.

@github-actions

Copy link
Copy Markdown
Contributor

✅ DCO Check Passed

Thanks @dolfim-ibm, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 Merge protection satisfied — ready to merge.

Show 1 satisfied protection

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@github-actions github-actions Bot added ai:ci-safe AI triage found no CI-safety concern (advisory) bug Something isn't working CLI issues related to the command line interface (CLI) ocr priority:medium vlm-pipeline labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

AI triage (advisory)

Checked commit 10c8dc02a9. The analysis read the diff only. It did not run code from this pull request.

The unlimited_ocr and unlimited_ocr2 presets now default to the generic VlmEngineType.API engine. The default is a local address, not api.openai.com. The API overrides apply to both engine types. The PR also updates the docs and adds a test.

CI safety: no concern found. A maintainer must still approve CI.

The ai:* labels are advisory. They do not approve CI and they do not add tests:full. A new push runs this check again.

@github-actions github-actions Bot 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.

AI first review (advisory): no blocker found

This review covers the full diff at 73693c98ae. It read the code and did not run it.

I found no defect that blocks the merge. I checked from_preset() in docling/datamodel/stage_model_specs.py, the CLI branch in docling/cli/main.py, the existing callers of the two presets, and the new tests. I did not run anything.

A maintainer makes the merge decision. This review never approves the pull request.

@github-actions github-actions Bot added the ai:review-lgtm AI first review found no blocker or major issue (advisory) label Nov 26, 2026
@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

The unlimited_ocr and unlimited_ocr2 presets defaulted to the API_OPENAI
engine with no URL, so they fell back to the OpenAI address. These models
run only on a self-hosted OpenAI-compatible server. Use the generic API
engine, which defaults to a local address, as the other self-hosted
presets do, and key the API overrides on it.

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
@dolfim-ibm
dolfim-ibm force-pushed the fix/unlimited-ocr-preset-url branch from 73693c9 to 10c8dc0 Compare November 26, 2026 10:36
@github-actions github-actions Bot removed ai:ci-safe AI triage found no CI-safety concern (advisory) ai:review-lgtm AI first review found no blocker or major issue (advisory) labels Nov 26, 2026
@dolfim-ibm dolfim-ibm changed the title fix(vlm): require a server URL for the Unlimited-OCR presets fix(vlm): default the Unlimited-OCR presets to a local server Nov 26, 2026
@github-actions github-actions Bot added the ai:ci-safe AI triage found no CI-safety concern (advisory) label Nov 26, 2026

@github-actions github-actions Bot 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.

AI first review (advisory): no blocker found

This review covers the full diff at 10c8dc02a9. It read the code and did not run it.

I found no defect. For both presets, ApiVlmEngineOptions now defaults to http://localhost:11434/v1/chat/completions instead of api.openai.com. The API and API_OPENAI overrides keep the served model name and skip_special_tokens=False on both engines.

A maintainer makes the merge decision. This review never approves the pull request.

@github-actions github-actions Bot added the ai:review-lgtm AI first review found no blocker or major issue (advisory) label Nov 26, 2026
@dolfim-ibm
dolfim-ibm merged commit 041836e into main Nov 26, 2026
34 checks passed
@dolfim-ibm
dolfim-ibm deleted the fix/unlimited-ocr-preset-url branch November 26, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai:ci-safe AI triage found no CI-safety concern (advisory) ai:review-lgtm AI first review found no blocker or major issue (advisory) bug Something isn't working CLI issues related to the command line interface (CLI) ocr priority:medium vlm-pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants