Skip to content

IBM

granite-vision-5.0-4b

A 3.4B model by IBM that uses tools such as web search.

Tools
Downloads
5,571 downloads last month
Likes
19 likes
Uploaded
Uploaded 1 Dec 2026

Get it in Zero1LLM

Then open Explore in the app and search for:

Parameters
3,997,203,904 (4B)
Context length
131,072 tokens
Architecture
granite
Task
image-text-to-text
Licence
apache-2.0
Released
14 Oct 2026
Last updated
29 Nov 2026

This is ibm-granite's upload of ibm-granite/granite-vision-5.0-4b, which is based on ibm-granite/granite-4.1-3b, google/siglip2-so400m-patch16-384.

Languages listed in the model card

  • English
  • German
  • Spanish
  • French
  • Japanese
  • Portuguese
  • Arabic
  • Czech
  • Italian
  • Korean
  • Dutch
  • Chinese

Tools

Uses tools, so web search and the browser work best with it.

Each version is the same model stored at a different precision: smaller files use less memory and lose a little quality.

VersionFile sizeFileSHA-256
Q4_K_M2.10 GBgranite-vision-5.0-4b-Q4_K_M.gguf
Q5_K_M2.44 GBgranite-vision-5.0-4b-Q5_K_M.gguf
Q6_K2.80 GBgranite-vision-5.0-4b-Q6_K.gguf
Q8_03.62 GBgranite-vision-5.0-4b-Q8_0.gguf
BF166.81 GBgranite-vision-5.0-4b-bf16.gguf

Vision add-on (needed to read images): mmproj-model-bf16.gguf, 1.16 GB

Model class
Granite4VisionForConditionalGeneration
Model type
granite4_vision_text
Layers
40
Hidden size
2560
Attention heads
40
Key/value heads
8
Vocabulary
100,352
Context length
131,072 tokens
Weights
bfloat16
Vision encoder
Included (vision_config)

Papers the model's Hugging Face page links to (the model's own report and papers it cites).

Datasets listed in the model card

Granite-Vision-5.0-4B

Model Summary: Granite Vision 5.0 4B is a compact vision-language model (VLM) for visual document understanding. It extracts data from charts, converts complex tables into structured formats, captures fields from forms and invoices, and describes images, figures and diagrams. It is designed to complement document converters such as Docling: the converter parses the page, and Granite Vision enriches the result by extracting and summarizing the complex visual elements inside it.

Granite Vision 5.0 is released together with two related models: Granite Docling v2 (2B, 500M), which converts full document pages (text, layout, reading order, formulas and tables), and Granite Embedding Vision, which makes documents searchable across text and images. Granite Docling v2 converts the document, Granite Vision extracts the data in its charts, tables and forms, and Granite Embedding Vision finds the right content.

What it does:

  • Charts: extracts the underlying data as CSV, writes a summary, or generates Python code that recreates the chart. For multi-panel figures, it extracts each panel's data and summarizes the whole figure. Chart extraction supports 12 languages.
  • Complex tables: converts cropped tables, including merged cells and complex layouts, to HTML or OTSL.
  • Forms and key-value pairs: extracts the fields defined by a JSON schema from invoices, receipts, forms and other documents.
  • Images and figures: describes and summarizes pictures, diagrams and photos, and can answer simple questions about document images.

The model can also extract UI elements (bounding box, class and text) from screenshots of web and desktop applications.

What's new in 5.0:

  • Higher accuracy on chart and KVP extraction, and on par or slightly better on cropped tables, from reworked training data and a new GRPO post-training stage with task-specific rewards.
  • Multi-panel charts (new): extracts data and summaries from figures with several charts.
  • Multilingual charts and tables (new): charts in 12 languages, and tables in Chinese and Japanese.

The model uses the same architecture as Granite Vision 4.1 4B and supports all of its tasks with the same prompts, so existing workflows carry over with almost no changes. The one exception is JSON table output (<tables_json>), which 5.0 drops in favor of the more compact HTML (<tables_html>) and OTSL (<tables_otsl>) formats.

Chart and table tasks are activated by a short task tag (<chart2csv>, <chart2summary>, <chart2code>, <tables_html>, <tables_otsl>) that the chat template expands into the full prompt; the other tasks use plain prompts (see the usage examples).

