Skip to main content

inline::docling

Description

Docling is a layout-aware, structure-preserving document parser for OGX. Unlike simple text extraction, Docling understands document structure — headings, tables, lists, and sections — and produces Markdown-formatted output that preserves semantic boundaries. It supports PDF, DOCX, PPTX, HTML, and images.

Features

  • Structure-aware chunking — splits at semantic boundaries (headings, sections) using Docling's HybridChunker
  • Layout preservation — tables, lists, and nested structures are converted to Markdown
  • Multi-format support — PDF, DOCX, PPTX, HTML, and images
  • Better RAG quality — structured chunks with heading metadata produce more relevant retrieval results
  • VLM-based processing — optionally route Vision Language Model inference through the stack's model-serving infrastructure for richer document understanding (layout analysis, OCR via vision models)

Usage

Start OGX with the Docling file processor using the --providers flag:

OLLAMA_URL=http://localhost:11434/v1 ogx stack run \
--providers "file_processors=inline::docling,files=inline::localfs,vector_io=inline::faiss,inference=inline::sentence-transformers,inference=remote::ollama" \
--port 8321

Or add it to a custom run.yaml:

file_processors:
- provider_id: docling
provider_type: inline::docling
config: {}

Enabling VLM Processing

To enable VLM-based document processing, set vlm_model to a vision model registered with the stack's inference API. The VLM pipeline routes inference through the stack's model-serving infrastructure — no separate GPU resources are needed for document processing.

file_processors:
- provider_id: docling
provider_type: inline::docling
config:
vlm_model: granite-docling-258M
vlm_preset: granite_docling

When vlm_model is not set or no inference provider is available, the processor gracefully degrades to the standard non-VLM pipeline.

Installation

pip install docling

Documentation

See Docling's documentation for more details.

Configuration

FieldTypeRequiredDefaultDescription
default_chunk_size_tokensintNo800Default chunk size in tokens when chunking_strategy type is 'auto'
default_chunk_overlap_tokensintNo400Default chunk overlap in tokens when chunking_strategy type is 'auto'
do_ocrboolNoTrueEnable OCR for scanned documents. Set to False for digital PDFs (with embedded text) to improve processing speed by ~3x for non-scanned PDFs. Note: Setting to False on scanned PDFs will result in minimal text extraction. Ignored when vlm_model is set (VLM pipeline handles text extraction).
vlm_modelstr | NoneNoModel identifier for VLM-based document processing. When set and an inference provider is available, enables the VLM pipeline for richer document understanding (layout analysis, OCR via vision models). The model must be registered with the stack's inference API. When None (default), uses the standard non-VLM pipeline.
vlm_presetstrNogranite_doclingDocling VLM preset controlling prompt template and response format. Must be a valid preset name registered with VlmConvertOptions. The default 'granite_docling' is the recommended preset for production use.

Sample Configuration

default_chunk_size_tokens: 800
default_chunk_overlap_tokens: 400
do_ocr: true
vlm_model: null
vlm_preset: granite_docling