Docling LangChain integration
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 thereofconverter(optional): a localDocumentConverter, remoteDoclingServiceClient, or compatible converterconvert_kwargs(optional): backend-specific kwargs for conversion execution, such as{"options": ConvertDocumentsOptions(...)}for the service clientexport_type(optional): export mode to use:ExportType.DOC_CHUNKS(default) orExportType.MARKDOWNmd_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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_docling-3.0.0.tar.gz.
File metadata
- Download URL: langchain_docling-3.0.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2958bfb8ec290a70357489ed723e03f57840ee28ddf112fd00ff06db627df24
|
|
| MD5 |
b477b17a91e8638342933c7988203013
|
|
| BLAKE2b-256 |
6b58be79d676159e4e8e18ed1732300371e344624cf116d73df461330f274ebb
|
Provenance
The following attestation bundles were made for langchain_docling-3.0.0.tar.gz:
Publisher:
pypi.yml on docling-project/docling-langchain
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_docling-3.0.0.tar.gz -
Subject digest:
f2958bfb8ec290a70357489ed723e03f57840ee28ddf112fd00ff06db627df24 - Sigstore transparency entry: 2464759755
- Sigstore integration time:
-
Permalink:
docling-project/docling-langchain@5e8f40369d0f724798899e3ba45844c4cd6fa57a -
Branch / Tag:
refs/tags/v3.0.0 - Owner: https://github.com/docling-project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@5e8f40369d0f724798899e3ba45844c4cd6fa57a -
Trigger Event:
release
-
Statement type:
File details
Details for the file langchain_docling-3.0.0-py3-none-any.whl.
File metadata
- Download URL: langchain_docling-3.0.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e24e27158863592ef05c3141417ba50fdce1879dbbb911103e5623e6e326d2f
|
|
| MD5 |
8b4cc95b4d14d936496dd9512162a556
|
|
| BLAKE2b-256 |
c3df12c42d474d872eefdc65b464cf33d3ed5c9038964d4d0dfa409bd5d1b066
|
Provenance
The following attestation bundles were made for langchain_docling-3.0.0-py3-none-any.whl:
Publisher:
pypi.yml on docling-project/docling-langchain
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_docling-3.0.0-py3-none-any.whl -
Subject digest:
1e24e27158863592ef05c3141417ba50fdce1879dbbb911103e5623e6e326d2f - Sigstore transparency entry: 2464760210
- Sigstore integration time:
-
Permalink:
docling-project/docling-langchain@5e8f40369d0f724798899e3ba45844c4cd6fa57a -
Branch / Tag:
refs/tags/v3.0.0 - Owner: https://github.com/docling-project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@5e8f40369d0f724798899e3ba45844c4cd6fa57a -
Trigger Event:
release
-
Statement type: