alt.freeweights.granite / granite-docling-258M
From: ibm-granite <huggingface.co/ibm-granite>Newsgroups: alt.freeweights.graniteSubject:

granite-docling-258M

Date: 2026-11-14Commit: 982fe3bSigned: 2DC28CC7B26A283B ✓

Image text to text model with 258M parameters. Safetensors weights, 530 MB in all. Published by ibm-granite under Apache-2.0.

258M params530MBgranite-docling-258Msafetensorspermissive
FactsParams258MSize530 MBFormatssafetensorsTaskimage text to textLicenseApache-2.0From sourcepermissive
$ fw get ibm-granite/granite-docling-258M
# manifest sha256 d87ec5337feb… · 530 MB · 17 files
$ fw verify ./granite-docling-258M ibm-granite/granite-docling-258M
From sourceHosted (signed)ibm-granite/granite-docling-258MLast check: 2026-11-14 21:16 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Works with

Overview

Size
530 MB
Weights
515 MB (safetensors)
Parameters
258M
Formats
safetensors
Task
image text to text
License
Apache-2.0 (permissive)
Files
17, each with a sha256
Publisher
ibm-granite
Added
2026-11-14
Section
alt.freeweights.granite
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commitโ†’You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-14 21:16 UTCpassed

Model card

From the publisher at commit 982fe3b. Shown as plain text with links; images open at the publisher.

granite-docling-258m#

Image: Granite Docling Logo

Granite Docling is a multimodal Image-Text-to-Text model engineered for efficient document conversion. It preserves the core features of Docling while maintaining seamless integration with DoclingDocuments to ensure full compatibility.

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"

Image: GraniteDocling result in split page view

You can also set this model up within the Docling SDK:

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

๐Ÿ“„ Single page image inference using plain ๐Ÿค— tranformers ๐Ÿค–

# 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)

๐Ÿš€ Fast Batch Inference with VLLM

# 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/"  # Place your page images here
OUTPUT_DIR = "out/"
PROMPT_TEXT = "Convert this page to docling."

messages = [
    {
        "role": "user",
        "content": [
            {"type": "image"},
            {"type": "text", "text": PROMPT_TEXT},
        ],
    },
]


# Ensure output directory exists
os.makedirs(OUTPUT_DIR, exist_ok=True)

# Initialize LLM
llm = LLM(model=MODEL_PATH, revision="untied", limit_mm_per_prompt={"image": 1})
processor = AutoProcessor.from_pretrained(MODEL_PATH)

sampling_params = SamplingParams(
    temperature=0.0,
    max_tokens=8192,
    skip_special_tokens=False,
)

# Load and prepare all images and prompts up front
batched_inputs = []
image_names = []

for img_file in sorted(os.listdir(IMAGE_DIR)):
    if img_file.lower().endswith((".png", ".jpg", ".jpeg")):
        img_path = os.path.join(IMAGE_DIR, img_file)
        with Image.open(img_path) as im:
            image = im.convert("RGB")

        prompt = processor.apply_chat_template(messages, add_generation_prompt=True)
        batched_inputs.append({"prompt": prompt, "multi_modal_data": {"image": image}})
        image_names.append(os.path.splitext(img_file)[0])

# Run batch inference
start_time = time.time()
outputs = llm.generate(batched_inputs, sampling_params=sampling_params)

# Postprocess all results
for img_fn, output, input_data in zip(image_names, outputs, batched_inputs):
    doctags = output.outputs[0].text
    output_path_dt = Path(OUTPUT_DIR) / f"{img_fn}.dt"
    output_path_md = Path(OUTPUT_DIR) / f"{img_fn}.md"

    with open(output_path_dt, "w", encoding="utf-8") as f:
        f.write(doctags)

    # Convert to DoclingDocument and save markdown
    doctags_doc = DocTagsDocument.from_doctags_and_image_pairs([doctags], [input_data["multi_modal_data"]["image"]])
    doc = DoclingDocument.load_from_doctags(doctags_doc, document_name="Document")
    doc.save_as_markdown(output_path_md)

print(f"Total time: {time.time() - start_time:.2f} sec")

๐Ÿ’ป Local inference on Apple Silicon with MLX: see here

โ„น๏ธ If you see trouble running granite-docling with the codes above, check the troubleshooting section at the bottom โฌ‡๏ธ.

Intended Use#

