SAVRN
Search Contact SAVRN

Open-weight model · Image and text to text

Qari-OCR-v0.3-VL-2B-Instruct

by Network for Advancing Modern ArabicNLP & AI NAMAA-Space/Qari-OCR-v0.3-VL-2B-Instruct

QARI-OCR v0.3 is a specialized vision-language model fine-tuned for Arabic Optical Character Recognition with a focus on structural document understanding.

Parameters2.2B
Context32,768
Weights4.4 GB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads30.3k

Runs On

What it takes to serve Qari-OCR-v0.3-VL-2B-Instruct (2.2B parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

PrecisionWeightsMemory neededCheapest setupPer hourAlso fits
16-bit 4.4 GB 5.3 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 2.2 GB 2.7 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 1.1 GB 1.3 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Sep 18, 2026.

Model Card

By Network for Advancing Modern ArabicNLP & AI, published under apache-2.0, revision dabe11e39901.

QARI-OCR v0.3 is a specialized vision-language model fine-tuned for Arabic Optical Character Recognition with a focus on structural document understanding. - Built on Qwen2-VL-2B-Instruct, this model excels at preserving document layouts, HTML tags, and formatting while transcribing Arabic text. - It is described in detail in the paper QARI-OCR: High-Fidelity Arabic Text Recognition through Multimodal Large Language Model Adaptation. While QARI v0.2 achieves better raw text accuracy (CER: 0.061), QARI v0.3 excels in: - HTML/Markdown structure preservation - Document layout understanding - Handwritten text recognition (initial capabilities) - 5x faster training than v0.2 You can load this…

Read Network for Advancing Modern ArabicNLP & AI's full model card

QARI-OCR v0.3: Structural Arabic Document Understanding

Model Description

Key Features

  • Layout-Aware Recognition: Preserves document structure with HTML/Markdown tags
  • Full Diacritics Support: Accurate recognition of tashkeel (Arabic diacritical marks)
  • Multi-Font Handling: Trained on 12 diverse Arabic fonts (14px-100px)
  • Structure-First Design: Optimized for documents with headers, body text, and complex layouts
  • Efficient Training: Only 11 hours on single GPU with 10k samples
  • Robust Performance: Handles low-resolution and degraded images

Model Performance

Metric Score
Character Error Rate (CER) 0.300
Word Error Rate (WER) 0.485
BLEU Score 0.545
Training Time 11 hours
CO₂ Emissions 1.88 kg eq.

Comparative Strengths

While QARI v0.2 achieves better raw text accuracy (CER: 0.061), QARI v0.3 excels in: -HTML/Markdown structure preservation -Document layout understanding -Handwritten text recognition(initial capabilities) -5x faster training than v0.2

How to Use

Try Qari - Google Colab

You can load this model using the transformers and qwen_vl_utils library:

!pip install transformers qwen_vl_utils accelerate>=0.26.0 PEFT -U
!pip install -U bitsandbytes
from PIL import Image
from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
import torch
import os
from qwen_vl_utils import process_vision_info



model_name = "NAMAA-Space/Qari-OCR-v0.3-VL-2B-Instruct"
model = Qwen2VLForConditionalGeneration.from_pretrained(
                model_name,
                torch_dtype="auto",
                device_map="auto"
            )
processor = AutoProcessor.from_pretrained(model_name)
max_tokens = 2000

prompt = "Below is the image of one page of a document, as well as some raw textual content that was previously extracted for it. Just return the plain text representation of this document as if you were reading it naturally. Do not hallucinate."
image.save("image.png")

messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "image": f"file://{src}"},
            {"type": "text", "text": prompt},
        ],
    }
]
text = processor.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True
)
image_inputs, video_inputs = process_vision_info(messages)
inputs = processor(
    text=[text],
    images=image_inputs,
    videos=video_inputs,
    padding=True,
    return_tensors="pt",
)
inputs = inputs.to("cuda")
generated_ids = model.generate(**inputs, max_new_tokens=max_tokens)
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
)[0]
os.remove(src)
print(output_text)

