Model reference · open weights
Infinity-Parser2-Flash is an open-weight language model from infly. Infinity-Parser2-Flash (BF16) weighs 4.4 GB; the smallest configuration that runs it is RTX 3060 12 GB.
For self-hosting, compare this build's requirements below with the GPU you plan to rent.
Summary of the infly/Infinity-Parser2-Flash model card, 2026-10-01
What it is
| Released by | infly |
|---|---|
| Released | 2026-02-27 |
| Parameters | 2.2B |
| VRAM | 4.4 GB for the weights |
What it runs on
| Card | Requests at once | Context max | Memory | |
|---|---|---|---|---|
| 8K each | 32K each | |||
| RTX 3060 12 GB | 36 | 11 | all 256K | 11.6 GB |
| RTX 4060 Ti 16 GB | 63 | 20 | all 256K | 15.4 GB |
| RTX 3090 24 GB | 121 | 38 | all 256K | 23.4 GB |
| RTX 4090 24 GB | 120 | 38 | all 256K | 23.4 GB |
| RTX 5090 32 GB | 175 | 55 | all 256K | 31.0 GB |
| L40S 48 GB | 268 | 84 | all 256K | 44.0 GB |
| A100 80 GB | 513 | 162 | all 256K | 78.2 GB |
| H100 80 GB | 475 | 150 | all 256K | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | 587 | 186 | all 256K | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | 684 | 216 | all 256K | 107 GB |
| H200 141 GB | 903 | 285 | all 256K | 138 GB |
| B200 180 GB | 1000+ | 371 | all 256K | 176 GB |
| Requests at once | 8K tokens each | 32K tokens each |
|---|---|---|
| 1 | 6.6 GB | 6.9 GB |
| 5 | 7.2 GB | 8.7 GB |
| 8 | 7.6 GB | 10.0 GB |
| 16 | 8.7 GB | 13.6 GB |
| 32 | 11.0 GB | 20.6 GB |
| 64 | 15.4 GB | 34.8 GB |
One card, with vLLM's small-card settings.
From the model card
💻 Github | 📊 Dataset | 📄 Paper | 🚀 Demo
We are excited to release Infinity-Parser2, our latest flagship document understanding model. We offer two distinct variants to address diverse deployment constraints: Infinity-Parser2-Pro, optimized for maximum accuracy in precision-critical tasks, achieves state-of-the-art results on olmOCR-Bench (87.6%) and ParseBench (74.3%), surpassing frontier models including DeepSeek-OCR-2, PaddleOCR-VL-1.5, and MinerU2.5. Infinity-Parser2-Flash, engineered for low-latency inference, delivers a 3.68x speedup over our previous Infinity-Parser-7B model. With significant upgrades to both our data engine and multi-task reinforcement learning approach, the model consolidates robust multi-modal parsing capabilities into a unified architecture, unlocking brand-new zero-shot capabilities across a wide range of real-world business scenarios.
Note: '*' denotes results evaluated using our internal evaluation tools. '‡' denotes results from the Gemini-3.1-Pro.
If you are looking for a minimal script to parse a single image to Markdown using the native transformers library, here is a simple snippet:
from PIL import Image
import torch
from transformers import AutoModelForImageTextToText, AutoProcessor
from qwen_vl_utils import process_vision_info
# Load the model and processor
model = AutoModelForImageTextToText.from_pretrained(
"infly/Infinity-Parser2-Pro",
torch_dtype="float16",
device_map="auto",
)
processor = AutoProcessor.from_pretrained("infly/Infinity-Parser2-Pro")
# Build the messages for the model
pil_image = Image.open("demo_data/demo.png").convert("RGB")
min_pixels = 2048 # 32 * 64
max_pixels = 16777216 # 4096 * 4096
prompt = """
- Extract layout information from the provided PDF image.
- For each layout element, output its bbox, category, and the text content within the bbox.
- Bbox format: [x1, y1, x2, y2].
- Allowed layout categories: ['header', 'title', 'text', 'figure', 'table', 'formula', 'figure_caption', 'table_caption', 'formula_caption', 'figure_footnote', 'table_footnote', 'page_footnote', 'footer'].
- Text extraction and formatting:
1) For 'figure', the text field must be an empty string.
2) For 'formula', format text as LaTeX.
3) For 'table', format text as HTML.
4) For all other categories (e.g., text, title), format text as Markdown.
- The output text must be exactly the original text from the image, with no translation or rewriting.
- Sort all layout elements in human reading order.
- Final output must be a single JSON object.
"""
messages = [
{
"role": "user",
"content": [
{
"type": "image",
"image": pil_image,
"min_pixels": min_pixels,
"max_pixels": max_pixels,
},
{"type": "text", "text": prompt},
],
}
]
chat_template_kwargs = {"enable_thinking": False}
text = processor.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True, **chat_template_kwargs
)
image_inputs, _ = process_vision_info(messages, image_patch_size=16)
inputs = processor(
text=text,
images=image_inputs,
do_resize=False,
padding=True,
return_tensors="pt",
)
# Move all tensors to the same device as the model
inputs = {
k: v.to(model.device) if isinstance(v, torch.Tensor) else v
for k, v in inputs.items()
}
# Generate the response
generated_ids = model.generate(
**inputs,
max_new_tokens=32768,
temperature=0.0,
top_p=1.0,
)
# Strip input tokens, keeping only the newly generated response
generated_ids_trimmed = [
out_ids[len(in_ids) :]
for in_ids, out_ids in zip(inputs["input_ids"], generated_ids)
]
output_text = processor.batch_decode(
generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
)
print(output_text)
For bulk processing, advanced features, or an end-to-end PDF parsing pipeline, we recommend using our infinity_parser2 wrapper.
# Create a Conda environment (Optional)
conda create -n infinity_parser2 python=3.12
conda activate infinity_parser2
# Install PyTorch (CUDA). Find the proper version at https://pytorch.org/get-Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.