Repository navigation
fix(vlm): default the Unlimited-OCR presets to a local server - #5608
Conversation
|
✅ DCO Check Passed Thanks @dolfim-ibm, all your commits are properly signed off. 🎉 |
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
AI triage (advisory)Checked commit The CI safety: no concern found. A maintainer must still approve CI. The |
There was a problem hiding this comment.
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.
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>
73693c9 to
10c8dc0
Compare
There was a problem hiding this comment.
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.
The
unlimited_ocrandunlimited_ocr2presets setdefault_engine_type=VlmEngineType.API_OPENAIand no address. ThusApiVlmEngineOptionsused 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-servicesand 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 genericVlmEngineType.APIengine, orAPI_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_ocrandunlimited_ocr2now setdefault_engine_type=VlmEngineType.API. Without a URL, the preset uses the default address of that engine,http://localhost:11434/v1/chat/completions.VlmEngineType.APIandVlmEngineType.API_OPENAI, so the served model name andskip_special_tokens=Falseapply with either engine. Forunlimited_ocr, the override is now a shared constant, as it already was forunlimited_ocr2.docs/usage/model_catalog.md: the text no longer says that the CLI uses the OpenAI URL. It names the local default address.ApiVlmEngineOptions, to theAPI_OPENAIdefault URL for other users, or to the CLI.Tests
tests/test_unlimited_ocr2.py: for both presets with no engine options, the engine isVlmEngineType.API, the URL host islocalhost, and the API parameters keep the served model name andskip_special_tokens=False.tests/test_unlimited_ocr2.py,tests/test_unlimited_ocr_markdown.pyandtests/test_vlm_presets_and_runtime_options.py: 112 passed, 1 skipped. No test uses the network.make validatepasses.Thanks @lucagattoni for reporting this.