Skip to main content
For the complete documentation index for agents and LLMs, see llms.txt.

DoclingServeConverter

Convert documents using a remote DoclingServe API endpoint, with no local ML dependencies required.

Key Features​

  • Converts PDFs, Office documents, HTML, and other supported formats via a remote DoclingServe server.
  • Supports Markdown, plain text, and JSON export formats.
  • Accepts local file paths, ByteStream objects, and URL strings.
  • Supports synchronous and asynchronous (job polling) execution modes.
  • Authenticates with secured DoclingServe instances via API key.
  • Supports both run() and run_async() for non-blocking pipeline execution.

Configuration​

  1. Deploy a DoclingServe instance.
  2. If your instance requires authentication, set the DOCLING_SERVE_API_KEY environment variable. For instructions, see Create Secrets.
  3. Configure DoclingServeConverter in your pipeline YAML with the base_url of your DoclingServe instance.

Connections​

DoclingServeConverter accepts file paths, URL strings, or ByteStream inputs as sources, and optional metadata as meta. It outputs a list of Document objects (documents) containing the converted content.

Connect the pipeline's file input to the sources input. Connect the documents output to DocumentSplitter, DocumentJoiner, or DocumentWriter for further processing.

Source Code​

To check this component's source code, open converter.py in the Haystack Core Integrations repository.

Usage Examples​

Basic Configuration​

docling_serve_converter:
type: haystack_integrations.components.converters.docling_serve.converter.DoclingServeConverter
init_parameters:
base_url: http://localhost:5001
export_type: markdown
api_key:
type: env_var
env_vars:
- DOCLING_SERVE_API_KEY
strict: false

Using the Component in a Pipeline​

# haystack-pipeline
components:
docling_serve_converter:
type: haystack_integrations.components.converters.docling_serve.converter.DoclingServeConverter
init_parameters:
base_url: http://localhost:5001
export_type: markdown
api_key:
type: env_var
env_vars:
- DOCLING_SERVE_API_KEY
strict: false
splitter:
type: haystack.components.preprocessors.document_splitter.DocumentSplitter
init_parameters:
split_by: word
split_length: 250
split_overlap: 30
writer:
type: haystack.components.writers.document_writer.DocumentWriter
init_parameters:
document_store:
type: haystack_integrations.document_stores.opensearch.document_store.OpenSearchDocumentStore
init_parameters:
hosts:
- ${OPENSEARCH_HOST}
index: docling-serve-demo
embedding_dim: 768
create_index: true

connections:
- sender: docling_serve_converter.documents
receiver: splitter.documents
- sender: splitter.documents
receiver: writer.documents

inputs:
files:
- docling_serve_converter.sources

max_runs_per_component: 100

metadata: {}

Parameters​

Init Parameters​

These are the parameters you can configure in Pipeline Builder:

ParameterTypeDefaultDescription
base_urlstrhttp://localhost:5001Base URL of the DoclingServe instance.
export_typestrmarkdownOutput format. One of markdown, text, or json.
convert_optionsdict | NoneNoneAdditional conversion options passed to the DoclingServe API, such as {"do_ocr": true}. The to_formats key is set automatically and must not be included here.
timeoutfloat120.0HTTP request timeout in seconds.
api_keySecret | NoneSecret.from_env_var("DOCLING_SERVE_API_KEY", strict=False)API key for a secured DoclingServe instance. Set to None to disable authentication.
modestrsyncConversion mode. sync uses synchronous endpoints. async submits jobs and polls for completion.
poll_intervalfloat2.0Maximum sleep time in seconds between async job polls. Used in async mode only.
job_timeoutfloat600.0Maximum time in seconds to wait for each async conversion job. Used in async mode only.