allenai / olmOCR-2-7B-1025

huggingface.co
Total runs: 82.6K
24-hour runs: 0
7-day runs: 0
30-day runs: -105.8K
Model's Last Updated: October 22 2025
image-text-to-text

Introduction of olmOCR-2-7B-1025

Model Details of olmOCR-2-7B-1025

olmOCR Logo

olmOCR-2-7B-1025

Full BF16 version of olmOCR-2-7B-1025-FP8 . We recommend using the FP8 version for all practical purposes except further fine tuning.

This is a release of the olmOCR model that's fine tuned from Qwen2.5-VL-7B-Instruct using the olmOCR-mix-1025 dataset. It has been additionally fine tuned using GRPO RL training to boost its performance at math equations, tables, and other tricky OCR cases.

Quick links:

The best way to use this model is via the olmOCR toolkit . The toolkit comes with an efficient inference setup via VLLM that can handle millions of documents at scale.

olmOCR-Bench Scores

This model scores the following scores on olmOCR-bench when used with the olmOCR toolkit toolkit which automatically renders, rotates, and retries pages as needed.

Model ArXiv Old Scans Math Tables Old Scans Headers and Footers Multi column Long tiny text Base Overall
olmOCR pipeline v0.4.0 with olmOCR-2-7B-1025 82.9 82.1 84.3 48.3 95.7 84.3 81.4 99.7 82.3 ± 1.1
olmOCR pipeline v0.4.0 with olmOCR-2-7B-1025-FP8 83.0 82.3 84.9 47.7 96.1 83.7 81.9 99.7 82.4 ± 1.1
Usage

This model expects as input a single document image, rendered such that the longest dimension is 1288 pixels.

The prompt must then contain the additional metadata from the document, and the easiest way to generate this is to use the methods provided by the olmOCR toolkit .

Manual Prompting

If you want to prompt this model manually instead of using the olmOCR toolkit , please see the code below.

In normal usage, the olmOCR toolkit builds the prompt by rendering the PDF page, and extracting relevant text blocks and image metadata. To duplicate that you will need to

pip install olmocr>=0.4.0

and then run the following sample code.

import torch
import base64
import urllib.request

from io import BytesIO
from PIL import Image
from transformers import AutoProcessor, Qwen2_5_VLForConditionalGeneration

from olmocr.data.renderpdf import render_pdf_to_base64png
from olmocr.prompts import build_no_anchoring_v4_yaml_prompt

# Initialize the model
model = Qwen2_5_VLForConditionalGeneration.from_pretrained("allenai/olmOCR-2-7B-1025", torch_dtype=torch.bfloat16).eval()
processor = AutoProcessor.from_pretrained("Qwen/Qwen2.5-VL-7B-Instruct")
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)

# Grab a sample PDF
urllib.request.urlretrieve("https://olmocr.allenai.org/papers/olmocr.pdf", "./paper.pdf")

# Render page 1 to an image
image_base64 = render_pdf_to_base64png("./paper.pdf", 1, target_longest_image_dim=1288)