The language model is initialized from Granite-4.1-3B and the vision encoder from SigLIP2. The model has a 3.4B LLM and 0.6B of vision encoder and projectors. See Model Architecture for details.

Model Performance

We compare Granite Vision 5.0 against open models from 4B to 24B parameters (including Granite Vision 4.1) and frontier models. Every model runs with the same evaluation code and prompts.

The average covers 11 benchmarks: PubTables-v2 (cropped and full page), TableVQA-Extract (cropped), Chart2CSV, Chart2Summary and Chart2Code on ChartNet, Chart2CSV on Chinese and Japanese ChartNet, MultiChart2CSV and MultiChart2Summary on multi-panel figures, and VAREX. Tables and the CSV tasks are scored with TEDS, the summary and code tasks with an LLM judge, and VAREX with exact match.

Per-benchmark results for every model are in the collapsed sections below (click to expand), and in an interactive chart in the blog post.

Chart Extraction

Evaluated on the human-verified test set of ChartNet. Chart2CSV is scored with TEDS between the predicted and reference data tables. Chart2Summary and Chart2Code are scored by an LLM judge (GPT-4o), which sees the chart image, the reference and the prediction, and scores the prediction from 0 to 100: for Chart2Summary, coverage of the key elements, faithfulness to the visual, correctness and numeric accuracy; for Chart2Code, data correctness, chart type and structure, visual styling and code quality.

Multilingual Charts

Chart2CSV (TEDS) on 500 Chinese and 500 Japanese charts from ChartNet. The model also supports charts in the other 10 languages, which are not benchmarked here.

Multi-Panel Charts

MultiChart2CSV and MultiChart2Summary on 100 multi-panel figures from the ChartNet multi-chart test set. MultiChart2CSV asks for one CSV table per panel (see the example) and is scored with TEDS; MultiChart2Summary is scored by the same LLM judge as Chart2Summary.

Table Extraction

Granite Vision is most useful on tables that a standard document parser struggles with, such as tables with complex layouts or merged cells. Cropped tables, for example tables detected by a document converter, can be sent to Granite Vision with <tables_html> or <tables_otsl>. Tables are scored with TEDS on cropped tables from PubTables-v2 and TableVQA-Extract. The PubTables-v2 full-page and multi-page results show robustness when a table comes with surrounding page content; for full-page conversion, use Granite Docling v2.

Frontier models were evaluated on a 500-sample subset of PubTables-v2 (cropped and full page; the first 500 of 7,680 samples) and are marked with *. All other models use the full test set.

KVP Extraction

KVP extraction is scored on VAREX: normalized exact match per extracted field, averaged over all fields.

Setup

Tested with python=3.11

pip install torch==2.10.0 --index-url https://download.pytorch.org/whl/cu128
pip install "transformers>=5.8.1" accelerate tokenizers pillow pandas lxml

Requires transformers>=5.8.1. pandas and lxml are only used by the display_table helper in the examples below.

Usage with Transformers

import re
from io import StringIO

import pandas as pd
import torch
from transformers import AutoProcessor, AutoModelForImageTextToText
from PIL import Image
from huggingface_hub import hf_hub_download

model_id = "ibm-granite/granite-vision-5.0-4b"
device = "cuda" if torch.cuda.is_available() else "cpu"

processor = AutoProcessor.from_pretrained(model_id)
processor.tokenizer.padding_side = "left"  # required for correct batched generation
model = AutoModelForImageTextToText.from_pretrained(
    model_id,
    dtype=torch.bfloat16,
    device_map=device
).eval()


def run_inference(model, processor, images, prompts):
    """Run batched inference on image+prompt pairs (one image per prompt)."""
    conversations = [
        [{"role": "user", "content": [
            {"type": "image"},
            {"type": "text", "text": prompt},
        ]}]
        for prompt in prompts
    ]
    texts = [
        processor.apply_chat_template(conv, tokenize=False, add_generation_prompt=True)
        for conv in conversations
    ]
    inputs = processor(
        text=texts, images=images, return_tensors="pt", padding=True, do_pad=True
    ).to(model.device)
    outputs = model.generate(
        **inputs,
        max_new_tokens=4096,
        use_cache=True
    )
    results = []
    for i in range(len(prompts)):
        gen = outputs[i, inputs["input_ids"].shape[1]:]
        results.append(processor.decode(gen, skip_special_tokens=True))
    return results


