allenai / olmOCR-7B-0225-preview

huggingface.co
Total runs: 8.2K
24-hour runs: 0
7-day runs: 295
30-day runs: -15.5K
Model's Last Updated: August 19 2025
image-text-to-text

Introduction of olmOCR-7B-0225-preview

Model Details of olmOCR-7B-0225-preview

olmOCR Logo

olmOCR-7B-0225-preview

This is a preview release of the olmOCR model that's fine tuned from Qwen2-VL-7B-Instruct using the olmOCR-mix-0225 dataset.

Quick links:

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

Usage

This model expects as input a single document image, rendered such that the longest dimension is 1024 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

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, Qwen2VLForConditionalGeneration

from olmocr.data.renderpdf import render_pdf_to_base64png
from olmocr.prompts import build_finetuning_prompt
from olmocr.prompts.anchor import get_anchor_text

# Initialize the model
model = Qwen2VLForConditionalGeneration.from_pretrained("allenai/olmOCR-7B-0225-preview", torch_dtype=torch.bfloat16).eval()
processor = AutoProcessor.from_pretrained("Qwen/Qwen2-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://molmo.allenai.org/paper.pdf", "./paper.pdf")

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

# Build the prompt, using document metadata
anchor_text = get_anchor_text("./paper.pdf", 1, pdf_engine="pdfreport", target_length=4000)
prompt = build_finetuning_prompt(anchor_text)

# Build the full prompt
messages = [
            {
                "role": "user",
                "content": [
                    {"type": "text", "text": 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.8,
            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)
# ['{"primary_language":"en","is_rotation_valid":true,"rotation_correction":0,"is_table":false,"is_diagram":false,"natural_text":"Molmo and PixMo:\\nOpen Weights and Open Data\\nfor State-of-the']
License and use

olmOCR is licensed under the Apache 2.0 license. olmOCR is intended for research and educational use. For more information, please see our Responsible Use Guidelines .

Runs of allenai olmOCR-7B-0225-preview on huggingface.co

8.2K
Total runs
0
24-hour runs
-21
3-day runs
295
7-day runs
-15.5K
30-day runs

More Information About olmOCR-7B-0225-preview huggingface.co Model

More olmOCR-7B-0225-preview license Visit here:

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

olmOCR-7B-0225-preview huggingface.co

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

olmOCR-7B-0225-preview huggingface.co Url

https://huggingface.co/allenai/olmOCR-7B-0225-preview

allenai olmOCR-7B-0225-preview online free

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

allenai olmOCR-7B-0225-preview online free url in huggingface.co:

https://huggingface.co/allenai/olmOCR-7B-0225-preview

olmOCR-7B-0225-preview install

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

olmOCR-7B-0225-preview install url in huggingface.co:

https://huggingface.co/allenai/olmOCR-7B-0225-preview

Url of olmOCR-7B-0225-preview

olmOCR-7B-0225-preview huggingface.co Url

Provider of olmOCR-7B-0225-preview huggingface.co

allenai
ORGANIZATIONS

Other API from allenai

huggingface.co

Total runs: 940.2K
Run Growth: -124.2K
Growth Rate: -13.21%
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: 82.7K
Run Growth: -120.8K
Growth Rate: -146.03%
Updated:July 28 2025
huggingface.co

Total runs: 48.3K
Run Growth: -45.3K
Growth Rate: -93.93%
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: 27.7K
Run Growth: 4.2K
Growth Rate: 15.02%
Updated:May 21 2026
huggingface.co

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

Total runs: 15.0K
Run Growth: -2.3K
Growth Rate: -15.05%
Updated:May 23 2026
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.7K
Run Growth: -1.5K
Growth Rate: -39.41%
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: 1.8K
Growth Rate: 91.41%
Updated:October 04 2026
huggingface.co

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

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

Total runs: 1.9K
Run Growth: 1.2K
Growth Rate: 65.68%
Updated:October 07 2026
huggingface.co

Total runs: 1.8K
Run Growth: -1.8K
Growth Rate: -100.22%
Updated:June 23 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