Granite-Docling is designed to complement the Docling library, not replace it. It integrates as a component within larger Docling library, consolidating the functions of multiple single-purpose models into a single, compact VLM. However, Granite-Docling is not intended for general image understanding. For tasks focused solely on image-text input, we recommend using Granite Vision models, which are purpose-built and optimized for image-text processing.

Evaluations#

A comprehensive discussion of evaluation methods and findings has already been presented in our previous publication [citation]. As this model is an update, we refer readers to that work for additional details. The evaluation can be performed using the docling-eval framework for the document related tasks, and lmms-eval for MMStar and OCRBench.

| Layout

| | MAP โ†‘ | F1 โ†‘ | Precision โ†‘ | Recall โ†‘

| smoldocling-256m-preview | 0.23 | 0.85 | 0.9 | 0.84

| granite-docling-258m | 0.27 | 0.86 | 0.92 | 0.88

| Full Page OCR

| | Edit-distance โ†“ | F1 โ†‘ | Precision โ†‘ | Recall โ†‘ | BLEU โ†‘ | Meteor โ†‘

| smoldocling-256m-preview | 0.48 | 0.80 | 0.89 | 0.79 | 0.58 | 0.67

| granite-docling-258m | 0.45 | 0.84 | 0.91 | 0.83 | 0.65 | 0.72

| Code Recognition

| | Edit-distance โ†“ | F1 โ†‘ | Precision โ†‘ | Recall โ†‘ | BLEU โ†‘ | Meteor โ†‘

| smoldocling-256m-preview | 0.114 | 0.915 | 0.94 | 0.909 | 0.875 | 0.889

| granite-docling-258m | 0.013 | 0.988 | 0.99 | 0.988 | 0.983 | 0.986

| Equation Recognition

| | Edit-distance โ†“ | F1 โ†‘ | Precision โ†‘ | Recall โ†‘ | BLEU โ†‘ | Meteor โ†‘

| smoldocling-256m-preview | 0.119 | 0.947 | 0.959 | 0.941 | 0.824 | 0.878

| granite-docling-258m | 0.073 | 0.968 | 0.968 | 0.969 | 0.893 | 0.927

| Table Recognition (FinTabNet 150dpi)

| | TEDS (structure) โ†‘ | TEDS (w/content) โ†‘

| smoldocling-256m-preview | 0.82 | 0.76

| granite-docling-258m | 0.97 | 0.96

| Other Benchmarks

| | MMStar โ†‘ | OCRBench โ†‘

| smoldocling-256m-preview | 0.17 | 338

| granite-docling-258m | 0.30 | 500

๐Ÿ’ป Local inference on Apple Silicon with MLX: see here

Supported Instructions#

| Description | Instruction | Short Instruction

| Full conversion | Convert this page to docling. | -

| Chart | Convert chart to table. | &lt;chart&gt;

| Formula | Convert formula to LaTeX. | &lt;formula&gt;

| Code | Convert code to text. | &lt;code&gt;

| Table | Convert table to OTSL. (Lysak et al., 2023) | &lt;otsl&gt;

| Actions and Pipelines | OCR the text in a specific location: &lt;loc_155&gt;&lt;loc_233&gt;&lt;loc_206&gt;&lt;loc_237&gt; | -

| Identify element at: &lt;loc_247&gt;&lt;loc_482&gt;&lt;loc_252&gt;&lt;loc_486&gt; | -

| Find all 'text' elements on the page, retrieve all section headers. | -

| Detect footer elements on the page. | -

Model Architecture:#

The architecture of granite-docling-258m consists of the following components:

(1) Vision encoder: siglip2-base-patch16-512.

(2) Vision-language connector: pixel shuffle projector (as in idefics3)

(3) Large language model: Granite 165M.

We built upon Idefics3 to train our model. We incorporated DocTags into our LLMโ€™s supervised fine-tuning (SFT) data to help the model become familiar with the format, enabling faster convergence and mitigating issues previously observed with SmolDocling. The model was trained using the nanoVLM framework, which provides a lightweight and efficient training setup for vision-language models

Training Data: Our training corpus consists of two principal sources: (1) publicly available datasets and (2) internally constructed synthetic datasets designed to elicit specific document understanding capabilities.

In particular, we incorporate:

  • SynthCodeNet โ€” a large-scale collection of synthetically rendered code snippets spanning over 50 programming languages
  • SynthFormulaNet โ€” a dataset of synthetic mathematical expressions paired with ground-truth LaTeX representations
  • SynthChartNet โ€” synthetic chart images annotated with structured table outputs
  • DoclingMatix โ€” a curated corpus of real-world document pages sampled from diverse domains