Try the model on Google Colab, Notebook

Training Details

  • Base Model: Qwen2-VL-2B-Instruct
  • Training Data: 10,000 synthetic Arabic documents with HTML markup
  • Optimization: 4-bit LoRA adapters (rank=16)
  • Hardware: Single NVIDIA A6000 GPU (48GB)
  • Framework: Unsloth + Hugging Face TRL

BibTeX:

@article{wasfy2025qari,
  title={QARI-OCR: High-Fidelity Arabic Text Recognition through Multimodal Large Language Model Adaptation},
  author={Wasfy, Ahmed and Nacar, Omer and Elkhateb, Abdelakreem and Reda, Mahmoud and Elshehy, Omar and Ammar, Adel and Boulila, Wadii},
  journal={arXiv preprint arXiv:2506.02295},
  year={2025}
}

Configuration

Architecture
Qwen2VLForConditionalGeneration
Context length (tokens)
32,768
Layers
28
Hidden size
1,536
Feed-forward size
8,960
Attention heads
12
Key/value heads
2
Vocabulary size
151,936
Sliding window (tokens)
32,768
RoPE base
1e+06
Stored precision
float16
Model type
qwen2_vl

Identity and Version

Repository
NAMAA-Space/Qari-OCR-v0.3-VL-2B-Instruct
Publisher
Network for Advancing Modern ArabicNLP & AI
Task
Image and text to text
Modality
Image and text
Library
transformers
Parameters
2.2B parameters
Languages
ar
Revision
dabe11e3990176858b26eacfef3ee16fff1d5970
First published
2025-04-10
Last updated
2025-06-10

Files and Weights

13 files, 4.4 GB in total. The weights are 1 file totalling 4.4 GB in safetensors.

Weights1 file · 4.4 GB
Configuration6 files · 4.0 KB
Tokenizer4 files · 15.9 MB
Documentation1 file · 4.7 KB
Repository1 file · 1.6 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights4.4 GB 45122cde2b18
added_tokens.jsonConfiguration392 B
chat_template.jsonConfiguration1.0 KB
config.jsonConfiguration1.2 KB
generation_config.jsonConfiguration215 B
preprocessor_config.jsonConfiguration572 B
special_tokens_map.jsonConfiguration613 B
README.mdDocumentation4.7 KB
.gitattributesRepository1.6 KB
merges.txtTokenizer1.7 MB
tokenizer.jsonTokenizer11.4 MB 091aa7594dc2
tokenizer_config.jsonTokenizer4.3 KB
vocab.jsonTokenizer2.8 MB

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
4.4 GB
Download from Network for Advancing Modern ArabicNLP & AI

Released by Network for Advancing Modern ArabicNLP & AI through its official repository on Hugging Face. Read the license.

Built From

  • Described by arXiv:2506.02295
  • Trained on (disclosed) NAMAA-Space/QariOCR-v0.3-markdown-mixed-dataset

Memory Requirements

PrecisionWeights in memory
As published4.4 GB
16-bit4.4 GB
8-bit2.2 GB
4-bit1.1 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About Qari-OCR-v0.3-VL-2B-Instruct

How much GPU memory does Qari-OCR-v0.3-VL-2B-Instruct need?

About 5.3 GB at 16-bit and 1.3 GB at 4-bit: the weights (2.2B parameters) plus a working margin. A long context needs more.

What is the cheapest GPU to run Qari-OCR-v0.3-VL-2B-Instruct on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

Can I use Qari-OCR-v0.3-VL-2B-Instruct commercially?

Yes. Qari-OCR-v0.3-VL-2B-Instruct is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

What is Qari-OCR-v0.3-VL-2B-Instruct's context length?

32,768 tokens, from the maximum position embeddings in its published configuration.

