Skip to content

Commit db3fdb5

Browse files
authored
feat: workers without shared models and convert params (#304)
Signed-off-by: Michele Dolfi <[email protected]>
1 parent fd1b987 commit db3fdb5

File tree

5 files changed

+614
-633
lines changed

5 files changed

+614
-633
lines changed

docling_serve/orchestrator_factory.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def get_async_orchestrator() -> BaseOrchestrator:
1919

2020
local_config = LocalOrchestratorConfig(
2121
num_workers=docling_serve_settings.eng_loc_num_workers,
22+
shared_models=docling_serve_settings.eng_loc_share_models,
2223
)
2324

2425
cm_config = DoclingConverterManagerConfig(

docling_serve/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class DoclingServeSettings(BaseSettings):
6363
eng_kind: AsyncEngine = AsyncEngine.LOCAL
6464
# Local engine
6565
eng_loc_num_workers: int = 2
66+
eng_loc_share_models: bool = False
6667
# KFP engine
6768
eng_kfp_endpoint: Optional[AnyUrl] = None
6869
eng_kfp_token: Optional[str] = None

docs/configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ The following table describes the options to configure the Docling Serve local e
6666
| ENV | Default | Description |
6767
|-----|---------|-------------|
6868
| `DOCLING_SERVE_ENG_LOC_NUM_WORKERS` | 2 | Number of workers/threads processing the incoming tasks. |
69+
| `DOCLING_SERVE_ENG_LOC_SHARE_MODELS` | False | If true, each process will share the same models among all thread workers. Otherwise, one instance of the models is allocated for each worker thread. |
6970

7071
#### KFP engine
7172

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ requires-python = ">=3.10"
3535
dependencies = [
3636
"docling~=2.38",
3737
"docling-core>=2.44.1",
38-
"docling-jobkit[kfp,vlm]~=1.2",
38+
"docling-jobkit[kfp,vlm]~=1.3",
3939
"fastapi[standard]~=0.115",
4040
"httpx~=0.28",
4141
"pydantic~=2.10",

0 commit comments

Comments
 (0)