Infrastructure: We train granite-docling-258m using IBM's super computing cluster, Blue Vela, which is outfitted with NVIDIA H100 GPUs. This cluster provides a scalable and efficient infrastructure for training our models over thousands of GPUs.

Responsible Use and Limitations Some use cases for Vision Language Models can trigger certain risks and ethical considerations, including but not limited to: bias and fairness, misinformation, and autonomous decision-making. Although our alignment processes include safety considerations, the model may in some cases produce inaccurate, biased, offensive or unwanted responses to user prompts. Additionally, whether smaller models may exhibit increased susceptibility to hallucination in generation scenarios due to their reduced sizes, which could limit their ability to generate coherent and contextually accurate responses, remains uncertain. This aspect is currently an active area of research, and we anticipate more rigorous exploration, comprehension, and mitigations in this domain. We urge the community to use granite-docling-258m in a responsible way and avoid any malicious utilization. We recommend using this model only as part of the Docling library. More general vision tasks may pose higher inherent risks of triggering unwanted output. To enhance safety, we recommend using granite-docling-258m alongside Granite Guardian. Granite Guardian is a fine-tuned instruct model designed to detect and flag risks in prompts and responses across key dimensions outlined in the IBM AI Risk Atlas. Its training, which includes both human-annotated and synthetic data informed by internal red-teaming, enables it to outperform similar open-source models on standard benchmarks, providing an additional layer of safety.

Resources

Troubleshooting#

