Model reference · open weights

granite-docling

LLMs ibm-granite Vision + text 1 build Open weights 266k dl/mo

granite-docling is an open-weight language model from IBM. granite-docling-258M (BF16) weighs 515 MB; the smallest configuration that runs it is RTX 3060 12 GB.

  • Granite Docling 258M is a 258M parameter image-text-to-text model developed by IBM for document conversion within the Docling library.
  • It uses the Idefics3 architecture with a SigLIP2 vision encoder and a Granite 165M language model to process English documents, including experimental support for Japanese, Arabic, and Chinese.
  • The model is licensed under Apache 2.0.

Summary of the ibm-granite/granite-docling-258M model card, 2026-10-01

What it is

Released byIBM
Released2025-05-19
Parameters258M
VRAM515 MB for the weights

What it runs on

Memory and cards for granite-docling-258M (BF16)

515 MBweights, file size
23 MBcache per 1K tokens
1.8 GBruntime overhead, at least
8,192 tokenscontext max
CardRequests at onceContext maxMemory
8K each
RTX 3060 12 GB49all 8K11.6 GB
RTX 4060 Ti 16 GB69all 8K15.4 GB
RTX 3090 24 GB111all 8K23.4 GB
RTX 4090 24 GB111all 8K23.4 GB
RTX 5090 32 GB151all 8K31.0 GB
L40S 48 GB220all 8K44.0 GB
A100 80 GB401all 8K78.2 GB
H100 80 GB383all 8K78.1 GB
RTX PRO 6000 Blackwell 96 GB466all 8K93.8 GB
DGX Spark (GB10) 128 GB unified538all 8K107 GB
H200 141 GB700all 8K138 GB
B200 180 GB903all 8K176 GB
Memory needed at each load
Requests at once8K tokens each
12.5 GB
53.3 GB
83.9 GB
165.4 GB
328.4 GB
6414.4 GB

One card, with vLLM's small-card settings.

From the model card

What IBM says about granite-docling

Read the model card

Model Summary:

Granite Docling 258M builds upon the Idefics3 architecture, but introduces two key modifications: it replaces the vision encoder with siglip2-base-patch16-512 and substitutes the language model with a Granite 165M LLM. Try out our Granite-Docling-258 demo today.

  • Developed by: IBM Research
  • Model type: Multi-modal model (image+text-to-text)
  • Language(s): English (NLP)
  • License: Apache 2.0
  • Release Date: September 17, 2025

Granite-docling-258M is fully integrated into the Docling pipelines, carrying over existing features while introducing a number of powerful new features, including:

  • 🔢 Enhanced Equation Recognition: More accurate detection and formatting of mathematical formulas
  • 🧩 Flexible Inference Modes: Choose between full-page inference, bbox-guided region inference
  • 🧘 Improved Stability: Tends to avoid infinite loops more effectively
  • 🧮 Enhanced Inline Equations: Better inline math recognition
  • 🧾 Document Element QA: Answer questions about a document’s structure such as the presence and order of document elements
  • 🌍 Japanese, Arabic and Chinese support (experimental)

Getting started

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"

from docling.datamodel import vlm_model_specs
from docling.datamodel.base_models import InputFormat
from docling.datamodel.pipeline_options import (
    VlmPipelineOptions,
)
from docling.document_converter import DocumentConverter, PdfFormatOption
from docling.pipeline.vlm_pipeline import VlmPipeline

source = "https://arxiv.org/pdf/2501.17887"

###### USING SIMPLE DEFAULT VALUES
# - GraniteDocling model
# - Using the transformers framework

converter = DocumentConverter(
    format_options={
        InputFormat.PDF: PdfFormatOption(
            pipeline_cls=VlmPipeline,
        ),
    }
)

doc = converter.convert(source=source).document

print(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).document

print(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.):

# Prerequisites:
# pip install torch
# pip install docling_core
# pip install transformers

import torch
from docling_core.types.doc import DoclingDocument
from docling_core.types.doc.document import DocTagsDocument
from transformers import AutoProcessor, AutoModelForVision2Seq
from transformers.image_utils import load_image
from pathlib import Path

DEVICE = "cuda" if torch.cuda.is_available() else "cpu"

# Load images
image = load_image("https://huggingface.co/ibm-granite/granite-docling-258M/resolve/main/assets/new_arxiv.png")

# Initialize processor and model
processor = AutoProcessor.from_pretrained("ibm-granite/granite-docling-258M")
model = AutoModelForVision2Seq.from_pretrained(
    "ibm-granite/granite-docling-258M",
    torch_dtype=torch.bfloat16,
    _attn_implementation="flash_attention_2" if DEVICE == "cuda" else "sdpa",
).to(DEVICE)

# Create input messages
messages = [
    {
        "role": "user",
        "content": [
            {"type": "image"},
            {"type": "text", "text": "Convert this page to docling."}
        ]
    },
]

# Prepare inputs
prompt = processor.apply_chat_template(messages, add_generation_prompt=True)
inputs = processor(text=prompt, images=[image], return_tensors="pt")
inputs = inputs.to(DEVICE)

# Generate outputs
generated_ids = model.generate(**inputs, max_new_tokens=8192)
prompt_length = inputs.input_ids.shape[1]
trimmed_generated_ids = generated_ids[:, prompt_length:]
doctags = processor.batch_decode(
    trimmed_generated_ids,
    skip_special_tokens=False,
)[0].lstrip()

print(f"DocTags: \n{doctags}\n")

# Populate document
doctags_doc = DocTagsDocument.from_doctags_and_image_pairs([doctags], [image])
# create a docling document
doc = DoclingDocument.load_from_doctags(doctags_doc, document_name="Document")
print(f"Markdown:\n{doc.export_to_markdown()}\n")

## export as any format.
# Path("out/").mkdir(parents=True, exist_ok=True)
# HTML:
# output_path_html = Path("out/") / "example.html"
# doc.save_as_html(output_path_html)
# Markdown:
# output_path_md = Path("out/") / "example.md"
# doc.save_as_markdown(output_path_md)

# Prerequisites:
# pip install vllm
# pip install docling_core
# place page images you want to convert into "img/" dir

import time
import os
from vllm import LLM, SamplingParams
from transformers import AutoProcessor
from PIL import Image
from docling_core.types.doc import DoclingDocument
from docling_core.types.doc.document import DocTagsDocument
from pathlib import Path

# Configuration
MODEL_PATH = "ibm-granite/granite-docling-258M"
IMAGE_DIR = "img/"

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms