TL;DR: The rise of powerful vision-language models has transformed document AI. OCR models convert them into machine-readable text that comes in many different formats like HTML, Markdown and more. Different OCR models have different output formats. OCR models can either take in images and an optional text prompt, this depends on the model architecture and the pre-training setup.
TL;DR: The rise of powerful vision-language models has transformed document AI. Each model comes with unique strengths, making it tricky to choose the right one. Open-weight models offer better cost efficiency and privacy. To help you get started with them, we’ve put together this guide.
By the end, you’ll know how to choose the right OCR model, start building with it, and gain deeper insights into document AI. Let’s go!
Optical Character Recognition (OCR) is one of the earliest and longest running challenges in computer vision. Many of AI’s first practical applications focused on turning printed text into digital form.
OCR models can either take in images and an optional text prompt, this depends on the model architecture and the pre-training setup. Some OCR models support prompt-based task switching, e.g. granite-docling can parse an entire page with the prompt “Convert this page to Docling” while it can also take prompts like “Convert this formula to LaTeX” along with a page full of formulas. Other models, however, are trained only for parsing entire pages, and they are conditioned to do this through a system prompt. For instance, OlmOCR by AllenAI takes a long conditioning prompt. Like many others, OlmOCR is technically an OCR fine-tuned version of a VLM (Qwen2.5VL in this case), so you can prompt for other tasks, but its performance will not be on par with the OCR capabilities.
Most OCR models are small, having between 3B and 7B parameters; you can even find models with fewer than 1B parameters, like PaddleOCR-VL. However, the cost also depends on the availability of optimized implementations for specialized inference frameworks. For example, OlmOCR-2 comes with vLLM and SGLang implementations, and the cost per million pages is 178 dollars (assuming on H100 for $2.69/hour). DeepSeek-OCR can process 200k+ pages per day on a single A100 with 40GB VRAM. With napkin math, we see that the cost per million pages is more or less similar to OlmOCR (although it depends on your A100 provider). If your use case remains unaffected, you can also opt for quantized versions of the models. The cost of running open-source models heavily depends on the hourly cost of the instance and the optimizations the model includes, but it’s guaranteed to be cheaper than many closed-source models out there on a larger scale.
Recent models transcribe texts into a machine-readable format. The input can include:
Models use different machine-readable output formats, such as DocTags , HTML or Markdown (explained in the next section Output Formats ). The way a model handles tables and charts often depends on the output format they are using. Some models treat charts like images: they are kept as is. Other models convert charts into markdown tables or JSON, e.g., a bar chart can be converted as follows.
Similarly for tables, cells are converted into a machine-readable format while retaining context from headings and columns.
With the surge of vision-language models (VLMs), OCR has advanced significantly. Recently, many OCR models have been developed by fine-tuning existing VLMs. But today’s capabilities extend far beyond OCR: you can retrieve documents by query or answer questions about them directly. Thanks to stronger vision features, these models can also handle low-quality scans, interpret complex elements like tables, charts, and images, and fuse text with visuals to answer open-ended questions across documents.
OCR models convert them into machine-readable text that comes in many different formats like HTML, Markdown and more.
Some models know where images are inside the document, extract their coordinates, and insert them appropriately between texts. Other models generate captions for images and insert them where they appear. This is especially useful if you are feeding the machine-readable output into an LLM. Example models are OlmOCR by AllenAI , or PaddleOCR-VL by PaddlePaddle .
Supercharge your OCR Pipelines with Open Models. Covered by Hugging Face on October 21, 2025.