Pipeline options
Pipeline options allow to customize the execution of the models during the conversion pipeline.
This includes options for the OCR engines, the table model as well as enrichment options which
can be enabled with do_xyz = True.
This is an automatic generated API reference of the all the pipeline options available in Docling.
pipeline_options
Classes:
-
AsrPipelineOptions– -
BaseLayoutOptions–Base options for layout models.
-
BaseOptions–Base class for options.
-
BaseTableStructureOptions–Base options for table structure models.
-
ConvertPipelineOptions–Base convert pipeline options.
-
EasyOcrOptions–Options for the EasyOCR engine.
-
LayoutOptions–Options for layout processing.
-
OcrAutoOptions–Options for pick OCR engine automatically.
-
OcrEngine–Enum of valid OCR engines.
-
OcrMacOptions–Options for the Mac OCR engine.
-
OcrOptions–OCR options.
-
PaginatedPipelineOptions– -
PdfBackend–Enum of valid PDF backends.
-
PdfPipelineOptions–Options for the PDF pipeline.
-
PictureDescriptionApiOptions– -
PictureDescriptionBaseOptions– -
PictureDescriptionVlmOptions– -
PipelineOptions–Base pipeline options.
-
ProcessingPipeline– -
RapidOcrOptions–Options for the RapidOCR engine.
-
TableFormerMode–Modes for the TableFormer model.
-
TableStructureOptions–Options for the table structure.
-
TesseractCliOcrOptions–Options for the TesseractCli engine.
-
TesseractOcrOptions–Options for the Tesseract engine.
-
ThreadedPdfPipelineOptions–Pipeline options for the threaded PDF pipeline with batching and backpressure control
-
VlmExtractionPipelineOptions–Options for extraction pipeline.
-
VlmPipelineOptions–
Attributes:
granite_picture_description
module-attribute
granite_picture_description = PictureDescriptionVlmOptions(repo_id='ibm-granite/granite-vision-3.3-2b', prompt='What is shown in this image?')
smolvlm_picture_description
module-attribute
smolvlm_picture_description = PictureDescriptionVlmOptions(repo_id='HuggingFaceTB/SmolVLM-256M-Instruct')
AsrPipelineOptions
pydantic-model
Bases: PipelineOptions
Show JSON schema:
{
"$defs": {
"AcceleratorDevice": {
"description": "Devices to run model inference",
"enum": [
"auto",
"cpu",
"cuda",
"mps"
],
"title": "AcceleratorDevice",
"type": "string"
},
"AcceleratorOptions": {
"additionalProperties": false,
"properties": {
"num_threads": {
"default": 4,
"title": "Num Threads",
"type": "integer"
},
"device": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/$defs/AcceleratorDevice"
}
],
"default": "auto",
"title": "Device"
},
"cuda_use_flash_attention2": {
"default": false,
"title": "Cuda Use Flash Attention2",
"type": "boolean"
}
},
"title": "AcceleratorOptions",
"type": "object"
},
"InlineAsrOptions": {
"properties": {
"kind": {
"const": "inline_model_options",
"default": "inline_model_options",
"title": "Kind",
"type": "string"
},
"repo_id": {
"title": "Repo Id",
"type": "string"
},
"verbose": {
"default": false,
"title": "Verbose",
"type": "boolean"
},
"timestamps": {
"default": true,
"title": "Timestamps",
"type": "boolean"
},
"temperature": {
"default": 0.0,
"title": "Temperature",
"type": "number"
},
"max_new_tokens": {
"default": 256,
"title": "Max New Tokens",
"type": "integer"
},
"max_time_chunk": {
"default": 30.0,
"title": "Max Time Chunk",
"type": "number"
},
"torch_dtype": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Torch Dtype"
},
"supported_devices": {
"default": [
"cpu",
"cuda",
"mps"
],
"items": {
"$ref": "#/$defs/AcceleratorDevice"
},
"title": "Supported Devices",
"type": "array"
}
},
"required": [
"repo_id"
],
"title": "InlineAsrOptions",
"type": "object"
}
},
"properties": {
"document_timeout": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.",
"examples": [
10.0,
20.0
],
"title": "Document Timeout"
},
"accelerator_options": {
"$ref": "#/$defs/AcceleratorOptions",
"default": {
"num_threads": 4,
"device": "auto",
"cuda_use_flash_attention2": false
},
"description": "Configuration options for hardware acceleration (e.g., GPU or optimized execution settings)."
},
"enable_remote_services": {
"default": false,
"description": "Enable calling external APIs or cloud services during pipeline execution.",
"examples": [
false
],
"title": "Enable Remote Services",
"type": "boolean"
},
"allow_external_plugins": {
"default": false,
"description": "Allow loading external third-party plugins or modules. Disabled by default for safety.",
"examples": [
false
],
"title": "Allow External Plugins",
"type": "boolean"
},
"artifacts_path": {
"anyOf": [
{
"format": "path",
"type": "string"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.",
"examples": [
"./artifacts",
"/tmp/docling_outputs"
],
"title": "Artifacts Path"
},
"asr_options": {
"$ref": "#/$defs/InlineAsrOptions",
"default": {
"kind": "inline_model_options",
"repo_id": "tiny",
"verbose": true,
"timestamps": true,
"temperature": 0.0,
"max_new_tokens": 256,
"max_time_chunk": 30.0,
"torch_dtype": null,
"supported_devices": [
"cpu",
"cuda"
],
"inference_framework": "whisper",
"language": "en",
"word_timestamps": true
}
}
},
"title": "AsrPipelineOptions",
"type": "object"
}
Fields:
-
document_timeout(Annotated[Optional[float], Field(description='Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.', examples=[10.0, 20.0])]) -
accelerator_options(Annotated[AcceleratorOptions, Field(description='Configuration options for hardware acceleration (e.g., GPU or optimized execution settings).')]) -
enable_remote_services(Annotated[bool, Field(description='Enable calling external APIs or cloud services during pipeline execution.', examples=[False])]) -
allow_external_plugins(Annotated[bool, Field(description='Allow loading external third-party plugins or modules. Disabled by default for safety.', examples=[False])]) -
artifacts_path(Annotated[Optional[Union[Path, str]], Field(description='Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.', examples=['./artifacts', '/tmp/docling_outputs'])]) -
asr_options(Union[InlineAsrOptions])
accelerator_options
pydantic-field
accelerator_options: Annotated[AcceleratorOptions, Field(description='Configuration options for hardware acceleration (e.g., GPU or optimized execution settings).')]
allow_external_plugins
pydantic-field
allow_external_plugins: Annotated[bool, Field(description='Allow loading external third-party plugins or modules. Disabled by default for safety.', examples=[False])] = False
artifacts_path
pydantic-field
artifacts_path: Annotated[Optional[Union[Path, str]], Field(description='Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.', examples=['./artifacts', '/tmp/docling_outputs'])] = None
asr_options
pydantic-field
asr_options: Union[InlineAsrOptions] = WHISPER_TINY
document_timeout
pydantic-field
document_timeout: Annotated[Optional[float], Field(description='Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.', examples=[10.0, 20.0])] = None
enable_remote_services
pydantic-field
enable_remote_services: Annotated[bool, Field(description='Enable calling external APIs or cloud services during pipeline execution.', examples=[False])] = False
kind
class-attribute
kind: str
BaseLayoutOptions
pydantic-model
Bases: BaseOptions
Base options for layout models.
Show JSON schema:
{
"description": "Base options for layout models.",
"properties": {
"keep_empty_clusters": {
"default": false,
"title": "Keep Empty Clusters",
"type": "boolean"
},
"skip_cell_assignment": {
"default": false,
"title": "Skip Cell Assignment",
"type": "boolean"
}
},
"title": "BaseLayoutOptions",
"type": "object"
}
Fields:
-
keep_empty_clusters(bool) -
skip_cell_assignment(bool)
keep_empty_clusters
pydantic-field
keep_empty_clusters: bool = False
kind
class-attribute
kind: str
skip_cell_assignment
pydantic-field
skip_cell_assignment: bool = False
BaseOptions
pydantic-model
Bases: BaseModel
Base class for options.
Show JSON schema:
{
"description": "Base class for options.",
"properties": {},
"title": "BaseOptions",
"type": "object"
}
kind
class-attribute
kind: str
BaseTableStructureOptions
pydantic-model
Bases: BaseOptions
Base options for table structure models.
Show JSON schema:
{
"description": "Base options for table structure models.",
"properties": {},
"title": "BaseTableStructureOptions",
"type": "object"
}
kind
class-attribute
kind: str
ConvertPipelineOptions
pydantic-model
Bases: PipelineOptions
Base convert pipeline options.
Show JSON schema:
{
"$defs": {
"AcceleratorDevice": {
"description": "Devices to run model inference",
"enum": [
"auto",
"cpu",
"cuda",
"mps"
],
"title": "AcceleratorDevice",
"type": "string"
},
"AcceleratorOptions": {
"additionalProperties": false,
"properties": {
"num_threads": {
"default": 4,
"title": "Num Threads",
"type": "integer"
},
"device": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/$defs/AcceleratorDevice"
}
],
"default": "auto",
"title": "Device"
},
"cuda_use_flash_attention2": {
"default": false,
"title": "Cuda Use Flash Attention2",
"type": "boolean"
}
},
"title": "AcceleratorOptions",
"type": "object"
},
"PictureDescriptionBaseOptions": {
"properties": {
"batch_size": {
"default": 8,
"title": "Batch Size",
"type": "integer"
},
"scale": {
"default": 2,
"title": "Scale",
"type": "number"
},
"picture_area_threshold": {
"default": 0.05,
"title": "Picture Area Threshold",
"type": "number"
}
},
"title": "PictureDescriptionBaseOptions",
"type": "object"
}
},
"description": "Base convert pipeline options.",
"properties": {
"document_timeout": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.",
"examples": [
10.0,
20.0
],
"title": "Document Timeout"
},
"accelerator_options": {
"$ref": "#/$defs/AcceleratorOptions",
"default": {
"num_threads": 4,
"device": "auto",
"cuda_use_flash_attention2": false
},
"description": "Configuration options for hardware acceleration (e.g., GPU or optimized execution settings)."
},
"enable_remote_services": {
"default": false,
"description": "Enable calling external APIs or cloud services during pipeline execution.",
"examples": [
false
],
"title": "Enable Remote Services",
"type": "boolean"
},
"allow_external_plugins": {
"default": false,
"description": "Allow loading external third-party plugins or modules. Disabled by default for safety.",
"examples": [
false
],
"title": "Allow External Plugins",
"type": "boolean"
},
"artifacts_path": {
"anyOf": [
{
"format": "path",
"type": "string"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.",
"examples": [
"./artifacts",
"/tmp/docling_outputs"
],
"title": "Artifacts Path"
},
"do_picture_classification": {
"default": false,
"title": "Do Picture Classification",
"type": "boolean"
},
"do_picture_description": {
"default": false,
"title": "Do Picture Description",
"type": "boolean"
},
"picture_description_options": {
"$ref": "#/$defs/PictureDescriptionBaseOptions",
"default": {
"batch_size": 8,
"scale": 2.0,
"picture_area_threshold": 0.05,
"repo_id": "HuggingFaceTB/SmolVLM-256M-Instruct",
"prompt": "Describe this image in a few sentences.",
"generation_config": {
"do_sample": false,
"max_new_tokens": 200
}
}
}
},
"title": "ConvertPipelineOptions",
"type": "object"
}
Fields:
-
document_timeout(Annotated[Optional[float], Field(description='Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.', examples=[10.0, 20.0])]) -
accelerator_options(Annotated[AcceleratorOptions, Field(description='Configuration options for hardware acceleration (e.g., GPU or optimized execution settings).')]) -
enable_remote_services(Annotated[bool, Field(description='Enable calling external APIs or cloud services during pipeline execution.', examples=[False])]) -
allow_external_plugins(Annotated[bool, Field(description='Allow loading external third-party plugins or modules. Disabled by default for safety.', examples=[False])]) -
artifacts_path(Annotated[Optional[Union[Path, str]], Field(description='Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.', examples=['./artifacts', '/tmp/docling_outputs'])]) -
do_picture_classification(bool) -
do_picture_description(bool) -
picture_description_options(PictureDescriptionBaseOptions)
accelerator_options
pydantic-field
accelerator_options: Annotated[AcceleratorOptions, Field(description='Configuration options for hardware acceleration (e.g., GPU or optimized execution settings).')]
allow_external_plugins
pydantic-field
allow_external_plugins: Annotated[bool, Field(description='Allow loading external third-party plugins or modules. Disabled by default for safety.', examples=[False])] = False
artifacts_path
pydantic-field
artifacts_path: Annotated[Optional[Union[Path, str]], Field(description='Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.', examples=['./artifacts', '/tmp/docling_outputs'])] = None
do_picture_classification
pydantic-field
do_picture_classification: bool = False
do_picture_description
pydantic-field
do_picture_description: bool = False
document_timeout
pydantic-field
document_timeout: Annotated[Optional[float], Field(description='Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.', examples=[10.0, 20.0])] = None
enable_remote_services
pydantic-field
enable_remote_services: Annotated[bool, Field(description='Enable calling external APIs or cloud services during pipeline execution.', examples=[False])] = False
kind
class-attribute
kind: str
picture_description_options
pydantic-field
picture_description_options: PictureDescriptionBaseOptions = smolvlm_picture_description
EasyOcrOptions
pydantic-model
Bases: OcrOptions
Options for the EasyOCR engine.
Show JSON schema:
{
"additionalProperties": false,
"description": "Options for the EasyOCR engine.",
"properties": {
"lang": {
"default": [
"fr",
"de",
"es",
"en"
],
"items": {
"type": "string"
},
"title": "Lang",
"type": "array"
},
"force_full_page_ocr": {
"default": false,
"description": "If enabled, a full-page OCR is always applied.",
"examples": [
false
],
"title": "Force Full Page Ocr",
"type": "boolean"
},
"bitmap_area_threshold": {
"default": 0.05,
"description": "Percentage of the page area for a bitmap to be processed with OCR.",
"examples": [
0.05,
0.1
],
"title": "Bitmap Area Threshold",
"type": "number"
},
"use_gpu": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Use Gpu"
},
"confidence_threshold": {
"default": 0.5,
"title": "Confidence Threshold",
"type": "number"
},
"model_storage_directory": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Model Storage Directory"
},
"recog_network": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": "standard",
"title": "Recog Network"
},
"download_enabled": {
"default": true,
"title": "Download Enabled",
"type": "boolean"
},
"suppress_mps_warnings": {
"default": true,
"title": "Suppress Mps Warnings",
"type": "boolean"
}
},
"title": "EasyOcrOptions",
"type": "object"
}
Config:
extra:forbidprotected_namespaces:()
Fields:
-
force_full_page_ocr(Annotated[bool, Field(description='If enabled, a full-page OCR is always applied.', examples=[False])]) -
bitmap_area_threshold(Annotated[float, Field(description='Percentage of the page area for a bitmap to be processed with OCR.', examples=[0.05, 0.1])]) -
lang(List[str]) -
use_gpu(Optional[bool]) -
confidence_threshold(float) -
model_storage_directory(Optional[str]) -
recog_network(Optional[str]) -
download_enabled(bool) -
suppress_mps_warnings(bool)
bitmap_area_threshold
pydantic-field
bitmap_area_threshold: Annotated[float, Field(description='Percentage of the page area for a bitmap to be processed with OCR.', examples=[0.05, 0.1])] = 0.05
confidence_threshold
pydantic-field
confidence_threshold: float = 0.5
download_enabled
pydantic-field
download_enabled: bool = True
force_full_page_ocr
pydantic-field
force_full_page_ocr: Annotated[bool, Field(description='If enabled, a full-page OCR is always applied.', examples=[False])] = False
kind
class-attribute
kind: Literal['easyocr'] = 'easyocr'
lang
pydantic-field
lang: List[str] = ['fr', 'de', 'es', 'en']
model_config
class-attribute
instance-attribute
model_config = ConfigDict(extra='forbid', protected_namespaces=())
model_storage_directory
pydantic-field
model_storage_directory: Optional[str] = None
recog_network
pydantic-field
recog_network: Optional[str] = 'standard'
suppress_mps_warnings
pydantic-field
suppress_mps_warnings: bool = True
use_gpu
pydantic-field
use_gpu: Optional[bool] = None
LayoutOptions
pydantic-model
Bases: BaseLayoutOptions
Options for layout processing.
Show JSON schema:
{
"$defs": {
"AcceleratorDevice": {
"description": "Devices to run model inference",
"enum": [
"auto",
"cpu",
"cuda",
"mps"
],
"title": "AcceleratorDevice",
"type": "string"
},
"LayoutModelConfig": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"repo_id": {
"title": "Repo Id",
"type": "string"
},
"revision": {
"title": "Revision",
"type": "string"
},
"model_path": {
"title": "Model Path",
"type": "string"
},
"supported_devices": {
"default": [
"cpu",
"cuda",
"mps"
],
"items": {
"$ref": "#/$defs/AcceleratorDevice"
},
"title": "Supported Devices",
"type": "array"
}
},
"required": [
"name",
"repo_id",
"revision",
"model_path"
],
"title": "LayoutModelConfig",
"type": "object"
}
},
"description": "Options for layout processing.",
"properties": {
"keep_empty_clusters": {
"default": false,
"title": "Keep Empty Clusters",
"type": "boolean"
},
"skip_cell_assignment": {
"default": false,
"title": "Skip Cell Assignment",
"type": "boolean"
},
"create_orphan_clusters": {
"default": true,
"title": "Create Orphan Clusters",
"type": "boolean"
},
"model_spec": {
"$ref": "#/$defs/LayoutModelConfig",
"default": {
"name": "docling_layout_heron",
"repo_id": "docling-project/docling-layout-heron",
"revision": "main",
"model_path": "",
"supported_devices": [
"cpu",
"cuda",
"mps"
]
}
}
},
"title": "LayoutOptions",
"type": "object"
}
Fields:
-
keep_empty_clusters(bool) -
skip_cell_assignment(bool) -
create_orphan_clusters(bool) -
model_spec(LayoutModelConfig)
create_orphan_clusters
pydantic-field
create_orphan_clusters: bool = True
keep_empty_clusters
pydantic-field
keep_empty_clusters: bool = False
kind
class-attribute
kind: str = 'docling_layout_default'
model_spec
pydantic-field
model_spec: LayoutModelConfig = DOCLING_LAYOUT_HERON
skip_cell_assignment
pydantic-field
skip_cell_assignment: bool = False
OcrAutoOptions
pydantic-model
Bases: OcrOptions
Options for pick OCR engine automatically.
Show JSON schema:
{
"description": "Options for pick OCR engine automatically.",
"properties": {
"lang": {
"default": [],
"description": "The automatic OCR engine will use the default values of the engine. Please specify the engine explicitly to change the language selection.",
"items": {
"type": "string"
},
"title": "Lang",
"type": "array"
},
"force_full_page_ocr": {
"default": false,
"description": "If enabled, a full-page OCR is always applied.",
"examples": [
false
],
"title": "Force Full Page Ocr",
"type": "boolean"
},
"bitmap_area_threshold": {
"default": 0.05,
"description": "Percentage of the page area for a bitmap to be processed with OCR.",
"examples": [
0.05,
0.1
],
"title": "Bitmap Area Threshold",
"type": "number"
}
},
"title": "OcrAutoOptions",
"type": "object"
}
Fields:
-
force_full_page_ocr(Annotated[bool, Field(description='If enabled, a full-page OCR is always applied.', examples=[False])]) -
bitmap_area_threshold(Annotated[float, Field(description='Percentage of the page area for a bitmap to be processed with OCR.', examples=[0.05, 0.1])]) -
lang(Annotated[List[str], Field(description='The automatic OCR engine will use the default values of the engine. Please specify the engine explicitly to change the language selection.')])
bitmap_area_threshold
pydantic-field
bitmap_area_threshold: Annotated[float, Field(description='Percentage of the page area for a bitmap to be processed with OCR.', examples=[0.05, 0.1])] = 0.05
force_full_page_ocr
pydantic-field
force_full_page_ocr: Annotated[bool, Field(description='If enabled, a full-page OCR is always applied.', examples=[False])] = False
kind
class-attribute
kind: Literal['auto'] = 'auto'
lang
pydantic-field
lang: Annotated[List[str], Field(description='The automatic OCR engine will use the default values of the engine. Please specify the engine explicitly to change the language selection.')] = []
OcrEngine
Bases: str, Enum
Enum of valid OCR engines.
Attributes:
AUTO
class-attribute
instance-attribute
AUTO = 'auto'
EASYOCR
class-attribute
instance-attribute
EASYOCR = 'easyocr'
OCRMAC
class-attribute
instance-attribute
OCRMAC = 'ocrmac'
RAPIDOCR
class-attribute
instance-attribute
RAPIDOCR = 'rapidocr'
TESSERACT
class-attribute
instance-attribute
TESSERACT = 'tesseract'
TESSERACT_CLI
class-attribute
instance-attribute
TESSERACT_CLI = 'tesseract_cli'
OcrMacOptions
pydantic-model
Bases: OcrOptions
Options for the Mac OCR engine.
Show JSON schema:
{
"additionalProperties": false,
"description": "Options for the Mac OCR engine.",
"properties": {
"lang": {
"default": [
"fr-FR",
"de-DE",
"es-ES",
"en-US"
],
"items": {
"type": "string"
},
"title": "Lang",
"type": "array"
},
"force_full_page_ocr": {
"default": false,
"description": "If enabled, a full-page OCR is always applied.",
"examples": [
false
],
"title": "Force Full Page Ocr",
"type": "boolean"
},
"bitmap_area_threshold": {
"default": 0.05,
"description": "Percentage of the page area for a bitmap to be processed with OCR.",
"examples": [
0.05,
0.1
],
"title": "Bitmap Area Threshold",
"type": "number"
},
"recognition": {
"default": "accurate",
"title": "Recognition",
"type": "string"
},
"framework": {
"default": "vision",
"title": "Framework",
"type": "string"
}
},
"title": "OcrMacOptions",
"type": "object"
}
Config:
extra:forbid
Fields:
-
force_full_page_ocr(Annotated[bool, Field(description='If enabled, a full-page OCR is always applied.', examples=[False])]) -
bitmap_area_threshold(Annotated[float, Field(description='Percentage of the page area for a bitmap to be processed with OCR.', examples=[0.05, 0.1])]) -
lang(List[str]) -
recognition(str) -
framework(str)
bitmap_area_threshold
pydantic-field
bitmap_area_threshold: Annotated[float, Field(description='Percentage of the page area for a bitmap to be processed with OCR.', examples=[0.05, 0.1])] = 0.05
force_full_page_ocr
pydantic-field
force_full_page_ocr: Annotated[bool, Field(description='If enabled, a full-page OCR is always applied.', examples=[False])] = False
framework
pydantic-field
framework: str = 'vision'
kind
class-attribute
kind: Literal['ocrmac'] = 'ocrmac'
lang
pydantic-field
lang: List[str] = ['fr-FR', 'de-DE', 'es-ES', 'en-US']
model_config
class-attribute
instance-attribute
model_config = ConfigDict(extra='forbid')
recognition
pydantic-field
recognition: str = 'accurate'
OcrOptions
pydantic-model
Bases: BaseOptions
OCR options.
Show JSON schema:
{
"description": "OCR options.",
"properties": {
"lang": {
"description": "List of OCR languages to use. The format must match the values of the OCR engine of choice.",
"examples": [
[
"deu",
"eng"
]
],
"items": {
"type": "string"
},
"title": "Lang",
"type": "array"
},
"force_full_page_ocr": {
"default": false,
"description": "If enabled, a full-page OCR is always applied.",
"examples": [
false
],
"title": "Force Full Page Ocr",
"type": "boolean"
},
"bitmap_area_threshold": {
"default": 0.05,
"description": "Percentage of the page area for a bitmap to be processed with OCR.",
"examples": [
0.05,
0.1
],
"title": "Bitmap Area Threshold",
"type": "number"
}
},
"required": [
"lang"
],
"title": "OcrOptions",
"type": "object"
}
Fields:
-
lang(Annotated[List[str], Field(description='List of OCR languages to use. The format must match the values of the OCR engine of choice.', examples=[[deu, eng]])]) -
force_full_page_ocr(Annotated[bool, Field(description='If enabled, a full-page OCR is always applied.', examples=[False])]) -
bitmap_area_threshold(Annotated[float, Field(description='Percentage of the page area for a bitmap to be processed with OCR.', examples=[0.05, 0.1])])
bitmap_area_threshold
pydantic-field
bitmap_area_threshold: Annotated[float, Field(description='Percentage of the page area for a bitmap to be processed with OCR.', examples=[0.05, 0.1])] = 0.05
force_full_page_ocr
pydantic-field
force_full_page_ocr: Annotated[bool, Field(description='If enabled, a full-page OCR is always applied.', examples=[False])] = False
kind
class-attribute
kind: str
lang
pydantic-field
lang: Annotated[List[str], Field(description='List of OCR languages to use. The format must match the values of the OCR engine of choice.', examples=[[deu, eng]])]
PaginatedPipelineOptions
pydantic-model
Bases: ConvertPipelineOptions
Show JSON schema:
{
"$defs": {
"AcceleratorDevice": {
"description": "Devices to run model inference",
"enum": [
"auto",
"cpu",
"cuda",
"mps"
],
"title": "AcceleratorDevice",
"type": "string"
},
"AcceleratorOptions": {
"additionalProperties": false,
"properties": {
"num_threads": {
"default": 4,
"title": "Num Threads",
"type": "integer"
},
"device": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/$defs/AcceleratorDevice"
}
],
"default": "auto",
"title": "Device"
},
"cuda_use_flash_attention2": {
"default": false,
"title": "Cuda Use Flash Attention2",
"type": "boolean"
}
},
"title": "AcceleratorOptions",
"type": "object"
},
"PictureDescriptionBaseOptions": {
"properties": {
"batch_size": {
"default": 8,
"title": "Batch Size",
"type": "integer"
},
"scale": {
"default": 2,
"title": "Scale",
"type": "number"
},
"picture_area_threshold": {
"default": 0.05,
"title": "Picture Area Threshold",
"type": "number"
}
},
"title": "PictureDescriptionBaseOptions",
"type": "object"
}
},
"properties": {
"document_timeout": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.",
"examples": [
10.0,
20.0
],
"title": "Document Timeout"
},
"accelerator_options": {
"$ref": "#/$defs/AcceleratorOptions",
"default": {
"num_threads": 4,
"device": "auto",
"cuda_use_flash_attention2": false
},
"description": "Configuration options for hardware acceleration (e.g., GPU or optimized execution settings)."
},
"enable_remote_services": {
"default": false,
"description": "Enable calling external APIs or cloud services during pipeline execution.",
"examples": [
false
],
"title": "Enable Remote Services",
"type": "boolean"
},
"allow_external_plugins": {
"default": false,
"description": "Allow loading external third-party plugins or modules. Disabled by default for safety.",
"examples": [
false
],
"title": "Allow External Plugins",
"type": "boolean"
},
"artifacts_path": {
"anyOf": [
{
"format": "path",
"type": "string"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.",
"examples": [
"./artifacts",
"/tmp/docling_outputs"
],
"title": "Artifacts Path"
},
"do_picture_classification": {
"default": false,
"title": "Do Picture Classification",
"type": "boolean"
},
"do_picture_description": {
"default": false,
"title": "Do Picture Description",
"type": "boolean"
},
"picture_description_options": {
"$ref": "#/$defs/PictureDescriptionBaseOptions",
"default": {
"batch_size": 8,
"scale": 2.0,
"picture_area_threshold": 0.05,
"repo_id": "HuggingFaceTB/SmolVLM-256M-Instruct",
"prompt": "Describe this image in a few sentences.",
"generation_config": {
"do_sample": false,
"max_new_tokens": 200
}
}
},
"images_scale": {
"default": 1.0,
"title": "Images Scale",
"type": "number"
},
"generate_page_images": {
"default": false,
"title": "Generate Page Images",
"type": "boolean"
},
"generate_picture_images": {
"default": false,
"title": "Generate Picture Images",
"type": "boolean"
}
},
"title": "PaginatedPipelineOptions",
"type": "object"
}
Fields:
-
document_timeout(Annotated[Optional[float], Field(description='Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.', examples=[10.0, 20.0])]) -
accelerator_options(Annotated[AcceleratorOptions, Field(description='Configuration options for hardware acceleration (e.g., GPU or optimized execution settings).')]) -
enable_remote_services(Annotated[bool, Field(description='Enable calling external APIs or cloud services during pipeline execution.', examples=[False])]) -
allow_external_plugins(Annotated[bool, Field(description='Allow loading external third-party plugins or modules. Disabled by default for safety.', examples=[False])]) -
artifacts_path(Annotated[Optional[Union[Path, str]], Field(description='Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.', examples=['./artifacts', '/tmp/docling_outputs'])]) -
do_picture_classification(bool) -
do_picture_description(bool) -
picture_description_options(PictureDescriptionBaseOptions) -
images_scale(float) -
generate_page_images(bool) -
generate_picture_images(bool)
accelerator_options
pydantic-field
accelerator_options: Annotated[AcceleratorOptions, Field(description='Configuration options for hardware acceleration (e.g., GPU or optimized execution settings).')]
allow_external_plugins
pydantic-field
allow_external_plugins: Annotated[bool, Field(description='Allow loading external third-party plugins or modules. Disabled by default for safety.', examples=[False])] = False
artifacts_path
pydantic-field
artifacts_path: Annotated[Optional[Union[Path, str]], Field(description='Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.', examples=['./artifacts', '/tmp/docling_outputs'])] = None
do_picture_classification
pydantic-field
do_picture_classification: bool = False
do_picture_description
pydantic-field
do_picture_description: bool = False
document_timeout
pydantic-field
document_timeout: Annotated[Optional[float], Field(description='Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.', examples=[10.0, 20.0])] = None
enable_remote_services
pydantic-field
enable_remote_services: Annotated[bool, Field(description='Enable calling external APIs or cloud services during pipeline execution.', examples=[False])] = False
generate_page_images
pydantic-field
generate_page_images: bool = False
generate_picture_images
pydantic-field
generate_picture_images: bool = False
images_scale
pydantic-field
images_scale: float = 1.0
kind
class-attribute
kind: str
picture_description_options
pydantic-field
picture_description_options: PictureDescriptionBaseOptions = smolvlm_picture_description
PdfBackend
Bases: str, Enum
Enum of valid PDF backends.
Attributes:
-
DLPARSE_V1– -
DLPARSE_V2– -
DLPARSE_V4– -
PYPDFIUM2–
DLPARSE_V1
class-attribute
instance-attribute
DLPARSE_V1 = 'dlparse_v1'
DLPARSE_V2
class-attribute
instance-attribute
DLPARSE_V2 = 'dlparse_v2'
DLPARSE_V4
class-attribute
instance-attribute
DLPARSE_V4 = 'dlparse_v4'
PYPDFIUM2
class-attribute
instance-attribute
PYPDFIUM2 = 'pypdfium2'
PdfPipelineOptions
pydantic-model
Bases: PaginatedPipelineOptions
Options for the PDF pipeline.
Show JSON schema:
{
"$defs": {
"AcceleratorDevice": {
"description": "Devices to run model inference",
"enum": [
"auto",
"cpu",
"cuda",
"mps"
],
"title": "AcceleratorDevice",
"type": "string"
},
"AcceleratorOptions": {
"additionalProperties": false,
"properties": {
"num_threads": {
"default": 4,
"title": "Num Threads",
"type": "integer"
},
"device": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/$defs/AcceleratorDevice"
}
],
"default": "auto",
"title": "Device"
},
"cuda_use_flash_attention2": {
"default": false,
"title": "Cuda Use Flash Attention2",
"type": "boolean"
}
},
"title": "AcceleratorOptions",
"type": "object"
},
"BaseLayoutOptions": {
"description": "Base options for layout models.",
"properties": {
"keep_empty_clusters": {
"default": false,
"title": "Keep Empty Clusters",
"type": "boolean"
},
"skip_cell_assignment": {
"default": false,
"title": "Skip Cell Assignment",
"type": "boolean"
}
},
"title": "BaseLayoutOptions",
"type": "object"
},
"BaseTableStructureOptions": {
"description": "Base options for table structure models.",
"properties": {},
"title": "BaseTableStructureOptions",
"type": "object"
},
"OcrOptions": {
"description": "OCR options.",
"properties": {
"lang": {
"description": "List of OCR languages to use. The format must match the values of the OCR engine of choice.",
"examples": [
[
"deu",
"eng"
]
],
"items": {
"type": "string"
},
"title": "Lang",
"type": "array"
},
"force_full_page_ocr": {
"default": false,
"description": "If enabled, a full-page OCR is always applied.",
"examples": [
false
],
"title": "Force Full Page Ocr",
"type": "boolean"
},
"bitmap_area_threshold": {
"default": 0.05,
"description": "Percentage of the page area for a bitmap to be processed with OCR.",
"examples": [
0.05,
0.1
],
"title": "Bitmap Area Threshold",
"type": "number"
}
},
"required": [
"lang"
],
"title": "OcrOptions",
"type": "object"
},
"PictureDescriptionBaseOptions": {
"properties": {
"batch_size": {
"default": 8,
"title": "Batch Size",
"type": "integer"
},
"scale": {
"default": 2,
"title": "Scale",
"type": "number"
},
"picture_area_threshold": {
"default": 0.05,
"title": "Picture Area Threshold",
"type": "number"
}
},
"title": "PictureDescriptionBaseOptions",
"type": "object"
}
},
"description": "Options for the PDF pipeline.",
"properties": {
"document_timeout": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.",
"examples": [
10.0,
20.0
],
"title": "Document Timeout"
},
"accelerator_options": {
"$ref": "#/$defs/AcceleratorOptions",
"default": {
"num_threads": 4,
"device": "auto",
"cuda_use_flash_attention2": false
},
"description": "Configuration options for hardware acceleration (e.g., GPU or optimized execution settings)."
},
"enable_remote_services": {
"default": false,
"description": "Enable calling external APIs or cloud services during pipeline execution.",
"examples": [
false
],
"title": "Enable Remote Services",
"type": "boolean"
},
"allow_external_plugins": {
"default": false,
"description": "Allow loading external third-party plugins or modules. Disabled by default for safety.",
"examples": [
false
],
"title": "Allow External Plugins",
"type": "boolean"
},
"artifacts_path": {
"anyOf": [
{
"format": "path",
"type": "string"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.",
"examples": [
"./artifacts",
"/tmp/docling_outputs"
],
"title": "Artifacts Path"
},
"do_picture_classification": {
"default": false,
"title": "Do Picture Classification",
"type": "boolean"
},
"do_picture_description": {
"default": false,
"title": "Do Picture Description",
"type": "boolean"
},
"picture_description_options": {
"$ref": "#/$defs/PictureDescriptionBaseOptions",
"default": {
"batch_size": 8,
"scale": 2.0,
"picture_area_threshold": 0.05,
"repo_id": "HuggingFaceTB/SmolVLM-256M-Instruct",
"prompt": "Describe this image in a few sentences.",
"generation_config": {
"do_sample": false,
"max_new_tokens": 200
}
}
},
"images_scale": {
"default": 1.0,
"title": "Images Scale",
"type": "number"
},
"generate_page_images": {
"default": false,
"title": "Generate Page Images",
"type": "boolean"
},
"generate_picture_images": {
"default": false,
"title": "Generate Picture Images",
"type": "boolean"
},
"do_table_structure": {
"default": true,
"title": "Do Table Structure",
"type": "boolean"
},
"do_ocr": {
"default": true,
"title": "Do Ocr",
"type": "boolean"
},
"do_code_enrichment": {
"default": false,
"title": "Do Code Enrichment",
"type": "boolean"
},
"do_formula_enrichment": {
"default": false,
"title": "Do Formula Enrichment",
"type": "boolean"
},
"force_backend_text": {
"default": false,
"title": "Force Backend Text",
"type": "boolean"
},
"table_structure_options": {
"$ref": "#/$defs/BaseTableStructureOptions",
"default": {
"do_cell_matching": true,
"mode": "accurate"
}
},
"ocr_options": {
"$ref": "#/$defs/OcrOptions",
"default": {
"lang": [],
"force_full_page_ocr": false,
"bitmap_area_threshold": 0.05
}
},
"layout_options": {
"$ref": "#/$defs/BaseLayoutOptions",
"default": {
"keep_empty_clusters": false,
"skip_cell_assignment": false,
"create_orphan_clusters": true,
"model_spec": {
"model_path": "",
"name": "docling_layout_heron",
"repo_id": "docling-project/docling-layout-heron",
"revision": "main",
"supported_devices": [
"cpu",
"cuda",
"mps"
]
}
}
},
"generate_table_images": {
"default": false,
"deprecated": true,
"title": "Generate Table Images",
"type": "boolean"
},
"generate_parsed_pages": {
"default": false,
"title": "Generate Parsed Pages",
"type": "boolean"
},
"ocr_batch_size": {
"default": 4,
"title": "Ocr Batch Size",
"type": "integer"
},
"layout_batch_size": {
"default": 4,
"title": "Layout Batch Size",
"type": "integer"
},
"table_batch_size": {
"default": 4,
"title": "Table Batch Size",
"type": "integer"
},
"batch_polling_interval_seconds": {
"default": 0.5,
"title": "Batch Polling Interval Seconds",
"type": "number"
},
"queue_max_size": {
"default": 100,
"title": "Queue Max Size",
"type": "integer"
}
},
"title": "PdfPipelineOptions",
"type": "object"
}
Fields:
-
document_timeout(Annotated[Optional[float], Field(description='Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.', examples=[10.0, 20.0])]) -
accelerator_options(Annotated[AcceleratorOptions, Field(description='Configuration options for hardware acceleration (e.g., GPU or optimized execution settings).')]) -
enable_remote_services(Annotated[bool, Field(description='Enable calling external APIs or cloud services during pipeline execution.', examples=[False])]) -
allow_external_plugins(Annotated[bool, Field(description='Allow loading external third-party plugins or modules. Disabled by default for safety.', examples=[False])]) -
artifacts_path(Annotated[Optional[Union[Path, str]], Field(description='Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.', examples=['./artifacts', '/tmp/docling_outputs'])]) -
do_picture_classification(bool) -
do_picture_description(bool) -
picture_description_options(PictureDescriptionBaseOptions) -
do_table_structure(bool) -
do_ocr(bool) -
do_code_enrichment(bool) -
do_formula_enrichment(bool) -
force_backend_text(bool) -
table_structure_options(BaseTableStructureOptions) -
ocr_options(OcrOptions) -
layout_options(BaseLayoutOptions) -
images_scale(float) -
generate_page_images(bool) -
generate_picture_images(bool) -
generate_table_images(bool) -
generate_parsed_pages(bool) -
ocr_batch_size(int) -
layout_batch_size(int) -
table_batch_size(int) -
batch_polling_interval_seconds(float) -
queue_max_size(int)
accelerator_options
pydantic-field
accelerator_options: Annotated[AcceleratorOptions, Field(description='Configuration options for hardware acceleration (e.g., GPU or optimized execution settings).')]
allow_external_plugins
pydantic-field
allow_external_plugins: Annotated[bool, Field(description='Allow loading external third-party plugins or modules. Disabled by default for safety.', examples=[False])] = False
artifacts_path
pydantic-field
artifacts_path: Annotated[Optional[Union[Path, str]], Field(description='Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.', examples=['./artifacts', '/tmp/docling_outputs'])] = None
batch_polling_interval_seconds
pydantic-field
batch_polling_interval_seconds: float = 0.5
do_code_enrichment
pydantic-field
do_code_enrichment: bool = False
do_formula_enrichment
pydantic-field
do_formula_enrichment: bool = False
do_ocr
pydantic-field
do_ocr: bool = True
do_picture_classification
pydantic-field
do_picture_classification: bool = False
do_picture_description
pydantic-field
do_picture_description: bool = False
do_table_structure
pydantic-field
do_table_structure: bool = True
document_timeout
pydantic-field
document_timeout: Annotated[Optional[float], Field(description='Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.', examples=[10.0, 20.0])] = None
enable_remote_services
pydantic-field
enable_remote_services: Annotated[bool, Field(description='Enable calling external APIs or cloud services during pipeline execution.', examples=[False])] = False
force_backend_text
pydantic-field
force_backend_text: bool = False
generate_page_images
pydantic-field
generate_page_images: bool = False
generate_parsed_pages
pydantic-field
generate_parsed_pages: bool = False
generate_picture_images
pydantic-field
generate_picture_images: bool = False
generate_table_images
pydantic-field
generate_table_images: bool = False
images_scale
pydantic-field
images_scale: float = 1.0
kind
class-attribute
kind: str
layout_batch_size
pydantic-field
layout_batch_size: int = 4
ocr_batch_size
pydantic-field
ocr_batch_size: int = 4
picture_description_options
pydantic-field
picture_description_options: PictureDescriptionBaseOptions = smolvlm_picture_description
queue_max_size
pydantic-field
queue_max_size: int = 100
table_batch_size
pydantic-field
table_batch_size: int = 4
PictureDescriptionApiOptions
pydantic-model
Bases: PictureDescriptionBaseOptions
Show JSON schema:
{
"properties": {
"batch_size": {
"default": 8,
"title": "Batch Size",
"type": "integer"
},
"scale": {
"default": 2,
"title": "Scale",
"type": "number"
},
"picture_area_threshold": {
"default": 0.05,
"title": "Picture Area Threshold",
"type": "number"
},
"url": {
"default": "http://localhost:8000/v1/chat/completions",
"format": "uri",
"minLength": 1,
"title": "Url",
"type": "string"
},
"headers": {
"additionalProperties": {
"type": "string"
},
"default": {},
"title": "Headers",
"type": "object"
},
"params": {
"additionalProperties": true,
"default": {},
"title": "Params",
"type": "object"
},
"timeout": {
"default": 20,
"title": "Timeout",
"type": "number"
},
"concurrency": {
"default": 1,
"title": "Concurrency",
"type": "integer"
},
"prompt": {
"default": "Describe this image in a few sentences.",
"title": "Prompt",
"type": "string"
},
"provenance": {
"default": "",
"title": "Provenance",
"type": "string"
}
},
"title": "PictureDescriptionApiOptions",
"type": "object"
}
Fields:
-
batch_size(int) -
scale(float) -
picture_area_threshold(float) -
url(AnyUrl) -
headers(Dict[str, str]) -
params(Dict[str, Any]) -
timeout(float) -
concurrency(int) -
prompt(str) -
provenance(str)
batch_size
pydantic-field
batch_size: int = 8
concurrency
pydantic-field
concurrency: int = 1
headers
pydantic-field
headers: Dict[str, str] = {}
kind
class-attribute
kind: Literal['api'] = 'api'
params
pydantic-field
params: Dict[str, Any] = {}
picture_area_threshold
pydantic-field
picture_area_threshold: float = 0.05
prompt
pydantic-field
prompt: str = 'Describe this image in a few sentences.'
provenance
pydantic-field
provenance: str = ''
scale
pydantic-field
scale: float = 2
timeout
pydantic-field
timeout: float = 20
url
pydantic-field
url: AnyUrl
PictureDescriptionBaseOptions
pydantic-model
Bases: BaseOptions
Show JSON schema:
{
"properties": {
"batch_size": {
"default": 8,
"title": "Batch Size",
"type": "integer"
},
"scale": {
"default": 2,
"title": "Scale",
"type": "number"
},
"picture_area_threshold": {
"default": 0.05,
"title": "Picture Area Threshold",
"type": "number"
}
},
"title": "PictureDescriptionBaseOptions",
"type": "object"
}
Fields:
-
batch_size(int) -
scale(float) -
picture_area_threshold(float)
batch_size
pydantic-field
batch_size: int = 8
kind
class-attribute
kind: str
picture_area_threshold
pydantic-field
picture_area_threshold: float = 0.05
scale
pydantic-field
scale: float = 2
PictureDescriptionVlmOptions
pydantic-model
Bases: PictureDescriptionBaseOptions
Show JSON schema:
{
"properties": {
"batch_size": {
"default": 8,
"title": "Batch Size",
"type": "integer"
},
"scale": {
"default": 2,
"title": "Scale",
"type": "number"
},
"picture_area_threshold": {
"default": 0.05,
"title": "Picture Area Threshold",
"type": "number"
},
"repo_id": {
"title": "Repo Id",
"type": "string"
},
"prompt": {
"default": "Describe this image in a few sentences.",
"title": "Prompt",
"type": "string"
},
"generation_config": {
"additionalProperties": true,
"default": {
"max_new_tokens": 200,
"do_sample": false
},
"title": "Generation Config",
"type": "object"
}
},
"required": [
"repo_id"
],
"title": "PictureDescriptionVlmOptions",
"type": "object"
}
Fields:
-
batch_size(int) -
scale(float) -
picture_area_threshold(float) -
repo_id(str) -
prompt(str) -
generation_config(Dict[str, Any])
batch_size
pydantic-field
batch_size: int = 8
generation_config
pydantic-field
generation_config: Dict[str, Any]
kind
class-attribute
kind: Literal['vlm'] = 'vlm'
picture_area_threshold
pydantic-field
picture_area_threshold: float = 0.05
prompt
pydantic-field
prompt: str = 'Describe this image in a few sentences.'
repo_cache_folder
property
repo_cache_folder: str
repo_id
pydantic-field
repo_id: str
scale
pydantic-field
scale: float = 2
PipelineOptions
pydantic-model
Bases: BaseOptions
Base pipeline options.
Show JSON schema:
{
"$defs": {
"AcceleratorDevice": {
"description": "Devices to run model inference",
"enum": [
"auto",
"cpu",
"cuda",
"mps"
],
"title": "AcceleratorDevice",
"type": "string"
},
"AcceleratorOptions": {
"additionalProperties": false,
"properties": {
"num_threads": {
"default": 4,
"title": "Num Threads",
"type": "integer"
},
"device": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/$defs/AcceleratorDevice"
}
],
"default": "auto",
"title": "Device"
},
"cuda_use_flash_attention2": {
"default": false,
"title": "Cuda Use Flash Attention2",
"type": "boolean"
}
},
"title": "AcceleratorOptions",
"type": "object"
}
},
"description": "Base pipeline options.",
"properties": {
"document_timeout": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.",
"examples": [
10.0,
20.0
],
"title": "Document Timeout"
},
"accelerator_options": {
"$ref": "#/$defs/AcceleratorOptions",
"default": {
"num_threads": 4,
"device": "auto",
"cuda_use_flash_attention2": false
},
"description": "Configuration options for hardware acceleration (e.g., GPU or optimized execution settings)."
},
"enable_remote_services": {
"default": false,
"description": "Enable calling external APIs or cloud services during pipeline execution.",
"examples": [
false
],
"title": "Enable Remote Services",
"type": "boolean"
},
"allow_external_plugins": {
"default": false,
"description": "Allow loading external third-party plugins or modules. Disabled by default for safety.",
"examples": [
false
],
"title": "Allow External Plugins",
"type": "boolean"
},
"artifacts_path": {
"anyOf": [
{
"format": "path",
"type": "string"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.",
"examples": [
"./artifacts",
"/tmp/docling_outputs"
],
"title": "Artifacts Path"
}
},
"title": "PipelineOptions",
"type": "object"
}
Fields:
-
document_timeout(Annotated[Optional[float], Field(description='Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.', examples=[10.0, 20.0])]) -
accelerator_options(Annotated[AcceleratorOptions, Field(description='Configuration options for hardware acceleration (e.g., GPU or optimized execution settings).')]) -
enable_remote_services(Annotated[bool, Field(description='Enable calling external APIs or cloud services during pipeline execution.', examples=[False])]) -
allow_external_plugins(Annotated[bool, Field(description='Allow loading external third-party plugins or modules. Disabled by default for safety.', examples=[False])]) -
artifacts_path(Annotated[Optional[Union[Path, str]], Field(description='Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.', examples=['./artifacts', '/tmp/docling_outputs'])])
accelerator_options
pydantic-field
accelerator_options: Annotated[AcceleratorOptions, Field(description='Configuration options for hardware acceleration (e.g., GPU or optimized execution settings).')]
allow_external_plugins
pydantic-field
allow_external_plugins: Annotated[bool, Field(description='Allow loading external third-party plugins or modules. Disabled by default for safety.', examples=[False])] = False
artifacts_path
pydantic-field
artifacts_path: Annotated[Optional[Union[Path, str]], Field(description='Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.', examples=['./artifacts', '/tmp/docling_outputs'])] = None
document_timeout
pydantic-field
document_timeout: Annotated[Optional[float], Field(description='Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.', examples=[10.0, 20.0])] = None
enable_remote_services
pydantic-field
enable_remote_services: Annotated[bool, Field(description='Enable calling external APIs or cloud services during pipeline execution.', examples=[False])] = False
kind
class-attribute
kind: str
ProcessingPipeline
RapidOcrOptions
pydantic-model
Bases: OcrOptions
Options for the RapidOCR engine.
Show JSON schema:
{
"additionalProperties": false,
"description": "Options for the RapidOCR engine.",
"properties": {
"lang": {
"default": [
"english",
"chinese"
],
"items": {
"type": "string"
},
"title": "Lang",
"type": "array"
},
"force_full_page_ocr": {
"default": false,
"description": "If enabled, a full-page OCR is always applied.",
"examples": [
false
],
"title": "Force Full Page Ocr",
"type": "boolean"
},
"bitmap_area_threshold": {
"default": 0.05,
"description": "Percentage of the page area for a bitmap to be processed with OCR.",
"examples": [
0.05,
0.1
],
"title": "Bitmap Area Threshold",
"type": "number"
},
"backend": {
"default": "onnxruntime",
"enum": [
"onnxruntime",
"openvino",
"paddle",
"torch"
],
"title": "Backend",
"type": "string"
},
"text_score": {
"default": 0.5,
"title": "Text Score",
"type": "number"
},
"use_det": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Use Det"
},
"use_cls": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Use Cls"
},
"use_rec": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Use Rec"
},
"print_verbose": {
"default": false,
"title": "Print Verbose",
"type": "boolean"
},
"det_model_path": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Det Model Path"
},
"cls_model_path": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Cls Model Path"
},
"rec_model_path": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Rec Model Path"
},
"rec_keys_path": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Rec Keys Path"
},
"rec_font_path": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Rec Font Path"
},
"font_path": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Font Path"
},
"rapidocr_params": {
"additionalProperties": true,
"title": "Rapidocr Params",
"type": "object"
}
},
"title": "RapidOcrOptions",
"type": "object"
}
Config:
extra:forbid
Fields:
-
force_full_page_ocr(Annotated[bool, Field(description='If enabled, a full-page OCR is always applied.', examples=[False])]) -
bitmap_area_threshold(Annotated[float, Field(description='Percentage of the page area for a bitmap to be processed with OCR.', examples=[0.05, 0.1])]) -
lang(List[str]) -
backend(Literal['onnxruntime', 'openvino', 'paddle', 'torch']) -
text_score(float) -
use_det(Optional[bool]) -
use_cls(Optional[bool]) -
use_rec(Optional[bool]) -
print_verbose(bool) -
det_model_path(Optional[str]) -
cls_model_path(Optional[str]) -
rec_model_path(Optional[str]) -
rec_keys_path(Optional[str]) -
rec_font_path(Optional[str]) -
font_path(Optional[str]) -
rapidocr_params(Dict[str, Any])
backend
pydantic-field
backend: Literal['onnxruntime', 'openvino', 'paddle', 'torch'] = 'onnxruntime'
bitmap_area_threshold
pydantic-field
bitmap_area_threshold: Annotated[float, Field(description='Percentage of the page area for a bitmap to be processed with OCR.', examples=[0.05, 0.1])] = 0.05
cls_model_path
pydantic-field
cls_model_path: Optional[str] = None
det_model_path
pydantic-field
det_model_path: Optional[str] = None
font_path
pydantic-field
font_path: Optional[str] = None
force_full_page_ocr
pydantic-field
force_full_page_ocr: Annotated[bool, Field(description='If enabled, a full-page OCR is always applied.', examples=[False])] = False
kind
class-attribute
kind: Literal['rapidocr'] = 'rapidocr'
lang
pydantic-field
lang: List[str] = ['english', 'chinese']
model_config
class-attribute
instance-attribute
model_config = ConfigDict(extra='forbid')
print_verbose
pydantic-field
print_verbose: bool = False
rapidocr_params
pydantic-field
rapidocr_params: Dict[str, Any]
rec_font_path
pydantic-field
rec_font_path: Optional[str] = None
rec_keys_path
pydantic-field
rec_keys_path: Optional[str] = None
rec_model_path
pydantic-field
rec_model_path: Optional[str] = None
text_score
pydantic-field
text_score: float = 0.5
use_cls
pydantic-field
use_cls: Optional[bool] = None
use_det
pydantic-field
use_det: Optional[bool] = None
use_rec
pydantic-field
use_rec: Optional[bool] = None
TableFormerMode
TableStructureOptions
pydantic-model
Bases: BaseTableStructureOptions
Options for the table structure.
Show JSON schema:
{
"$defs": {
"TableFormerMode": {
"description": "Modes for the TableFormer model.",
"enum": [
"fast",
"accurate"
],
"title": "TableFormerMode",
"type": "string"
}
},
"description": "Options for the table structure.",
"properties": {
"do_cell_matching": {
"default": true,
"title": "Do Cell Matching",
"type": "boolean"
},
"mode": {
"$ref": "#/$defs/TableFormerMode",
"default": "accurate"
}
},
"title": "TableStructureOptions",
"type": "object"
}
Fields:
-
do_cell_matching(bool) -
mode(TableFormerMode)
do_cell_matching
pydantic-field
do_cell_matching: bool = True
kind
class-attribute
kind: str = 'docling_tableformer'
TesseractCliOcrOptions
pydantic-model
Bases: OcrOptions
Options for the TesseractCli engine.
Show JSON schema:
{
"additionalProperties": false,
"description": "Options for the TesseractCli engine.",
"properties": {
"lang": {
"default": [
"fra",
"deu",
"spa",
"eng"
],
"items": {
"type": "string"
},
"title": "Lang",
"type": "array"
},
"force_full_page_ocr": {
"default": false,
"description": "If enabled, a full-page OCR is always applied.",
"examples": [
false
],
"title": "Force Full Page Ocr",
"type": "boolean"
},
"bitmap_area_threshold": {
"default": 0.05,
"description": "Percentage of the page area for a bitmap to be processed with OCR.",
"examples": [
0.05,
0.1
],
"title": "Bitmap Area Threshold",
"type": "number"
},
"tesseract_cmd": {
"default": "tesseract",
"title": "Tesseract Cmd",
"type": "string"
},
"path": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Path"
},
"psm": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Psm"
}
},
"title": "TesseractCliOcrOptions",
"type": "object"
}
Config:
extra:forbid
Fields:
-
force_full_page_ocr(Annotated[bool, Field(description='If enabled, a full-page OCR is always applied.', examples=[False])]) -
bitmap_area_threshold(Annotated[float, Field(description='Percentage of the page area for a bitmap to be processed with OCR.', examples=[0.05, 0.1])]) -
lang(List[str]) -
tesseract_cmd(str) -
path(Optional[str]) -
psm(Optional[int])
bitmap_area_threshold
pydantic-field
bitmap_area_threshold: Annotated[float, Field(description='Percentage of the page area for a bitmap to be processed with OCR.', examples=[0.05, 0.1])] = 0.05
force_full_page_ocr
pydantic-field
force_full_page_ocr: Annotated[bool, Field(description='If enabled, a full-page OCR is always applied.', examples=[False])] = False
kind
class-attribute
kind: Literal['tesseract'] = 'tesseract'
lang
pydantic-field
lang: List[str] = ['fra', 'deu', 'spa', 'eng']
model_config
class-attribute
instance-attribute
model_config = ConfigDict(extra='forbid')
path
pydantic-field
path: Optional[str] = None
psm
pydantic-field
psm: Optional[int] = None
tesseract_cmd
pydantic-field
tesseract_cmd: str = 'tesseract'
TesseractOcrOptions
pydantic-model
Bases: OcrOptions
Options for the Tesseract engine.
Show JSON schema:
{
"additionalProperties": false,
"description": "Options for the Tesseract engine.",
"properties": {
"lang": {
"default": [
"fra",
"deu",
"spa",
"eng"
],
"items": {
"type": "string"
},
"title": "Lang",
"type": "array"
},
"force_full_page_ocr": {
"default": false,
"description": "If enabled, a full-page OCR is always applied.",
"examples": [
false
],
"title": "Force Full Page Ocr",
"type": "boolean"
},
"bitmap_area_threshold": {
"default": 0.05,
"description": "Percentage of the page area for a bitmap to be processed with OCR.",
"examples": [
0.05,
0.1
],
"title": "Bitmap Area Threshold",
"type": "number"
},
"path": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Path"
},
"psm": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Psm"
}
},
"title": "TesseractOcrOptions",
"type": "object"
}
Config:
extra:forbid
Fields:
-
force_full_page_ocr(Annotated[bool, Field(description='If enabled, a full-page OCR is always applied.', examples=[False])]) -
bitmap_area_threshold(Annotated[float, Field(description='Percentage of the page area for a bitmap to be processed with OCR.', examples=[0.05, 0.1])]) -
lang(List[str]) -
path(Optional[str]) -
psm(Optional[int])
bitmap_area_threshold
pydantic-field
bitmap_area_threshold: Annotated[float, Field(description='Percentage of the page area for a bitmap to be processed with OCR.', examples=[0.05, 0.1])] = 0.05
force_full_page_ocr
pydantic-field
force_full_page_ocr: Annotated[bool, Field(description='If enabled, a full-page OCR is always applied.', examples=[False])] = False
kind
class-attribute
kind: Literal['tesserocr'] = 'tesserocr'
lang
pydantic-field
lang: List[str] = ['fra', 'deu', 'spa', 'eng']
model_config
class-attribute
instance-attribute
model_config = ConfigDict(extra='forbid')
path
pydantic-field
path: Optional[str] = None
psm
pydantic-field
psm: Optional[int] = None
ThreadedPdfPipelineOptions
pydantic-model
Bases: PdfPipelineOptions
Pipeline options for the threaded PDF pipeline with batching and backpressure control
Show JSON schema:
{
"$defs": {
"AcceleratorDevice": {
"description": "Devices to run model inference",
"enum": [
"auto",
"cpu",
"cuda",
"mps"
],
"title": "AcceleratorDevice",
"type": "string"
},
"AcceleratorOptions": {
"additionalProperties": false,
"properties": {
"num_threads": {
"default": 4,
"title": "Num Threads",
"type": "integer"
},
"device": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/$defs/AcceleratorDevice"
}
],
"default": "auto",
"title": "Device"
},
"cuda_use_flash_attention2": {
"default": false,
"title": "Cuda Use Flash Attention2",
"type": "boolean"
}
},
"title": "AcceleratorOptions",
"type": "object"
},
"BaseLayoutOptions": {
"description": "Base options for layout models.",
"properties": {
"keep_empty_clusters": {
"default": false,
"title": "Keep Empty Clusters",
"type": "boolean"
},
"skip_cell_assignment": {
"default": false,
"title": "Skip Cell Assignment",
"type": "boolean"
}
},
"title": "BaseLayoutOptions",
"type": "object"
},
"BaseTableStructureOptions": {
"description": "Base options for table structure models.",
"properties": {},
"title": "BaseTableStructureOptions",
"type": "object"
},
"OcrOptions": {
"description": "OCR options.",
"properties": {
"lang": {
"description": "List of OCR languages to use. The format must match the values of the OCR engine of choice.",
"examples": [
[
"deu",
"eng"
]
],
"items": {
"type": "string"
},
"title": "Lang",
"type": "array"
},
"force_full_page_ocr": {
"default": false,
"description": "If enabled, a full-page OCR is always applied.",
"examples": [
false
],
"title": "Force Full Page Ocr",
"type": "boolean"
},
"bitmap_area_threshold": {
"default": 0.05,
"description": "Percentage of the page area for a bitmap to be processed with OCR.",
"examples": [
0.05,
0.1
],
"title": "Bitmap Area Threshold",
"type": "number"
}
},
"required": [
"lang"
],
"title": "OcrOptions",
"type": "object"
},
"PictureDescriptionBaseOptions": {
"properties": {
"batch_size": {
"default": 8,
"title": "Batch Size",
"type": "integer"
},
"scale": {
"default": 2,
"title": "Scale",
"type": "number"
},
"picture_area_threshold": {
"default": 0.05,
"title": "Picture Area Threshold",
"type": "number"
}
},
"title": "PictureDescriptionBaseOptions",
"type": "object"
}
},
"description": "Pipeline options for the threaded PDF pipeline with batching and backpressure control",
"properties": {
"document_timeout": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.",
"examples": [
10.0,
20.0
],
"title": "Document Timeout"
},
"accelerator_options": {
"$ref": "#/$defs/AcceleratorOptions",
"default": {
"num_threads": 4,
"device": "auto",
"cuda_use_flash_attention2": false
},
"description": "Configuration options for hardware acceleration (e.g., GPU or optimized execution settings)."
},
"enable_remote_services": {
"default": false,
"description": "Enable calling external APIs or cloud services during pipeline execution.",
"examples": [
false
],
"title": "Enable Remote Services",
"type": "boolean"
},
"allow_external_plugins": {
"default": false,
"description": "Allow loading external third-party plugins or modules. Disabled by default for safety.",
"examples": [
false
],
"title": "Allow External Plugins",
"type": "boolean"
},
"artifacts_path": {
"anyOf": [
{
"format": "path",
"type": "string"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.",
"examples": [
"./artifacts",
"/tmp/docling_outputs"
],
"title": "Artifacts Path"
},
"do_picture_classification": {
"default": false,
"title": "Do Picture Classification",
"type": "boolean"
},
"do_picture_description": {
"default": false,
"title": "Do Picture Description",
"type": "boolean"
},
"picture_description_options": {
"$ref": "#/$defs/PictureDescriptionBaseOptions",
"default": {
"batch_size": 8,
"scale": 2.0,
"picture_area_threshold": 0.05,
"repo_id": "HuggingFaceTB/SmolVLM-256M-Instruct",
"prompt": "Describe this image in a few sentences.",
"generation_config": {
"do_sample": false,
"max_new_tokens": 200
}
}
},
"images_scale": {
"default": 1.0,
"title": "Images Scale",
"type": "number"
},
"generate_page_images": {
"default": false,
"title": "Generate Page Images",
"type": "boolean"
},
"generate_picture_images": {
"default": false,
"title": "Generate Picture Images",
"type": "boolean"
},
"do_table_structure": {
"default": true,
"title": "Do Table Structure",
"type": "boolean"
},
"do_ocr": {
"default": true,
"title": "Do Ocr",
"type": "boolean"
},
"do_code_enrichment": {
"default": false,
"title": "Do Code Enrichment",
"type": "boolean"
},
"do_formula_enrichment": {
"default": false,
"title": "Do Formula Enrichment",
"type": "boolean"
},
"force_backend_text": {
"default": false,
"title": "Force Backend Text",
"type": "boolean"
},
"table_structure_options": {
"$ref": "#/$defs/BaseTableStructureOptions",
"default": {
"do_cell_matching": true,
"mode": "accurate"
}
},
"ocr_options": {
"$ref": "#/$defs/OcrOptions",
"default": {
"lang": [],
"force_full_page_ocr": false,
"bitmap_area_threshold": 0.05
}
},
"layout_options": {
"$ref": "#/$defs/BaseLayoutOptions",
"default": {
"keep_empty_clusters": false,
"skip_cell_assignment": false,
"create_orphan_clusters": true,
"model_spec": {
"model_path": "",
"name": "docling_layout_heron",
"repo_id": "docling-project/docling-layout-heron",
"revision": "main",
"supported_devices": [
"cpu",
"cuda",
"mps"
]
}
}
},
"generate_table_images": {
"default": false,
"deprecated": true,
"title": "Generate Table Images",
"type": "boolean"
},
"generate_parsed_pages": {
"default": false,
"title": "Generate Parsed Pages",
"type": "boolean"
},
"ocr_batch_size": {
"default": 4,
"title": "Ocr Batch Size",
"type": "integer"
},
"layout_batch_size": {
"default": 4,
"title": "Layout Batch Size",
"type": "integer"
},
"table_batch_size": {
"default": 4,
"title": "Table Batch Size",
"type": "integer"
},
"batch_polling_interval_seconds": {
"default": 0.5,
"title": "Batch Polling Interval Seconds",
"type": "number"
},
"queue_max_size": {
"default": 100,
"title": "Queue Max Size",
"type": "integer"
}
},
"title": "ThreadedPdfPipelineOptions",
"type": "object"
}
Fields:
-
document_timeout(Annotated[Optional[float], Field(description='Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.', examples=[10.0, 20.0])]) -
accelerator_options(Annotated[AcceleratorOptions, Field(description='Configuration options for hardware acceleration (e.g., GPU or optimized execution settings).')]) -
enable_remote_services(Annotated[bool, Field(description='Enable calling external APIs or cloud services during pipeline execution.', examples=[False])]) -
allow_external_plugins(Annotated[bool, Field(description='Allow loading external third-party plugins or modules. Disabled by default for safety.', examples=[False])]) -
artifacts_path(Annotated[Optional[Union[Path, str]], Field(description='Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.', examples=['./artifacts', '/tmp/docling_outputs'])]) -
do_picture_classification(bool) -
do_picture_description(bool) -
picture_description_options(PictureDescriptionBaseOptions) -
images_scale(float) -
generate_page_images(bool) -
generate_picture_images(bool) -
do_table_structure(bool) -
do_ocr(bool) -
do_code_enrichment(bool) -
do_formula_enrichment(bool) -
force_backend_text(bool) -
table_structure_options(BaseTableStructureOptions) -
ocr_options(OcrOptions) -
layout_options(BaseLayoutOptions) -
generate_table_images(bool) -
generate_parsed_pages(bool) -
ocr_batch_size(int) -
layout_batch_size(int) -
table_batch_size(int) -
batch_polling_interval_seconds(float) -
queue_max_size(int)
accelerator_options
pydantic-field
accelerator_options: Annotated[AcceleratorOptions, Field(description='Configuration options for hardware acceleration (e.g., GPU or optimized execution settings).')]
allow_external_plugins
pydantic-field
allow_external_plugins: Annotated[bool, Field(description='Allow loading external third-party plugins or modules. Disabled by default for safety.', examples=[False])] = False
artifacts_path
pydantic-field
artifacts_path: Annotated[Optional[Union[Path, str]], Field(description='Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.', examples=['./artifacts', '/tmp/docling_outputs'])] = None
batch_polling_interval_seconds
pydantic-field
batch_polling_interval_seconds: float = 0.5
do_code_enrichment
pydantic-field
do_code_enrichment: bool = False
do_formula_enrichment
pydantic-field
do_formula_enrichment: bool = False
do_ocr
pydantic-field
do_ocr: bool = True
do_picture_classification
pydantic-field
do_picture_classification: bool = False
do_picture_description
pydantic-field
do_picture_description: bool = False
do_table_structure
pydantic-field
do_table_structure: bool = True
document_timeout
pydantic-field
document_timeout: Annotated[Optional[float], Field(description='Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.', examples=[10.0, 20.0])] = None
enable_remote_services
pydantic-field
enable_remote_services: Annotated[bool, Field(description='Enable calling external APIs or cloud services during pipeline execution.', examples=[False])] = False
force_backend_text
pydantic-field
force_backend_text: bool = False
generate_page_images
pydantic-field
generate_page_images: bool = False
generate_parsed_pages
pydantic-field
generate_parsed_pages: bool = False
generate_picture_images
pydantic-field
generate_picture_images: bool = False
generate_table_images
pydantic-field
generate_table_images: bool = False
images_scale
pydantic-field
images_scale: float = 1.0
kind
class-attribute
kind: str
layout_batch_size
pydantic-field
layout_batch_size: int = 4
ocr_batch_size
pydantic-field
ocr_batch_size: int = 4
picture_description_options
pydantic-field
picture_description_options: PictureDescriptionBaseOptions = smolvlm_picture_description
queue_max_size
pydantic-field
queue_max_size: int = 100
table_batch_size
pydantic-field
table_batch_size: int = 4
VlmExtractionPipelineOptions
pydantic-model
Bases: PipelineOptions
Options for extraction pipeline.
Show JSON schema:
{
"$defs": {
"AcceleratorDevice": {
"description": "Devices to run model inference",
"enum": [
"auto",
"cpu",
"cuda",
"mps"
],
"title": "AcceleratorDevice",
"type": "string"
},
"AcceleratorOptions": {
"additionalProperties": false,
"properties": {
"num_threads": {
"default": 4,
"title": "Num Threads",
"type": "integer"
},
"device": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/$defs/AcceleratorDevice"
}
],
"default": "auto",
"title": "Device"
},
"cuda_use_flash_attention2": {
"default": false,
"title": "Cuda Use Flash Attention2",
"type": "boolean"
}
},
"title": "AcceleratorOptions",
"type": "object"
},
"InferenceFramework": {
"enum": [
"mlx",
"transformers",
"vllm"
],
"title": "InferenceFramework",
"type": "string"
},
"InlineVlmOptions": {
"properties": {
"kind": {
"const": "inline_model_options",
"default": "inline_model_options",
"title": "Kind",
"type": "string"
},
"prompt": {
"title": "Prompt",
"type": "string"
},
"scale": {
"default": 2.0,
"title": "Scale",
"type": "number"
},
"max_size": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Max Size"
},
"temperature": {
"default": 0.0,
"title": "Temperature",
"type": "number"
},
"repo_id": {
"title": "Repo Id",
"type": "string"
},
"revision": {
"default": "main",
"title": "Revision",
"type": "string"
},
"trust_remote_code": {
"default": false,
"title": "Trust Remote Code",
"type": "boolean"
},
"load_in_8bit": {
"default": true,
"title": "Load In 8Bit",
"type": "boolean"
},
"llm_int8_threshold": {
"default": 6.0,
"title": "Llm Int8 Threshold",
"type": "number"
},
"quantized": {
"default": false,
"title": "Quantized",
"type": "boolean"
},
"inference_framework": {
"$ref": "#/$defs/InferenceFramework"
},
"transformers_model_type": {
"$ref": "#/$defs/TransformersModelType",
"default": "automodel"
},
"transformers_prompt_style": {
"$ref": "#/$defs/TransformersPromptStyle",
"default": "chat"
},
"response_format": {
"$ref": "#/$defs/ResponseFormat"
},
"torch_dtype": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Torch Dtype"
},
"supported_devices": {
"default": [
"cpu",
"cuda",
"mps"
],
"items": {
"$ref": "#/$defs/AcceleratorDevice"
},
"title": "Supported Devices",
"type": "array"
},
"stop_strings": {
"default": [],
"items": {
"type": "string"
},
"title": "Stop Strings",
"type": "array"
},
"custom_stopping_criteria": {
"default": [],
"items": {
"anyOf": []
},
"title": "Custom Stopping Criteria",
"type": "array"
},
"extra_generation_config": {
"additionalProperties": true,
"default": {},
"title": "Extra Generation Config",
"type": "object"
},
"extra_processor_kwargs": {
"additionalProperties": true,
"default": {},
"title": "Extra Processor Kwargs",
"type": "object"
},
"use_kv_cache": {
"default": true,
"title": "Use Kv Cache",
"type": "boolean"
},
"max_new_tokens": {
"default": 4096,
"title": "Max New Tokens",
"type": "integer"
},
"track_generated_tokens": {
"default": false,
"title": "Track Generated Tokens",
"type": "boolean"
},
"track_input_prompt": {
"default": false,
"title": "Track Input Prompt",
"type": "boolean"
}
},
"required": [
"prompt",
"repo_id",
"inference_framework",
"response_format"
],
"title": "InlineVlmOptions",
"type": "object"
},
"ResponseFormat": {
"enum": [
"doctags",
"markdown",
"html",
"otsl",
"plaintext"
],
"title": "ResponseFormat",
"type": "string"
},
"TransformersModelType": {
"enum": [
"automodel",
"automodel-vision2seq",
"automodel-causallm",
"automodel-imagetexttotext"
],
"title": "TransformersModelType",
"type": "string"
},
"TransformersPromptStyle": {
"enum": [
"chat",
"raw",
"none"
],
"title": "TransformersPromptStyle",
"type": "string"
}
},
"description": "Options for extraction pipeline.",
"properties": {
"document_timeout": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.",
"examples": [
10.0,
20.0
],
"title": "Document Timeout"
},
"accelerator_options": {
"$ref": "#/$defs/AcceleratorOptions",
"default": {
"num_threads": 4,
"device": "auto",
"cuda_use_flash_attention2": false
},
"description": "Configuration options for hardware acceleration (e.g., GPU or optimized execution settings)."
},
"enable_remote_services": {
"default": false,
"description": "Enable calling external APIs or cloud services during pipeline execution.",
"examples": [
false
],
"title": "Enable Remote Services",
"type": "boolean"
},
"allow_external_plugins": {
"default": false,
"description": "Allow loading external third-party plugins or modules. Disabled by default for safety.",
"examples": [
false
],
"title": "Allow External Plugins",
"type": "boolean"
},
"artifacts_path": {
"anyOf": [
{
"format": "path",
"type": "string"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.",
"examples": [
"./artifacts",
"/tmp/docling_outputs"
],
"title": "Artifacts Path"
},
"vlm_options": {
"$ref": "#/$defs/InlineVlmOptions",
"default": {
"kind": "inline_model_options",
"prompt": "",
"scale": 2.0,
"max_size": null,
"temperature": 0.0,
"repo_id": "numind/NuExtract-2.0-2B",
"revision": "fe5b2f0b63b81150721435a3ca1129a75c59c74e",
"trust_remote_code": false,
"load_in_8bit": true,
"llm_int8_threshold": 6.0,
"quantized": false,
"inference_framework": "transformers",
"transformers_model_type": "automodel-imagetexttotext",
"transformers_prompt_style": "chat",
"response_format": "plaintext",
"torch_dtype": "bfloat16",
"supported_devices": [
"cpu",
"cuda",
"mps"
],
"stop_strings": [],
"custom_stopping_criteria": [],
"extra_generation_config": {},
"extra_processor_kwargs": {},
"use_kv_cache": true,
"max_new_tokens": 4096,
"track_generated_tokens": false,
"track_input_prompt": false
}
}
},
"title": "VlmExtractionPipelineOptions",
"type": "object"
}
Fields:
-
document_timeout(Annotated[Optional[float], Field(description='Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.', examples=[10.0, 20.0])]) -
accelerator_options(Annotated[AcceleratorOptions, Field(description='Configuration options for hardware acceleration (e.g., GPU or optimized execution settings).')]) -
enable_remote_services(Annotated[bool, Field(description='Enable calling external APIs or cloud services during pipeline execution.', examples=[False])]) -
allow_external_plugins(Annotated[bool, Field(description='Allow loading external third-party plugins or modules. Disabled by default for safety.', examples=[False])]) -
artifacts_path(Annotated[Optional[Union[Path, str]], Field(description='Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.', examples=['./artifacts', '/tmp/docling_outputs'])]) -
vlm_options(Union[InlineVlmOptions])
accelerator_options
pydantic-field
accelerator_options: Annotated[AcceleratorOptions, Field(description='Configuration options for hardware acceleration (e.g., GPU or optimized execution settings).')]
allow_external_plugins
pydantic-field
allow_external_plugins: Annotated[bool, Field(description='Allow loading external third-party plugins or modules. Disabled by default for safety.', examples=[False])] = False
artifacts_path
pydantic-field
artifacts_path: Annotated[Optional[Union[Path, str]], Field(description='Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.', examples=['./artifacts', '/tmp/docling_outputs'])] = None
document_timeout
pydantic-field
document_timeout: Annotated[Optional[float], Field(description='Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.', examples=[10.0, 20.0])] = None
enable_remote_services
pydantic-field
enable_remote_services: Annotated[bool, Field(description='Enable calling external APIs or cloud services during pipeline execution.', examples=[False])] = False
kind
class-attribute
kind: str
vlm_options
pydantic-field
vlm_options: Union[InlineVlmOptions] = NU_EXTRACT_2B_TRANSFORMERS
VlmPipelineOptions
pydantic-model
Bases: PaginatedPipelineOptions
Show JSON schema:
{
"$defs": {
"AcceleratorDevice": {
"description": "Devices to run model inference",
"enum": [
"auto",
"cpu",
"cuda",
"mps"
],
"title": "AcceleratorDevice",
"type": "string"
},
"AcceleratorOptions": {
"additionalProperties": false,
"properties": {
"num_threads": {
"default": 4,
"title": "Num Threads",
"type": "integer"
},
"device": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/$defs/AcceleratorDevice"
}
],
"default": "auto",
"title": "Device"
},
"cuda_use_flash_attention2": {
"default": false,
"title": "Cuda Use Flash Attention2",
"type": "boolean"
}
},
"title": "AcceleratorOptions",
"type": "object"
},
"InferenceFramework": {
"enum": [
"mlx",
"transformers",
"vllm"
],
"title": "InferenceFramework",
"type": "string"
},
"InlineVlmOptions": {
"properties": {
"kind": {
"const": "inline_model_options",
"default": "inline_model_options",
"title": "Kind",
"type": "string"
},
"prompt": {
"title": "Prompt",
"type": "string"
},
"scale": {
"default": 2.0,
"title": "Scale",
"type": "number"
},
"max_size": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Max Size"
},
"temperature": {
"default": 0.0,
"title": "Temperature",
"type": "number"
},
"repo_id": {
"title": "Repo Id",
"type": "string"
},
"revision": {
"default": "main",
"title": "Revision",
"type": "string"
},
"trust_remote_code": {
"default": false,
"title": "Trust Remote Code",
"type": "boolean"
},
"load_in_8bit": {
"default": true,
"title": "Load In 8Bit",
"type": "boolean"
},
"llm_int8_threshold": {
"default": 6.0,
"title": "Llm Int8 Threshold",
"type": "number"
},
"quantized": {
"default": false,
"title": "Quantized",
"type": "boolean"
},
"inference_framework": {
"$ref": "#/$defs/InferenceFramework"
},
"transformers_model_type": {
"$ref": "#/$defs/TransformersModelType",
"default": "automodel"
},
"transformers_prompt_style": {
"$ref": "#/$defs/TransformersPromptStyle",
"default": "chat"
},
"response_format": {
"$ref": "#/$defs/ResponseFormat"
},
"torch_dtype": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Torch Dtype"
},
"supported_devices": {
"default": [
"cpu",
"cuda",
"mps"
],
"items": {
"$ref": "#/$defs/AcceleratorDevice"
},
"title": "Supported Devices",
"type": "array"
},
"stop_strings": {
"default": [],
"items": {
"type": "string"
},
"title": "Stop Strings",
"type": "array"
},
"custom_stopping_criteria": {
"default": [],
"items": {
"anyOf": []
},
"title": "Custom Stopping Criteria",
"type": "array"
},
"extra_generation_config": {
"additionalProperties": true,
"default": {},
"title": "Extra Generation Config",
"type": "object"
},
"extra_processor_kwargs": {
"additionalProperties": true,
"default": {},
"title": "Extra Processor Kwargs",
"type": "object"
},
"use_kv_cache": {
"default": true,
"title": "Use Kv Cache",
"type": "boolean"
},
"max_new_tokens": {
"default": 4096,
"title": "Max New Tokens",
"type": "integer"
},
"track_generated_tokens": {
"default": false,
"title": "Track Generated Tokens",
"type": "boolean"
},
"track_input_prompt": {
"default": false,
"title": "Track Input Prompt",
"type": "boolean"
}
},
"required": [
"prompt",
"repo_id",
"inference_framework",
"response_format"
],
"title": "InlineVlmOptions",
"type": "object"
},
"PictureDescriptionBaseOptions": {
"properties": {
"batch_size": {
"default": 8,
"title": "Batch Size",
"type": "integer"
},
"scale": {
"default": 2,
"title": "Scale",
"type": "number"
},
"picture_area_threshold": {
"default": 0.05,
"title": "Picture Area Threshold",
"type": "number"
}
},
"title": "PictureDescriptionBaseOptions",
"type": "object"
},
"ResponseFormat": {
"enum": [
"doctags",
"markdown",
"html",
"otsl",
"plaintext"
],
"title": "ResponseFormat",
"type": "string"
},
"TransformersModelType": {
"enum": [
"automodel",
"automodel-vision2seq",
"automodel-causallm",
"automodel-imagetexttotext"
],
"title": "TransformersModelType",
"type": "string"
},
"TransformersPromptStyle": {
"enum": [
"chat",
"raw",
"none"
],
"title": "TransformersPromptStyle",
"type": "string"
}
},
"properties": {
"document_timeout": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.",
"examples": [
10.0,
20.0
],
"title": "Document Timeout"
},
"accelerator_options": {
"$ref": "#/$defs/AcceleratorOptions",
"default": {
"num_threads": 4,
"device": "auto",
"cuda_use_flash_attention2": false
},
"description": "Configuration options for hardware acceleration (e.g., GPU or optimized execution settings)."
},
"enable_remote_services": {
"default": false,
"description": "Enable calling external APIs or cloud services during pipeline execution.",
"examples": [
false
],
"title": "Enable Remote Services",
"type": "boolean"
},
"allow_external_plugins": {
"default": false,
"description": "Allow loading external third-party plugins or modules. Disabled by default for safety.",
"examples": [
false
],
"title": "Allow External Plugins",
"type": "boolean"
},
"artifacts_path": {
"anyOf": [
{
"format": "path",
"type": "string"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.",
"examples": [
"./artifacts",
"/tmp/docling_outputs"
],
"title": "Artifacts Path"
},
"do_picture_classification": {
"default": false,
"title": "Do Picture Classification",
"type": "boolean"
},
"do_picture_description": {
"default": false,
"title": "Do Picture Description",
"type": "boolean"
},
"picture_description_options": {
"$ref": "#/$defs/PictureDescriptionBaseOptions",
"default": {
"batch_size": 8,
"scale": 2.0,
"picture_area_threshold": 0.05,
"repo_id": "HuggingFaceTB/SmolVLM-256M-Instruct",
"prompt": "Describe this image in a few sentences.",
"generation_config": {
"do_sample": false,
"max_new_tokens": 200
}
}
},
"images_scale": {
"default": 1.0,
"title": "Images Scale",
"type": "number"
},
"generate_page_images": {
"default": true,
"title": "Generate Page Images",
"type": "boolean"
},
"generate_picture_images": {
"default": false,
"title": "Generate Picture Images",
"type": "boolean"
},
"force_backend_text": {
"default": false,
"title": "Force Backend Text",
"type": "boolean"
},
"vlm_options": {
"$ref": "#/$defs/InlineVlmOptions",
"default": {
"kind": "inline_model_options",
"prompt": "Convert this page to docling.",
"scale": 2.0,
"max_size": null,
"temperature": 0.0,
"repo_id": "ibm-granite/granite-docling-258M",
"revision": "main",
"trust_remote_code": false,
"load_in_8bit": true,
"llm_int8_threshold": 6.0,
"quantized": false,
"inference_framework": "transformers",
"transformers_model_type": "automodel-imagetexttotext",
"transformers_prompt_style": "chat",
"response_format": "doctags",
"torch_dtype": null,
"supported_devices": [
"cpu",
"cuda"
],
"stop_strings": [
"</doctag>",
"<|end_of_text|>"
],
"custom_stopping_criteria": [],
"extra_generation_config": {
"skip_special_tokens": false
},
"extra_processor_kwargs": {},
"use_kv_cache": true,
"max_new_tokens": 8192,
"track_generated_tokens": false,
"track_input_prompt": false
},
"title": "Vlm Options"
}
},
"title": "VlmPipelineOptions",
"type": "object"
}
Fields:
-
document_timeout(Annotated[Optional[float], Field(description='Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.', examples=[10.0, 20.0])]) -
accelerator_options(Annotated[AcceleratorOptions, Field(description='Configuration options for hardware acceleration (e.g., GPU or optimized execution settings).')]) -
enable_remote_services(Annotated[bool, Field(description='Enable calling external APIs or cloud services during pipeline execution.', examples=[False])]) -
allow_external_plugins(Annotated[bool, Field(description='Allow loading external third-party plugins or modules. Disabled by default for safety.', examples=[False])]) -
artifacts_path(Annotated[Optional[Union[Path, str]], Field(description='Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.', examples=['./artifacts', '/tmp/docling_outputs'])]) -
do_picture_classification(bool) -
do_picture_description(bool) -
picture_description_options(PictureDescriptionBaseOptions) -
images_scale(float) -
generate_picture_images(bool) -
generate_page_images(bool) -
force_backend_text(bool) -
vlm_options(Union[InlineVlmOptions, ApiVlmOptions])
accelerator_options
pydantic-field
accelerator_options: Annotated[AcceleratorOptions, Field(description='Configuration options for hardware acceleration (e.g., GPU or optimized execution settings).')]
allow_external_plugins
pydantic-field
allow_external_plugins: Annotated[bool, Field(description='Allow loading external third-party plugins or modules. Disabled by default for safety.', examples=[False])] = False
artifacts_path
pydantic-field
artifacts_path: Annotated[Optional[Union[Path, str]], Field(description='Filesystem path where pipeline artifacts should be stored. If None, artifacts will be fetched. You can use the utility `docling-tools models download` to pre-fetch the model artifacts.', examples=['./artifacts', '/tmp/docling_outputs'])] = None
do_picture_classification
pydantic-field
do_picture_classification: bool = False
do_picture_description
pydantic-field
do_picture_description: bool = False
document_timeout
pydantic-field
document_timeout: Annotated[Optional[float], Field(description='Maximum allowed processing time for a document before timing out. If None, no timeout is enforced.', examples=[10.0, 20.0])] = None
enable_remote_services
pydantic-field
enable_remote_services: Annotated[bool, Field(description='Enable calling external APIs or cloud services during pipeline execution.', examples=[False])] = False
force_backend_text
pydantic-field
force_backend_text: bool = False
generate_page_images
pydantic-field
generate_page_images: bool = True
generate_picture_images
pydantic-field
generate_picture_images: bool = False
images_scale
pydantic-field
images_scale: float = 1.0
kind
class-attribute
kind: str
picture_description_options
pydantic-field
picture_description_options: PictureDescriptionBaseOptions = smolvlm_picture_description
vlm_options
pydantic-field
vlm_options: Union[InlineVlmOptions, ApiVlmOptions] = GRANITEDOCLING_TRANSFORMERS