def display_table(text):
    """Pretty-print CSV (possibly wrapped in ```csv```) or HTML table content via pandas."""
    m = re.search(r"```csv\s*\n(.*?)```", text, re.DOTALL)
    if m:
        df = pd.read_csv(StringIO(m.group(1)))
        print(df.to_string(index=False))
    elif "<table" in text.lower():
        df = pd.read_html(StringIO(text))[0]
        print(df.to_string(index=False))
    else:
        print(text)

Chart and Table Tasks

You can pass tags and the chat template handles the rest:

chart_path = hf_hub_download(repo_id=model_id, filename="examples/chart.jpg")
table_path = hf_hub_download(repo_id=model_id, filename="examples/table.png")
chart_img = Image.open(chart_path).convert("RGB")
table_img = Image.open(table_path).convert("RGB")

# Batched chart tasks
chart_prompts = ["<chart2csv>", "<chart2summary>", "<chart2code>"]
chart_results = run_inference(model, processor, [chart_img] * len(chart_prompts), chart_prompts)
for prompt, result in zip(chart_prompts, chart_results):
    print(f"{prompt}:")
    display_table(result)
    print()

# Batched table tasks
table_prompts = ["<tables_html>", "<tables_otsl>"]
table_results = run_inference(model, processor, [table_img] * len(table_prompts), table_prompts)
for prompt, result in zip(table_prompts, table_results):
    print(f"{prompt}:")
    display_table(result)
    print()

Multi-Panel Chart Extraction

For figures with several charts, ask for one CSV table per panel, or for a summary of the whole figure. The CSV prompt below asks for a # Panel N: <title> line before each panel's table, which makes the output easy to split.

figure_path = hf_hub_download(repo_id=model_id, filename="examples/multi_panel.png")
figure_img = Image.open(figure_path).convert("RGB")
prompts = [
    'Convert each chart in the image into CSV. Output one ```csv block, and start each chart\'s table with a line "# Panel N: <title>".',
    "Summarize this multi-panel figure.",
]
for prompt, result in zip(prompts, run_inference(model, processor, [figure_img] * len(prompts), prompts)):
    print(f"{prompt}\n{result}\n")

Key-Value Pair Extraction (KVP)

For KVP extraction use the VAREX prompt format. Provide a JSON Schema describing the fields to extract and the model will return a JSON object with the extracted values.

import json

invoice_path = hf_hub_download(repo_id=model_id, filename="examples/invoice.png")
invoice_img = Image.open(invoice_path).convert("RGB")
schema = {
    "type": "object",
    "properties": {
        "invoice_date": {"type": "string", "description": "The date the invoice was issued"},
        "order_number": {"type": "string", "description": "The unique identifier for the order"},
        "seller_tax_id": {"type": "string", "description": "The tax identification number of the seller"},
    }
}

prompt = f"""Extract structured data from this document.
Return a JSON object matching this schema:

{json.dumps(schema, indent=2)}

Return null for fields you cannot find.
Return ONLY valid JSON.
Return an instance of the JSON with extracted values, not the schema itself."""

result = run_inference(model, processor, [invoice_img], [prompt])[0]
print(result)

Image Description and Document Questions

For a general description of an image, or a question about a document, use a plain prompt:

prompts = [
    "Describe this image.",
    "What is the total amount due on this invoice?",
]
for prompt, result in zip(prompts, run_inference(model, processor, [invoice_img] * len(prompts), prompts)):
    print(f"{prompt}\n{result}\n")

Usage with vLLM

Granite Vision 5.0 is supported natively in vLLM (tested with vLLM 0.32):

pip install "vllm>=0.32"

Serving

vllm serve ibm-granite/granite-vision-5.0-4b --host 0.0.0.0 --port 8000

Client example

Query the running server using the OpenAI-compatible API:

import base64
import mimetypes
from openai import OpenAI
from huggingface_hub import hf_hub_download

model_id = "ibm-granite/granite-vision-5.0-4b"
client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")

