OCRFlux
OCRFlux is a lightweight yet powerful multimodal toolkit that significantly advances PDF-to-Markdown conversion, excelling in complex layout handling, complicated table parsing and cross-page content merging.
Install / Use
/learn @chatdoc-com/OCRFluxREADME
OCRFlux is a multimodal large language model based toolkit for converting PDFs and images into clean, readable, plain Markdown text. It aims to push the current state-of-the-art to a significantly higher level.
Try the online demo: OCRFlux Demo
Functions: Whole file parsing
-
On each page
- Convert into text with a natural reading order, even in the presence of multi-column layouts, figures, and insets
- Support for complicated tables and equations
- Automatically removes headers and footers
-
Cross-page table/paragraph merging
- Cross-page table merging
- Cross-page paragraph merging
Key features:
-
Superior parsing quality on each page
It respectively achieves 0.095 higher (from 0.872 to 0.967), 0.109 higher (from 0.858 to 0.967) and 0.187 higher (from 0.780 to 0.967) Edit Distance Similarity (EDS) on our released benchmark OCRFlux-bench-single than the baseline model olmOCR-7B-0225-preview, Nanonets-OCR-s and MonkeyOCR.
-
Native support for cross-page table/paragraph merging (to our best this is the first to support this feature in all the open sourced project).
-
Based on a 3B parameter VLM, so it can run even on GTX 3090 GPU.
Release:
- OCRFlux-3B - 3B parameter VLM
- Benchmark for evaluation
News
- Jun 17, 2025 - v0.1.0 - Initial public launch and demo.
Benchmark for single-page parsing
We ship two comprehensive benchmarks to help measure the performance of our OCR system in single-page parsing:
-
OCRFlux-bench-single: Containing 2000 pdf pages (1000 English pages and 1000 Chinese pages) and their ground-truth Markdowns (manually labeled with multi-round check).
-
OCRFlux-pubtabnet-single: Derived from the public PubTabNet benchmark with some format transformation. It contains 9064 HTML table samples, which are split into simple tables and complex tables according to whether they have rowspan and colspan cells.
We emphasize that the released benchmarks are NOT included in our training and evaluation data. The following is the main result:
-
In OCRFlux-bench-single, we calculated the Edit Distance Similarity (EDS) between the generated Markdowns and the ground-truth Markdowns as the metric.
<table> <thead> <tr> <th>Language</th> <th>Model</th> <th>Avg EDS ↑</th> </tr> </thead> <tbody> <tr> <td rowspan="4">English</td> <td>olmOCR-7B-0225-preview</td> <td>0.885</td> </tr> <tr> <td>Nanonets-OCR-s</td> <td>0.870</td> </tr> <tr> <td>MonkeyOCR</td> <td>0.828</td> </tr> <tr> <td><strong><a href="https://huggingface.co/ChatDOC/OCRFlux-3B">OCRFlux-3B</a></strong></td> <td>0.971</td> </tr> <tr> <td rowspan="4">Chinese</td> <td>olmOCR-7B-0225-preview</td> <td>0.859</td> </tr> <tr> <td>Nanonets-OCR-s</td> <td>0.846</td> </tr> <tr> <td>MonkeyOCR</td> <td>0.731</td> </tr> <tr> <td><strong><a href="https://huggingface.co/ChatDOC/OCRFlux-3B">OCRFlux-3B</a></strong></td> <td>0.962</td> </tr> <tr> <td rowspan="4">Total</td> <td>olmOCR-7B-0225-preview</td> <td>0.872</td> </tr> <tr> <td>Nanonets-OCR-s</td> <td>0.858</td> </tr> <tr> <td>MonkeyOCR</td> <td>0.780</td> </tr> <tr> <td><strong><a href="https://huggingface.co/ChatDOC/OCRFlux-3B">OCRFlux-3B</a></strong></td> <td>0.967</td> </tr> </tbody> </table> -
In OCRFlux-pubtabnet-single, we calculated the Tree Edit Distance-based Similarity (TEDS) between the generated HTML tables and the ground-truth HTML tables as the metric.
<table> <thead> <tr> <th>Type</th> <th>Model</th> <th>Avg TEDS ↑</th> </tr> </thead> <tbody> <tr> <td rowspan="4">Simple</td> <td>olmOCR-7B-0225-preview</td> <td>0.810</td> </tr> <tr> <td>Nanonets-OCR-s</td> <td>0.882</td> </tr> <tr> <td>MonkeyOCR</td> <td>0.880</td> </tr> <tr> <td><strong><a href="https://huggingface.co/ChatDOC/OCRFlux-3B">OCRFlux-3B</a></strong></td> <td>0.912</td> </tr> <tr> <td rowspan="4">Complex</td> <td>olmOCR-7B-0225-preview</td> <td>0.676</td> </tr> <tr> <td>Nanonets-OCR-s</td> <td>0.772</td> </tr> <tr> <td><strong>MonkeyOCR<strong></td> <td>0.826</td> </tr> <tr> <td><a href="https://huggingface.co/ChatDOC/OCRFlux-3B">OCRFlux-3B</a></td> <td>0.807</td> </tr> <tr> <td rowspan="4">Total</td> <td>olmOCR-7B-0225-preview</td> <td>0.744</td> </tr> <tr> <td>Nanonets-OCR-s</td> <td>0.828</td> </tr> <tr> <td>MonkeyOCR</td> <td>0.853</td> </tr> <tr> <td><strong><a href="https://huggingface.co/ChatDOC/OCRFlux-3B">OCRFlux-3B</a></strong></td> <td>0.861</td> </tr> </tbody> </table>
We also conduct some case studies to show the superiority of our model in the blog article.
Benchmark for cross-page table/paragraph merging
PDF documents are typically paginated, which often results in tables or paragraphs being split across consecutive pages. Accurately detecting and merging such cross-page structures is crucial to avoid generating incomplete or fragmented content.
The detection task can be formulated as follows: given the Markdowns of two consecutive pages—each structured as a list of Markdown elements (e.g., paragraphs and tables)—the goal is to identify the indexes of elements that should be merged across the pages.
Then for the merging task, if the elements to be merged are paragraphs, we can just concate them. However, for two table fragments, their merging is much more challenging. For example, the table spanning multiple pages will repeat the header of the first page on the second page. Another difficult scenario is that the table cell contains long content that spans multiple lines within the cell, with the first few lines appearing on the previous page and the remaining lines continuing on the next page. We also observe some cases where tables with a large number of columns are split vertically and placed on two consecutive pages. More examples of cross-page tables can be found in our blog article. To address these issues, we develop the LLM model for cross-page table merging. Specifically, this model takes two split table fragments as input and generates a complete, well-structured table as output.
We ship two comprehensive benchmarks to help measure the performance of our OCR system in cross-page table/paragraph detection and merging tasks respectively:
-
OCRFlux-bench-cross: Containing 1000 samples (500 English samples and 500 Chinese samples), each sample contains the Markdown element lists of two consecutive pages, along with the indexes of elements that need to be merged (manually labeled through multiple rounds of review). If no tables or paragraphs require merging, the indexes in the annotation data are left empty.
-
OCRFlux-pubtabnet-cross: Containing 9064 pairs of split table fragments, along with their corresponding ground-truth merged versions.
The released benchmarks are NOT included in our training and evaluation data neither. The following is the main result:
- In OCRFlux-bench-cross, we caculated the Accuracy, Precision, Recall and F1 score as the metric. Notice that the detection results are right only when it accurately judges whether there are elements that need to be merged across the two pages and output the right indexes of them.
Related Skills
docs-writer
98.4k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
model-usage
325.9kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
Design
Campus Second-Hand Trading Platform \- General Design Document (v5.0 \- React Architecture \- Complete Final Version)1\. System Overall Design 1.1. Project Overview This project aims t
docs
High-performance, modular RAG backend and "Knowledge Engine" Built with Go & Gin, featuring Git-Ops knowledge sync, pgvector semantic search, and OpenAI-compatible model support.