Running with VLLM

  1. You receive AttributeError: 'LlamaModel' object has no attribute 'wte' when launching the model through VLLM. With current versions of VLLM (including 0.10.2), support for tied weights as used in granite-docling is limited and breaks. We provide a version with untied weights on the untied branch of this model repo. To use the untied version, please pass the revision argument to VLLM: sh # Serve the model through VLLM $> vllm serve ibm-granite/granite-docling-258M --revision untied python # If using the VLLM python SDK: from vllm import LLM ... llm = LLM(model=MODEL_PATH, revision="untied", limit_mm_per_prompt={"image": 1})
  2. The model outputs only exclamation marks (i.e. "!!!!!!!!!!!!!!!"). This is seen on older NVIDIA GPUs, such as the T4 GPU available in Google Colab, because it lacks support for bfloat16 format. You can work around it by setting the dtype to float32.
    # Serve the model through VLLM
    $> vllm serve ibm-granite/granite-docling-258M --revision untied --dtype float32
    ``` 
    
    ```python
    # If using the VLLM python SDK:
    from vllm import LLM
    ... 

    llm = LLM(model=MODEL_PATH, revision="untied", limit_mm_per_prompt={"image": 1}, dtype="float32")
    ```

    
   


Files

17 files ยท 530 MBWeights 515 MB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 17 files with their sha256
FileSizesha256
.gitattributes1.71 KBac7414e1a380803ade2fd0e73945a89898b5630939f73704f534c2ba8da74567
README.md21.0 KBb43727febeba2c6ce20b8746322e7687ca667d81a12d0364f346148f30622d84
added_tokens.json35 B882e49757a3bea90e00df1d2dc8c18b2b526ff77380db20439feeb1f053a63cd
assets/granite_docling_split_page.png2.32 MBa1bd51ff1cea9daabc7f00522c7cc4b5905fa5cd3f67c40d0d707ee0686ce94b
assets/new_arxiv.png523 KB15e72aca956d9e796788eaa4b0debb9ae988ca7a9637ae3b6df1e6ce671d73d0
chat_template.jinja588 Ba4b0bf4348b014acca131da664d05b61e39d5dc8af980f1913846a57ccc6d289
config.json1.64 KB4fbb5d2ad9549663e5740b36a5f45cb3d861d20d2e1c158af8569765f9864f30
generation_config.json169 B369256b622c73d709b248da31ba4332ef19c01dec6e311d8e4b671bc1321bc06
granite_docling.png2.19 MBf4d43939df541ab6958e989e7a6761a8db1ccb484dcb0c2749fedbb1357d2bb8
merges.txt917 KBb6fe424e334903f7fb84d3a106d9730455f4744b9fe3c21ee136d97a00e72502
model.safetensors515 MB1cdad234deb1cde18ee6a586f849057f19851daf1fedce2e40aff791dbe46f61
preprocessor_config.json486 B6cb6e36d6fcb88ca1502c4a26750715dc3e7dedddc9a8f17b27d8d167d1457e7
processor_config.json68 Be7bff42da73ae9eec9042ef20e066e11f1ee20f025358ff79131e3c0fb549b46
special_tokens_map.json812 B45c073d82ba37a1fc69c8d6a772d17a8e4f78b64b63c0fce2c77d18a3259d18e
tokenizer.json7.15 MB673ef3c60759806916ebf37c5d9b79f7ffd53a1419f1ebd75bfec8f177c2b1b3
tokenizer_config.json17.8 KB261f9491897226589c131a4ac5993c495eec2104dace144f69c397682865a3a0
vocab.json1.61 MBe2bad0ce74e6ddfece426ef99e18067f4a6c3d4e65bb6dd9cfd638450cca0142
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
982fe3b40f pinned now manifest updated, same commit2026-11-14 21:16 UTC17 files ยท 530 MB
982fe3b40f2026-11-14 21:16 UTC17 files ยท 530 MB

Use it

$ fw get ibm-granite/granite-docling-258M
# manifest sha256 d87ec5337feb… · 530 MB · 17 files
$ fw verify ./granite-docling-258M ibm-granite/granite-docling-258M
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/ibm-granite/granite-docling-258M.json --dir ./granite-docling-258M $ python3 fw.py verify ./granite-docling-258M ./ibm-granite__granite-docling-258M.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download ibm-granite/granite-docling-258M --revision 982fe3b40f2fa73c365bdb1bcacf6c81b7184bfe --local-dir ./granite-docling-258M
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModelForImageTextToText, AutoProcessor processor = AutoProcessor.from_pretrained("ibm-granite/granite-docling-258M", revision="982fe3b40f2fa73c365bdb1bcacf6c81b7184bfe") model = AutoModelForImageTextToText.from_pretrained("ibm-granite/granite-docling-258M", revision="982fe3b40f2fa73c365bdb1bcacf6c81b7184bfe", device_map="auto")
vLLMServe an OpenAI-compatible API.
$ HF_ENDPOINT=https://freeweights.allternit.com vllm serve ibm-granite/granite-docling-258M --revision 982fe3b40f2fa73c365bdb1bcacf6c81b7184bfe

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-14
Text in
README.md
Text sha256
b43727febeba2c6ce20b8746322e7687ca667d81a12d0364f346148f30622d84
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: ibm-granite <huggingface.co/ibm-granite>Newsgroups: alt.freeweights.graniteSubject: granite-docling-258MDate: 2026-11-14Commit: 982fe3bSigned: 2DC28CC7B26A283B ✓
Upstream
ibm-granite/granite-docling-258M
Pinned commit
982fe3b40f2fa73c365bdb1bcacf6c81b7184bfe
Manifest
granite-docling-258M.json ยท .minisig
Manifest sha256
d87ec5337febc75a55847f60fb21c4bf96017dcc6997ce0d293c04dc8794f6ed
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-14 21:16 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/ibm-granite/granite-docling-258M.json $ curl -O https://freeweights.allternit.com/manifests/ibm-granite/granite-docling-258M.json.minisig $ minisign -Vm granite-docling-258M.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

3 models in the catalog name this one as their parent.

Fine-tunes
1
Quantizations
2
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download ibm-granite/granite-docling-258M
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. granite-docling-258M.json. Provenance. Takedown history: none.

Variants

2 quantized or adapter builds of granite-docling-258M. Each has its own license check and page.

From: ibm-granite <huggingface.co/ibm-granite>Subject: GneissWeb.7B_ablation_model_on_350B_FineWeb.Edu.seed1
From: ibm-granite <huggingface.co/ibm-granite>Subject: GneissWeb.7B_ablation_model_on_350B_FineWeb.Edu.seed2
From: ibm-granite <huggingface.co/ibm-granite>Subject: GneissWeb.7B_ablation_model_on_350B_FineWeb.Edu.seed3
From: ibm-granite <huggingface.co/ibm-granite>Subject: GneissWeb.7B_ablation_model_on_350B_FineWeb.seed1
From: ibm-granite <huggingface.co/ibm-granite>Subject: GneissWeb.7B_ablation_model_on_350B_FineWeb.seed2
From: ibm-granite <huggingface.co/ibm-granite>Subject: GneissWeb.7B_ablation_model_on_350B_FineWeb.seed3