# Build the full prompt
messages = [
            {
                "role": "user",
                "content": [
                    {"type": "text", "text": build_no_anchoring_v4_yaml_prompt()},
                    {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{image_base64}"}},
                ],
            }
        ]

# Apply the chat template and processor
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
main_image = Image.open(BytesIO(base64.b64decode(image_base64)))

inputs = processor(
    text=[text],
    images=[main_image],
    padding=True,
    return_tensors="pt",
)
inputs = {key: value.to(device) for (key, value) in inputs.items()}


# Generate the output
output = model.generate(
            **inputs,
            temperature=0.1,
            max_new_tokens=50,
            num_return_sequences=1,
            do_sample=True,
        )

# Decode the output
prompt_length = inputs["input_ids"].shape[1]
new_tokens = output[:, prompt_length:]
text_output = processor.tokenizer.batch_decode(
    new_tokens, skip_special_tokens=True
)

print(text_output)
# ['---\nprimary_language: en\nis_rotation_valid: True\nrotation_correction: 0\nis_table: False\nis_diagram: False\n---\nolmOCR: Unlocking Trillions of Tokens in PDFs with Vision Language Models\n\nJake Poz']
License and use

This model is licensed under Apache 2.0. It is intended for research and educational use in accordance with Ai2's Responsible Use Guidelines .

Runs of allenai olmOCR-2-7B-1025 on huggingface.co

82.6K
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
-105.8K
30-day runs

More Information About olmOCR-2-7B-1025 huggingface.co Model

More olmOCR-2-7B-1025 license Visit here:

https://choosealicense.com/licenses/apache-2.0

olmOCR-2-7B-1025 huggingface.co

olmOCR-2-7B-1025 huggingface.co is an AI model on huggingface.co that provides olmOCR-2-7B-1025's model effect (), which can be used instantly with this allenai olmOCR-2-7B-1025 model. huggingface.co supports a free trial of the olmOCR-2-7B-1025 model, and also provides paid use of the olmOCR-2-7B-1025. Support call olmOCR-2-7B-1025 model through api, including Node.js, Python, http.

olmOCR-2-7B-1025 huggingface.co Url

https://huggingface.co/allenai/olmOCR-2-7B-1025

allenai olmOCR-2-7B-1025 online free

olmOCR-2-7B-1025 huggingface.co is an online trial and call api platform, which integrates olmOCR-2-7B-1025's modeling effects, including api services, and provides a free online trial of olmOCR-2-7B-1025, you can try olmOCR-2-7B-1025 online for free by clicking the link below.

allenai olmOCR-2-7B-1025 online free url in huggingface.co:

https://huggingface.co/allenai/olmOCR-2-7B-1025

olmOCR-2-7B-1025 install

olmOCR-2-7B-1025 is an open source model from GitHub that offers a free installation service, and any user can find olmOCR-2-7B-1025 on GitHub to install. At the same time, huggingface.co provides the effect of olmOCR-2-7B-1025 install, users can directly use olmOCR-2-7B-1025 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

olmOCR-2-7B-1025 install url in huggingface.co:

https://huggingface.co/allenai/olmOCR-2-7B-1025

Url of olmOCR-2-7B-1025

olmOCR-2-7B-1025 huggingface.co Url

Provider of olmOCR-2-7B-1025 huggingface.co

allenai
ORGANIZATIONS

Other API from allenai

huggingface.co

Total runs: 947.2K
Run Growth: -107.9K
Growth Rate: -11.28%
Updated:December 04 2024
huggingface.co

Total runs: 361.0K
Run Growth: -430.6K
Growth Rate: -119.28%
Updated:May 29 2025
huggingface.co

Total runs: 136.2K
Run Growth: -2.6K
Growth Rate: -1.93%
Updated:January 23 2026
huggingface.co

Total runs: 100.0K
Run Growth: 37.8K
Growth Rate: 37.79%
Updated:January 23 2026
huggingface.co

Total runs: 88.2K
Run Growth: -8.2K
Growth Rate: -5.71%
Updated:July 28 2025
huggingface.co

Total runs: 48.5K
Run Growth: -44.5K
Growth Rate: -90.65%
Updated:January 23 2026
huggingface.co

Total runs: 38.2K
Run Growth: 10.4K
Growth Rate: 27.18%
Updated:August 15 2024
huggingface.co

Total runs: 26.6K
Run Growth: 1.6K
Growth Rate: 6.36%
Updated:May 21 2026
huggingface.co

Total runs: 16.7K
Run Growth: 5.1K
Growth Rate: 27.82%
Updated:May 23 2026
huggingface.co

Total runs: 16.1K
Run Growth: -4.3K
Growth Rate: -26.55%
Updated:October 18 2023
huggingface.co

Total runs: 7.2K
Run Growth: 1.3K
Growth Rate: 18.08%
Updated:April 11 2026
huggingface.co

Total runs: 4.4K
Run Growth: -1.2K
Growth Rate: -27.97%
Updated:July 17 2024
huggingface.co

Total runs: 3.9K
Run Growth: -341
Growth Rate: -8.79%
Updated:June 23 2026
huggingface.co

Total runs: 3.8K
Run Growth: -1.2K
Growth Rate: -32.23%
Updated:December 04 2024
huggingface.co

Total runs: 3.0K
Run Growth: 3.0K
Growth Rate: 100.00%
Updated:June 23 2026
huggingface.co

Total runs: 2.0K
Run Growth: -2.4K
Growth Rate: -119.11%
Updated:October 09 2025
huggingface.co

Total runs: 2.0K
Run Growth: 1000
Growth Rate: 50.92%
Updated:January 25 2023
huggingface.co

Total runs: 2.0K
Run Growth: 1.7K
Growth Rate: 90.99%
Updated:October 04 2026
huggingface.co

Total runs: 2.0K
Run Growth: -1.3K
Growth Rate: -36.05%
Updated:June 23 2026
huggingface.co

Total runs: 1.9K
Run Growth: -248
Growth Rate: -12.99%
Updated:July 17 2024
huggingface.co

Total runs: 1.8K
Run Growth: 1.1K
Growth Rate: 62.60%
Updated:October 07 2026
huggingface.co

Total runs: 1.7K
Run Growth: -390
Growth Rate: -22.47%
Updated:April 11 2026
huggingface.co

Total runs: 1.5K
Run Growth: -2.2K
Growth Rate: -144.05%
Updated:October 10 2025