mirror of
https://github.com/docling-project/docling-serve.git
synced 2025-11-29 00:23:36 +00:00
Compare commits
8 Commits
2b8b44fa40
...
290d281687
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
290d281687 | ||
|
|
38f0f61361 | ||
|
|
2ab8b2dcc5 | ||
|
|
e437e830c9 | ||
|
|
2c23f65507 | ||
|
|
5dc942f25b | ||
|
|
ff310f2b13 | ||
|
|
bf132a3c3e |
20
CHANGELOG.md
20
CHANGELOG.md
@@ -1,3 +1,23 @@
|
||||
## [v1.8.0](https://github.com/docling-project/docling-serve/releases/tag/v1.8.0) - 2025-10-31
|
||||
|
||||
### Feature
|
||||
|
||||
* Docling with new standard pipeline with threading ([#428](https://github.com/docling-project/docling-serve/issues/428)) ([`bf132a3`](https://github.com/docling-project/docling-serve/commit/bf132a3c3e615ddbe624841ea5b3a98593c00654))
|
||||
|
||||
### Documentation
|
||||
|
||||
* Expand automatic docs to nested objects. More complete usage docs. ([#426](https://github.com/docling-project/docling-serve/issues/426)) ([`35319b0`](https://github.com/docling-project/docling-serve/commit/35319b0da793a2a1a434fd2b60b7632e10ecced3))
|
||||
* Add docs for docling parameters like performance and debug ([#424](https://github.com/docling-project/docling-serve/issues/424)) ([`f3957ae`](https://github.com/docling-project/docling-serve/commit/f3957aeb577097121fe9d0d21f75a50643f03369))
|
||||
|
||||
### Docling libraries included in this release:
|
||||
- docling 2.60.0
|
||||
- docling-core 2.50.0
|
||||
- docling-ibm-models 3.10.2
|
||||
- docling-jobkit 1.8.0
|
||||
- docling-mcp 1.3.2
|
||||
- docling-parse 4.7.0
|
||||
- docling-serve 1.8.0
|
||||
|
||||
## [v1.7.2](https://github.com/docling-project/docling-serve/releases/tag/v1.7.2) - 2025-10-30
|
||||
|
||||
### Fix
|
||||
|
||||
@@ -30,7 +30,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
def version_callback(value: bool) -> None:
|
||||
if value:
|
||||
docling_serve_version = importlib.metadata.version("docling_serve")
|
||||
docling_serve_version = importlib.metadata.version("docling-serve")
|
||||
docling_jobkit_version = importlib.metadata.version("docling-jobkit")
|
||||
docling_version = importlib.metadata.version("docling")
|
||||
docling_core_version = importlib.metadata.version("docling-core")
|
||||
@@ -385,6 +385,11 @@ def rq_worker() -> Any:
|
||||
allow_external_plugins=docling_serve_settings.allow_external_plugins,
|
||||
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,
|
||||
ocr_batch_size=docling_serve_settings.ocr_batch_size,
|
||||
layout_batch_size=docling_serve_settings.layout_batch_size,
|
||||
table_batch_size=docling_serve_settings.table_batch_size,
|
||||
batch_polling_interval_seconds=docling_serve_settings.batch_polling_interval_seconds,
|
||||
)
|
||||
|
||||
run_worker(
|
||||
|
||||
@@ -76,7 +76,7 @@ from docling_serve.datamodel.responses import (
|
||||
TaskStatusResponse,
|
||||
WebsocketMessage,
|
||||
)
|
||||
from docling_serve.helper_functions import FormDepends
|
||||
from docling_serve.helper_functions import DOCLING_VERSIONS, FormDepends
|
||||
from docling_serve.orchestrator_factory import get_async_orchestrator
|
||||
from docling_serve.response_preparation import prepare_response
|
||||
from docling_serve.settings import docling_serve_settings
|
||||
@@ -437,6 +437,16 @@ def create_app(): # noqa: C901
|
||||
def api_check() -> HealthCheckResponse:
|
||||
return HealthCheckResponse()
|
||||
|
||||
# Docling versions
|
||||
@app.get("/version", tags=["health"])
|
||||
def version_info() -> dict:
|
||||
if not docling_serve_settings.show_version_info:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Forbidden. The server is configured for not showing version details.",
|
||||
)
|
||||
return DOCLING_VERSIONS
|
||||
|
||||
# Convert a document from URL(s)
|
||||
@app.post(
|
||||
"/v1/convert/source",
|
||||
|
||||
@@ -1,11 +1,25 @@
|
||||
import importlib.metadata
|
||||
import inspect
|
||||
import json
|
||||
import platform
|
||||
import re
|
||||
import sys
|
||||
from typing import Union, get_args, get_origin
|
||||
|
||||
from fastapi import Depends, Form
|
||||
from pydantic import BaseModel, TypeAdapter
|
||||
|
||||
DOCLING_VERSIONS = {
|
||||
"docling-serve": importlib.metadata.version("docling-serve"),
|
||||
"docling-jobkit": importlib.metadata.version("docling-jobkit"),
|
||||
"docling": importlib.metadata.version("docling"),
|
||||
"docling-core": importlib.metadata.version("docling-core"),
|
||||
"docling-ibm-models": importlib.metadata.version("docling-ibm-models"),
|
||||
"docling-parse": importlib.metadata.version("docling-parse"),
|
||||
"python": f"{sys.implementation.cache_tag} ({platform.python_version()})",
|
||||
"plaform": platform.platform(),
|
||||
}
|
||||
|
||||
|
||||
def is_pydantic_model(type_):
|
||||
try:
|
||||
|
||||
@@ -288,6 +288,11 @@ def get_async_orchestrator() -> BaseOrchestrator:
|
||||
allow_external_plugins=docling_serve_settings.allow_external_plugins,
|
||||
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,
|
||||
ocr_batch_size=docling_serve_settings.ocr_batch_size,
|
||||
layout_batch_size=docling_serve_settings.layout_batch_size,
|
||||
table_batch_size=docling_serve_settings.table_batch_size,
|
||||
batch_polling_interval_seconds=docling_serve_settings.batch_polling_interval_seconds,
|
||||
)
|
||||
cm = DoclingConverterManager(config=cm_config)
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ class DoclingServeSettings(BaseSettings):
|
||||
options_cache_size: int = 2
|
||||
enable_remote_services: bool = False
|
||||
allow_external_plugins: bool = False
|
||||
show_version_info: bool = True
|
||||
|
||||
api_key: str = ""
|
||||
|
||||
@@ -57,6 +58,13 @@ class DoclingServeSettings(BaseSettings):
|
||||
max_num_pages: int = sys.maxsize
|
||||
max_file_size: int = sys.maxsize
|
||||
|
||||
# Threading pipeline
|
||||
queue_max_size: Optional[int] = None
|
||||
ocr_batch_size: Optional[int] = None
|
||||
layout_batch_size: Optional[int] = None
|
||||
table_batch_size: Optional[int] = None
|
||||
batch_polling_interval_seconds: Optional[float] = None
|
||||
|
||||
sync_poll_interval: int = 2 # seconds
|
||||
max_sync_wait: int = 120 # 2 minutes
|
||||
|
||||
|
||||
@@ -39,18 +39,23 @@ THe following table describes the options to configure the Docling Serve app.
|
||||
| | `DOCLING_SERVE_STATIC_PATH` | unset | If set to a valid directory, the static assets for the docs and UI will be loaded from this path |
|
||||
| | `DOCLING_SERVE_SCRATCH_PATH` | | If set, this directory will be used as scratch workspace, e.g. storing the results before they get requested. If unset, a temporary created is created for this purpose. |
|
||||
| `--enable-ui` | `DOCLING_SERVE_ENABLE_UI` | `false` | Enable the demonstrator UI. |
|
||||
| | `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_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. |
|
||||
| | `DOCLING_NUM_THREADS` | `4` | Number of concurrent threads for processing a document. |
|
||||
| | `DOCLING_SERVE_MAX_NUM_PAGES` | | The maximum number of pages for a document to be processed. |
|
||||
| | `DOCLING_SERVE_MAX_FILE_SIZE` | | The maximum file size for a document to be processed. |
|
||||
| | `DOCLING_SERVE_SYNC_POLL_INTERVAL` | `2` | Number of seconds to sleep between polling the task status in the sync endpoints. |
|
||||
| | `DOCLING_SERVE_MAX_SYNC_WAIT` | `120` | Max number of seconds a synchronous endpoint is waiting for the task completion. |
|
||||
| | `DOCLING_SERVE_LOAD_MODELS_AT_BOOT` | `True` | If enabled, the models for the default options will be loaded at boot. |
|
||||
| | `DOCLING_SERVE_OPTIONS_CACHE_SIZE` | `2` | How many DocumentConveter objects (including their loaded models) to keep in the cache. |
|
||||
| | `DOCLING_SERVE_QUEUE_MAX_SIZE` | | Size of the pages queue. Potentially so many pages opened at the same time. |
|
||||
| | `DOCLING_SERVE_OCR_BATCH_SIZE` | | Batch size for the OCR stage. |
|
||||
| | `DOCLING_SERVE_LAYOUT_BATCH_SIZE` | | Batch size for the layout detection stage. |
|
||||
| | `DOCLING_SERVE_TABLE_BATCH_SIZE` | | Batch size for the table structure stage. |
|
||||
| | `DOCLING_SERVE_BATCH_POLLING_INTERVAL_SECONDS` | | Wait time for gathering pages before starting a stage processing. |
|
||||
| | `DOCLING_SERVE_CORS_ORIGINS` | `["*"]` | A list of origins that should be permitted to make cross-origin requests. |
|
||||
| | `DOCLING_SERVE_CORS_METHODS` | `["*"]` | A list of HTTP methods that should be allowed for cross-origin requests. |
|
||||
| | `DOCLING_SERVE_CORS_HEADERS` | `["*"]` | A list of HTTP request headers that should be supported for cross-origin requests. |
|
||||
@@ -64,7 +69,7 @@ Some Docling settings, mostly about performance, are exposed as environment vari
|
||||
| ENV | Default | Description |
|
||||
| ----|---------|-------------|
|
||||
| `DOCLING_NUM_THREADS` | `4` | Number of concurrent threads used for the `torch` CPU execution. |
|
||||
| `DOCLING_DEVICE` | | Device used for the model execution. Valid values are `cpu`, `cude`, `mps`. When unset, the best device is chosen. For CUDA-enabled environments, you can choose which GPU using the syntax `cuda:0`, `cuda:1`, ... |
|
||||
| `DOCLING_DEVICE` | | Device used for the model execution. Valid values are `cpu`, `cuda`, `mps`. When unset, the best device is chosen. For CUDA-enabled environments, you can choose which GPU using the syntax `cuda:0`, `cuda:1`, ... |
|
||||
| `DOCLING_PERF_PAGE_BATCH_SIZE` | `4` | Number of pages processed in the same batch. |
|
||||
| `DOCLING_PERF_ELEMENTS_BATCH_SIZE` | `8` | Number of document items/elements processed in the same batch during enrichment. |
|
||||
| `DOCLING_DEBUG_PROFILE_PIPELINE_TIMINGS` | `false` | When enabled, Docling will provide detailed timings information. |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "docling-serve"
|
||||
version = "1.7.2" # DO NOT EDIT, updated automatically
|
||||
version = "1.8.0" # DO NOT EDIT, updated automatically
|
||||
description = "Running Docling as a service"
|
||||
license = {text = "MIT"}
|
||||
authors = [
|
||||
@@ -35,7 +35,7 @@ requires-python = ">=3.10"
|
||||
dependencies = [
|
||||
"docling~=2.38",
|
||||
"docling-core>=2.45.0",
|
||||
"docling-jobkit[kfp,rq,vlm]>=1.6.0,<2.0.0",
|
||||
"docling-jobkit[kfp,rq,vlm]>=1.8.0,<2.0.0",
|
||||
"fastapi[standard]<0.119.0", # ~=0.115
|
||||
"httpx~=0.28",
|
||||
"pydantic~=2.10",
|
||||
@@ -69,6 +69,9 @@ flash-attn = [
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"asgi-lifespan~=2.0",
|
||||
"httpx",
|
||||
"pydantic",
|
||||
"pydantic-settings",
|
||||
"mypy~=1.11",
|
||||
"pre-commit-uv~=4.1",
|
||||
"pypdf>=6.0.0",
|
||||
|
||||
Reference in New Issue
Block a user