def run_inference(client, model_id, image_path, tag):
    with open(image_path, "rb") as f:
        image_b64 = base64.b64encode(f.read()).decode("utf-8")
    mime_type = mimetypes.guess_type(image_path)[0] or "image/png"
    messages = [
        {"role": "user", "content": [
            {"type": "image_url", "image_url": {"url": f"data:{mime_type};base64,{image_b64}"}},
            {"type": "text", "text": tag},
        ]}
    ]
    response = client.chat.completions.create(
        model=model_id, messages=messages, max_tokens=4096, temperature=0,
    )
    return response.choices[0].message.content

chart_path = hf_hub_download(repo_id=model_id, filename="examples/chart.jpg")
for tag in ["<chart2csv>", "<chart2summary>"]:
    print(f"{tag}:\n{run_inference(client, model_id, chart_path, tag)}\n")

The same tags and prompts as in the Transformers examples work here.

Usage with MLX VLM

MLX VLM runs Granite Vision 5.0 4B natively on Apple Silicon via the MLX framework.

Setup

Install from source for the latest features:

pip install git+https://github.com/Blaizzy/mlx-vlm.git

CLI

mlx_vlm generate \
         --model ibm-granite/granite-vision-5.0-4b \
         --image https://huggingface.co/ibm-granite/granite-vision-5.0-4b/resolve/main/examples/chart.jpg \
         --prompt "<chart2csv>" \
         --max-tokens 4096 \
         --temperature 0

Usage with Docling

Docling can use Granite Vision 5.0 inside its standard PDF conversion pipeline. Docling's layout model finds the pictures on each page, and its classifier picks out the bar, line and pie charts. Granite Vision then writes a summary of each chart (<chart2summary>), or extracts its data (<chart2csv>). In the example below, Docling sends the charts to a Granite Vision vLLM server. Tables are handled by Docling's default table model.

Setup

pip install "docling>=2.151.0"
vllm serve ibm-granite/granite-vision-5.0-4b --host 0.0.0.0 --port 8000  # see "Usage with vLLM"

Example

from docling.datamodel.base_models import InputFormat
from docling.datamodel.chart_extraction_options import ChartExtractionVlmEngineOptions
from docling.datamodel.pipeline_options import PdfPipelineOptions
from docling.datamodel.vlm_engine_options import ApiVlmEngineOptions, VlmEngineType
from docling.document_converter import DocumentConverter, PdfFormatOption

pipeline_options = PdfPipelineOptions(do_chart_extraction=True, enable_remote_services=True)
pipeline_options.chart_extraction_options = ChartExtractionVlmEngineOptions.from_preset(
    "granite_vision_v4",
    chart2summary=True,
    chart2csv=False,
    engine_options=ApiVlmEngineOptions(
        engine_type=VlmEngineType.API_OPENAI,
        url="http://localhost:8000/v1/chat/completions",
        params={"model": "ibm-granite/granite-vision-5.0-4b"},  # must match the served model name
        concurrency=4,
    ),
)
converter = DocumentConverter(
    format_options={InputFormat.PDF: PdfFormatOption(pipeline_options=pipeline_options)}
)

doc = converter.convert("https://arxiv.org/pdf/2603.11243").document  # local path or URL

# The chart summaries are part of the markdown export...
print(doc.export_to_markdown())

# ...or can be read per picture
for picture in doc.pictures:
    if picture.meta is not None and picture.meta.description is not None:
        print(picture.meta.description.text)

Notes:

  • granite_vision_v4 is the name of Docling's Granite Vision chart preset; it works with Granite Vision 5.0. params={"model": ...} must match the name the vLLM server serves, otherwise the conversion finishes without chart output (Docling only logs the errors).
  • Use Docling 2.151.0 or newer, which sends chart crops at 288 dpi; at lower resolution chart values come out wrong. For the same reason, don't set generate_picture_images=True unless you also set images_scale=4.0.
  • For chart data instead of summaries, set chart2csv=True (result in picture.meta.tabular_chart); chart-to-code is chart2code=True (result in picture.meta.code). Docling's local (transformers) chart mode and its Granite Vision table stage still load Granite Vision 4.1, so use a server as shown above.
  • More examples: chart extraction, picture description.

Training

Granite Vision 5.0 is trained in three stages:

  1. Pretraining / alignment: starts from the Granite-4.1-3B language model and the SigLIP2 vision encoder, and trains the vision-to-LLM projectors and injection layers.
  2. Supervised fine-tuning (SFT) on the expanded data mix described below. The vision encoder and the LLM are adapted with LoRA, and the projectors and injection layers are fully trained.
  3. GRPO post-training with task-specific rewards. See GRPO Post-Training.

