fix: wire allow_custom_*_config flags from settings to DoclingConverterManagerConfig (#527)

Signed-off-by: Peter van Liesdonk <peter@liesdonk.nl>
This commit is contained in:
Peter van Liesdonk
2026-03-02 08:16:04 +01:00
committed by GitHub
parent be7ac72b33
commit 0de3b4fa1c
5 changed files with 41 additions and 0 deletions

View File

@@ -419,6 +419,9 @@ def rq_worker() -> Any:
options_cache_size=docling_serve_settings.options_cache_size,
enable_remote_services=docling_serve_settings.enable_remote_services,
allow_external_plugins=docling_serve_settings.allow_external_plugins,
allow_custom_vlm_config=docling_serve_settings.allow_custom_vlm_config,
allow_custom_picture_description_config=docling_serve_settings.allow_custom_picture_description_config,
allow_custom_code_formula_config=docling_serve_settings.allow_custom_code_formula_config,
max_num_pages=docling_serve_settings.max_num_pages,
max_file_size=docling_serve_settings.max_file_size,
queue_max_size=docling_serve_settings.queue_max_size,

View File

@@ -400,6 +400,9 @@ def get_async_orchestrator() -> BaseOrchestrator:
options_cache_size=docling_serve_settings.options_cache_size,
enable_remote_services=docling_serve_settings.enable_remote_services,
allow_external_plugins=docling_serve_settings.allow_external_plugins,
allow_custom_vlm_config=docling_serve_settings.allow_custom_vlm_config,
allow_custom_picture_description_config=docling_serve_settings.allow_custom_picture_description_config,
allow_custom_code_formula_config=docling_serve_settings.allow_custom_code_formula_config,
max_num_pages=docling_serve_settings.max_num_pages,
max_file_size=docling_serve_settings.max_file_size,
queue_max_size=docling_serve_settings.queue_max_size,

View File

@@ -57,6 +57,9 @@ class DoclingServeSettings(BaseSettings):
options_cache_size: int = 2
enable_remote_services: bool = False
allow_external_plugins: bool = False
allow_custom_vlm_config: bool = False
allow_custom_picture_description_config: bool = False
allow_custom_code_formula_config: bool = False
show_version_info: bool = True
enable_management_endpoints: bool = False

View File

@@ -44,6 +44,9 @@ THe following table describes the options to configure the Docling Serve app.
| | `DOCLING_SERVE_SHOW_VERSION_INFO` | `true` | If enabled, the `/version` endpoint will provide the Docling package versions, otherwise it will return a forbidden 403 error. |
| | `DOCLING_SERVE_ENABLE_REMOTE_SERVICES` | `false` | Allow pipeline components making remote connections. For example, this is needed when using a vision-language model via APIs. |
| | `DOCLING_SERVE_ALLOW_EXTERNAL_PLUGINS` | `false` | Allow the selection of third-party plugins. |
| | `DOCLING_SERVE_ALLOW_CUSTOM_VLM_CONFIG` | `false` | Allow users to specify a fully custom VLM pipeline configuration (`vlm_pipeline_custom_config`). When `false`, only presets are accepted. |
| | `DOCLING_SERVE_ALLOW_CUSTOM_PICTURE_DESCRIPTION_CONFIG` | `false` | Allow users to specify a fully custom picture description configuration. When `false`, only presets are accepted. |
| | `DOCLING_SERVE_ALLOW_CUSTOM_CODE_FORMULA_CONFIG` | `false` | Allow users to specify a fully custom code/formula configuration. When `false`, only presets are accepted. |
| | `DOCLING_SERVE_SINGLE_USE_RESULTS` | `true` | If true, results can be accessed only once. If false, the results accumulate in the scratch directory. |
| | `DOCLING_SERVE_RESULT_REMOVAL_DELAY` | `300` | When `DOCLING_SERVE_SINGLE_USE_RESULTS` is active, this is the delay before results are removed from the task registry. |
| | `DOCLING_SERVE_MAX_DOCUMENT_TIMEOUT` | `604800` (7 days) | The maximum time for processing a document. |

View File

@@ -0,0 +1,29 @@
"""Tests for allow_custom_*_config settings in docling-serve."""
from docling_serve.settings import DoclingServeSettings
class TestAllowCustomConfigSettings:
def test_allow_custom_vlm_config_defaults_false(self):
settings = DoclingServeSettings()
assert settings.allow_custom_vlm_config is False
def test_allow_custom_picture_description_config_defaults_false(self):
settings = DoclingServeSettings()
assert settings.allow_custom_picture_description_config is False
def test_allow_custom_code_formula_config_defaults_false(self):
settings = DoclingServeSettings()
assert settings.allow_custom_code_formula_config is False
def test_allow_custom_vlm_config_is_configurable(self):
settings = DoclingServeSettings(allow_custom_vlm_config=True)
assert settings.allow_custom_vlm_config is True
def test_allow_custom_picture_description_config_is_configurable(self):
settings = DoclingServeSettings(allow_custom_picture_description_config=True)
assert settings.allow_custom_picture_description_config is True
def test_allow_custom_code_formula_config_is_configurable(self):
settings = DoclingServeSettings(allow_custom_code_formula_config=True)
assert settings.allow_custom_code_formula_config is True