Similar Models

Model · Image and text to text

Qwen2-VL-2B-Instruct

Qwen

We're excited to unveil Qwen2-VL, the latest iteration of our Qwen-VL model, representing nearly a year of innovation. SoTA understanding of images of various resolution & ratio: Qwen2-VL achieves state-of-the-art performance on visual understanding benchmarks, including MathVista, DocVQA, RealWorldQA, MTVQA, etc. Understanding videos of 20min+: Qwen2-VL can understand videos over 20 minutes for high-quality video-based question answering, dialog, content creation, etc. Agent that can operate your mobiles, robots, etc.: with the abilities of complex reasoning and decision making, Qwen2-VL can be integrated with devices like mobile phones, robots, etc., for automatic operation based on…

Open weights apache-2.0 2.2B parameters 32,768 tokens transformers

Model · Image and text to text

Qwen3.5-2B

Qwen

Over recent months, we have intensified our focus on developing foundation models that deliver exceptional utility and performance. Qwen3.5 represents a significant leap forward, integrating breakthroughs in multimodal learning, architectural efficiency, reinforcement learning scale, and global accessibility to empower developers and enterprises with unprecedented capability and efficiency. For more details, please refer to our blog post Qwen3.5. WMT24++: a harder subset of WMT24 after difficulty labeling and rebalancing; we report the averaged scores on 55 languages using XCOMET-XXL. Empty cells (--) indicate scores not yet available or not applicable. Scores of Qwen3.5 models are reported…

Open weights apache-2.0 2.3B parameters 262,144 tokens transformers

Model · Image and text to text

Rax-4.5

RaxCore

Over recent months, we have intensified our focus on developing foundation models that deliver exceptional utility and performance. Rax 4.5 represents a significant leap forward, integrating breakthroughs in multimodal learning, architectural efficiency, reinforcement learning scale, and global accessibility to empower developers and enterprises with unprecedented capability and efficiency. Rax 4.5 features the following enhancement: For more details, please refer to our blog post Rax 4.5. WMT24++: a harder subset of WMT24 after difficulty labeling and rebalancing; we report the averaged scores on 55 languages using XCOMET-XXL. Empty cells (--) indicate scores not yet available or not…

Open weights apache-2.0 2.3B parameters 262,144 tokens transformers

Model · Image and text to text

Qwen3.5-2B-auto-optimized

Islam Assanov

This is Qwen3.5-2B auto-optimized by Claude Fable for fast single-request text generation. Fable built and tuned the included qwen35fast inference engine while keeping Qwen's original BF16 weights unchanged. Across 12 development workloads, the Fable engine delivered 14× the decode speed of Transformers eager and 1.02× the speed of vLLM with MTP (geometric means). On 12 held-out workloads, it reached 528–866 tokens/s and 1.01× vLLM with MTP. Use Python 3.12 and an NVIDIA CUDA GPU. Download the model and install its dependencies: The original checkpoint also works with Transformers for Qwen's standard text and vision-language workflows; the speed figures above use qwen35fast. - Captured the…

Open weights apache-2.0 2.3B parameters 262,144 tokens transformers

Model · Image and text to text

Qwen3-VL-2B-Instruct

Qwen

Meet Qwen3-VL — the most powerful vision-language model in the Qwen series to date. This generation delivers comprehensive upgrades across the board: superior text understanding & generation, deeper visual perception & reasoning, extended context length, enhanced spatial and video dynamics comprehension, and stronger agent interaction capabilities. Available in Dense and MoE architectures that scale from edge to cloud, with Instruct and reasoning‑enhanced Thinking editions for flexible, on‑demand deployment. Text Understanding on par with pure LLMs: Seamless text–vision fusion for lossless, unified comprehension. 1. Interleaved-MRoPE: Full‑frequency allocation over time, width, and height…

Open weights apache-2.0 2.1B parameters 262,144 tokens transformers