Training Data

The model was trained on a curated mixture of chart, table and document KVP extraction data, supplemented by the general-purpose Granite Vision instruction-following dataset.

Compared with Granite Vision 4.1, the data was reworked as follows:

  • Better instruction following: ambiguous prompts were rewritten to state the expected output, and output conventions such as the bounding-box format are varied across samples and specified in the prompt. This makes the model more reliable at following the output format you ask for.
  • Cleaner data: we audited every source, fixed or removed low-quality samples and inconsistent targets, and removed duplicates across public instruction collections.
  • Image augmentations: mild, answer-preserving augmentations (rescaling, blur, resampling, JPEG compression, noise, brightness and contrast) improve robustness to real scans and screenshots. There is no cropping, so coordinates in the targets stay valid.

Chart data comes from ChartNet, our million-scale dataset built with a code-guided augmentation pipeline that produces aligned rendering code, chart images, data CSVs and summaries (paper). ChartNet now has two new subsets, both used to train this model:

  • Multi-Panel Charts: figures with several subplots, for data extraction and summarization.
  • Multilingual Charts: charts translated into 11 languages besides English (about 4.2M samples).

Table data also includes about 217K Chinese and Japanese samples.

GRPO Post-Training

After SFT, we post-train the model with GRPO (Group Relative Policy Optimization). Instead of a single generic reward, we run GRPO separately for four task families, each with a reward that matches how that task is scored:

Task familyReward
Charts (Chart2CSV)GriTS between the predicted and reference data tables
TablesGriTS-Con (cell content and structure)
JSON / KVP extractionField-level match accuracy against the reference JSON
UI screensUI element-matching score, plus bounding-box F1

Each task family trains its own LoRA adapter (rank 32, on the LLM attention and MLP projections; vision encoder and projectors frozen) for 50 steps of 512 prompts, with 8 completions per prompt and a KL penalty to the SFT model; groups with no reward variance are filtered out. Each adapter takes about 12 hours on 4 GPUs. The four adapters are then merged into a single rank-128 adapter and folded into the released weights.

Impact: averaged over the table, chart and KVP benchmarks in Model Performance, the SFT model scores 86.8, up from 77.1 for Granite Vision 4.1. The gain comes from the reworked training data and from multi-panel charts, which 4.1 did not support. GRPO then adds another 0.6 points, to 87.4.

Model Architecture

  1. Vision encoder: SigLIP2 (google/siglip2-so400m-patch16-384). Images are split into 384×384 tiles plus a downscaled global view, and each tile is encoded independently.
  2. Window Q-Former projectors: compress visual features 4× by reducing each 4×4 patch window to 2×2 tokens via cross-attention, with queries initialized from a downsampled version of the window.
  3. Feature injection: a variant of DeepStack that adds visual features to the LLM hidden states at 8 layers:
    • LayerDeepstack: features from 4 vision encoder depths, each injected into a different LLM layer, in reverse order (the deepest, most semantic features feed the earliest LLM layers).
    • SpatialDeepstack: the deepest features at full resolution, split into 4 spatial groups, each injected at a separate later LLM layer for fine-grained spatial detail.
  4. Language model: Granite-4.1-3B.

The vision encoder and LLM were adapted with LoRA during training (LLM rank 256); the released checkpoint has the adapters merged.

Supported input: English prompts and PNG or JPEG images. Document content may be multilingual: the model supports chart extraction in 12 languages (English, German, Spanish, French, Japanese, Portuguese, Arabic, Czech, Italian, Korean, Dutch and Chinese) and table extraction in Chinese and Japanese. Reported evaluations cover Chinese and Japanese.

Infrastructure

Granite Vision 5.0 was trained on IBM's Blue Vela supercomputing cluster, outfitted with NVIDIA H100 GPUs. Pretraining and supervised fine-tuning ran on 32 GPUs for approximately 200 hours. The compute for GRPO post-training is listed in GRPO Post-Training.

This card is long; the rest is on Hugging Face.

More from IBM

On Hugging Face

Everything on this page comes from these pages and is refreshed every few hours; Hugging Face always has the latest.