Skip to main content

Docling LangChain integration

PyPI version PyPI - Python Version uv Code style: black Imports: isort Pydantic v2 pre-commit License MIT

A Docling integration for LangChain.

Installation

For Docling Serve or Managed Docling, install the lightweight service client:

pip install langchain-docling

This installation does not include local AI runtimes such as PyTorch. To convert documents locally, install the local extra instead:

pip install "langchain-docling[local]"

Development setup

To develop for Docling LangChain, you need Python 3.10 through 3.14 and uv. You can then install from your local clone's root directory:

uv sync

Usage

Basic usage

For local conversion, install the local extra and use DoclingLoader as follows:

from langchain_docling import DoclingLoader

FILE_PATH = ["https://arxiv.org/pdf/2408.09869"]  # Docling Technical Report

loader = DoclingLoader(file_path=FILE_PATH)
docs = loader.load()

Docling Serve or Managed Docling

Pass Docling's existing DoclingServiceClient as the loader's converter to run conversion remotely. The same client works with Docling for IBM watsonx and a self-hosted Docling Serve endpoint:

import os

from docling.datamodel.service.options import ConvertDocumentsOptions
from docling.service_client import DoclingServiceClient

from langchain_docling import DoclingLoader

service_url = os.environ["DOCLING_SERVICE_URL"]
api_key = os.environ["DOCLING_API_KEY"]
options = ConvertDocumentsOptions(
    do_ocr=True,
    table_mode="accurate",
)

with DoclingServiceClient(url=service_url, api_key=api_key) as client:
    loader = DoclingLoader(
        file_path=["https://arxiv.org/pdf/2408.09869"],
        converter=client,
        convert_kwargs={"options": options},
    )
    docs = loader.load()

The loader does not take ownership of a supplied client. Keep the client open until load() completes or until a lazy_load() iterator has been fully consumed. For a self-hosted endpoint that does not require authentication, omit api_key.

Advanced usage

When initializing a DoclingLoader, you can use the following parameters:

  • file_path: source as single str (URL or local file) or iterable thereof
  • converter (optional): a local DocumentConverter, remote DoclingServiceClient, or compatible converter
  • convert_kwargs (optional): backend-specific kwargs for conversion execution, such as {"options": ConvertDocumentsOptions(...)} for the service client
  • export_type (optional): export mode to use: ExportType.DOC_CHUNKS (default) or ExportType.MARKDOWN
  • md_export_kwargs (optional): any specific Markdown export kwargs (for Markdown mode)
  • chunker (optional): any specific Docling chunker instance to use (for doc-chunk mode)
  • meta_extractor (optional): any specific metadata extractor to use

Docs and examples

For more details and usage examples, check out this page.

Release files for langchain-docling 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-docling 3.0.0
File Size Uploaded
langchain_docling-3.0.0.tar.gz 9.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-docling 3.0.0
File Interpreter ABI Platform
langchain_docling-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.5 kB

Release files / langchain_docling-3.0.0.tar.gz

Download URL langchain_docling-3.0.0.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f2958bfb8ec290a70357489ed723e03f57840ee28ddf112fd00ff06db627df24
BLAKE2b-256 checksum
How to use checksums
6b58be79d676159e4e8e18ed1732300371e344624cf116d73df461330f274ebb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.

Transparency log

Release files / langchain_docling-3.0.0-py3-none-any.whl

Download URL langchain_docling-3.0.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e24e27158863592ef05c3141417ba50fdce1879dbbb911103e5623e6e326d2f
BLAKE2b-256 checksum
How to use checksums
c3df12c42d474d872eefdc65b464cf33d3ed5c9038964d4d0dfa409bd5d1b066
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page