Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docling_serve/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions docling_serve/orchestrator_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions docling_serve/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
29 changes: 29 additions & 0 deletions tests/test_allow_custom_config_settings.py
Original file line number Diff line number Diff line change
@@ -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