fix: wire allow_custom_*_config flags from settings to DoclingConverterManagerConfig#527
Merged
dolfim-ibm merged 1 commit intodocling-project:mainfrom Mar 2, 2026
Conversation
…erManagerConfig The `allow_custom_vlm_config`, `allow_custom_picture_description_config`, and `allow_custom_code_formula_config` flags exist in docling-jobkit's `DoclingConverterManagerConfig` but were never exposed in docling-serve. As a result, `vlm_pipeline_custom_config` (and its siblings) always raised a 422 error regardless of any env var an administrator set. Add the three fields to `DoclingServeSettings`, wired via pydantic-settings to: - `DOCLING_SERVE_ALLOW_CUSTOM_VLM_CONFIG` - `DOCLING_SERVE_ALLOW_CUSTOM_PICTURE_DESCRIPTION_CONFIG` - `DOCLING_SERVE_ALLOW_CUSTOM_CODE_FORMULA_CONFIG` Pass the fields through in both `DoclingConverterManagerConfig` instantiation sites (`orchestrator_factory.py` and `__main__.py`), following the same pattern established for `allow_external_plugins` in docling-project#328. Update `docs/configuration.md` to document the three new env vars. Resolves docling-project#526 Signed-off-by: Peter van Liesdonk <peter@liesdonk.nl>
Contributor
|
✅ DCO Check Passed Thanks @pvliesdonk, all your commits are properly signed off. 🎉 |
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
|
Documentation Updates 2 document(s) were updated by changes in this PR: How can I use Docling's REST API to convert a PDF from a URL to Markdown with OpenAI-generated image descriptions, and is base64 encoding required for URL sources?View Changes@@ -14,7 +14,7 @@
| `to_formats` | list | Output formats. Example: `["md"]`. |
| `do_picture_description` | bool | If enabled, describe pictures in documents. Boolean. Optional, defaults to false. |
| `picture_description_preset` | str or null | Preset ID for picture description. Recommended for most users. |
-| `picture_description_custom_config` | dict or null | Custom configuration for picture description (advanced). **Requires administrator permission** - see note below. |
+| `picture_description_custom_config` | dict or null | Custom configuration for picture description (advanced). **Requires administrator permission** - see note above. |
| `picture_description_api` | dict or null | **DEPRECATED**: API details for using a vision-language model in the picture description. Please migrate to `picture_description_preset` or `picture_description_custom_config`. |
| `picture_description_area_threshold` | float | Minimum percentage of the area for a picture to be processed with the models. |
| `image_alt_mode` | str | Controls how alt text is generated for images: `static`, `caption`, or `description`. |How can you use Docling's REST API to convert a PDF to Markdown and generate image descriptions using an OpenAI model?View Changes@@ -78,12 +78,12 @@
>
> Custom configuration parameters require administrator permission to use. By default, these features are disabled for security reasons.
>
-> **To enable custom configurations, your administrator must set:**
-> - `DOCLING_SERVE_ALLOW_CUSTOM_PICTURE_DESCRIPTION_CONFIG=true` for custom picture description configs
-> - `DOCLING_SERVE_ALLOW_CUSTOM_VLM_CONFIG=true` for custom VLM pipeline configs
-> - `DOCLING_SERVE_ALLOW_CUSTOM_CODE_FORMULA_CONFIG=true` for custom code/formula configs
+> **To enable custom configurations, your administrator must set these environment variables:**
+> - `DOCLING_SERVE_ALLOW_CUSTOM_PICTURE_DESCRIPTION_CONFIG=true` — Enables `picture_description_custom_config`
+> - `DOCLING_SERVE_ALLOW_CUSTOM_VLM_CONFIG=true` — Enables `vlm_pipeline_custom_config`
+> - `DOCLING_SERVE_ALLOW_CUSTOM_CODE_FORMULA_CONFIG=true` — Enables `code_formula_custom_config`
>
-> If these environment variables are not enabled, attempting to use `picture_description_custom_config`, `vlm_pipeline_custom_config`, or `code_formula_custom_config` will result in a **422 error**.
+> When set to `false` (the default), only presets are accepted. If these environment variables are not enabled, attempting to use the respective custom configuration parameters will result in a **422 error**.
>
> **Contact your Docling Serve administrator if you need access to custom configuration options.**
|
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.
vlm_pipeline_custom_config(and its picture-description and code/formula siblings) always raises a 422 error claiming custom configuration is not allowed, even when an administrator intends to permit it. There is no environment variable that actually enables these features.Root cause:
DoclingConverterManagerConfigin docling-jobkit has three admin-facing flags:allow_custom_vlm_config(defaultFalse)allow_custom_picture_description_config(defaultFalse)allow_custom_code_formula_config(defaultFalse)Neither instantiation site in docling-serve (
orchestrator_factory.py,__main__.py) passes these flags, so they are permanentlyFalseregardless of any environment variable.Fix: Add the three fields to
DoclingServeSettings, which pydantic-settings maps to env vars automatically:DOCLING_SERVE_ALLOW_CUSTOM_VLM_CONFIGDOCLING_SERVE_ALLOW_CUSTOM_PICTURE_DESCRIPTION_CONFIGDOCLING_SERVE_ALLOW_CUSTOM_CODE_FORMULA_CONFIGThen pass them through in both
DoclingConverterManagerConfiginstantiation sites. This follows the identical pattern established forallow_external_pluginsin #328.Also updates
docs/configuration.mdto document the three new env vars.Issue resolved by this Pull Request:
Resolves #526