The Granite Docling model is designed for enterprise applications that involve end-to-end document understanding and conversion. Unlike traditional pipelines that chain together OCR, layout analysis, and post-processing, Docling integrates vision and language into a single compact model (~ 258M parameters), capable of parsing PDFs, slides, and scanned pages directly into structured, machine-readable formats.A key feature is its use of DocTags, a purpose-built markup language that separates content from layout while faithfully preserving tables, code blocks, inline and block math, and document hierarchy. This design improves fidelity, minimizes errors in reading order and structure, and makes outputs well-suited for downstream tasks such as retrieval-augmented generation (RAG) and fine-tuning. While optimized for Latin-script documents, it also offers early support for Japanese, Chinese, and Arabic.Granite Docling is released under the Apache 2.0 license, ensuring it is freely available for both research and commercial use. It complements the open-source Docling library by providing an all-in-one, production-ready alternative for document conversion, with full transparency into its design and training.
The easiest way to use this model is through the 🐥Docling library. It will automatically download this model and convert documents to various formats for you.Install the latest version of docling through pip, then use the following CLI command:
# Convert to HTML and Markdown:docling --to html --to md --pipeline vlm --vlm-model granite_docling "https://arxiv.org/pdf/2501.17887" # accepts files, urls or directories# Convert to HTML including layout visualization:docling --to html_split_page --show-layout --pipeline vlm --vlm-model granite_docling "https://arxiv.org/pdf/2501.17887"
You can also set this model up within the Docling SDK:
from docling.datamodel import vlm_model_specsfrom docling.datamodel.base_models import InputFormatfrom docling.datamodel.pipeline_options import ( VlmPipelineOptions,)from docling.document_converter import DocumentConverter, PdfFormatOptionfrom docling.pipeline.vlm_pipeline import VlmPipelinesource = "https://arxiv.org/pdf/2501.17887"###### USING SIMPLE DEFAULT VALUES# - GraniteDocling model# - Using the transformers frameworkconverter = DocumentConverter( format_options={ InputFormat.PDF: PdfFormatOption( pipeline_cls=VlmPipeline, ), })doc = converter.convert(source=source).documentprint(doc.export_to_markdown())###### USING MACOS MPS ACCELERATOR# For more options see the compare_vlm_models.py example.pipeline_options = VlmPipelineOptions( vlm_options=vlm_model_specs.GRANITEDOCLING_MLX,)converter = DocumentConverter( format_options={ InputFormat.PDF: PdfFormatOption( pipeline_cls=VlmPipeline, pipeline_options=pipeline_options, ), })doc = converter.convert(source=source).documentprint(doc.export_to_markdown())
Alternatively, you can use bare transformers, vLLM, onnx or mlx-vlm to perform inference, and docling-core APIs to convert results to variety of output formats (md, html, etc.).Here’s an example of single-page image inference using plain transformers.