OpenThai2.1-OCR-Markdown-20261118
OpenThai2.1-OCR-Markdown-20261118 (18 November 2026). This repository was named OpenThai2.0-OCR-Markdown; the old name redirects here. New weights and the fixed post-processing package: phone photos and nine more page types, LaTeX formulas, page headers and footers out of the Markdown, blank pages skipped, and ำ written as one character. OpenThai2.0 (v2.0.0) stays available with
revision="v2.0.0"; pinrevision="v2.1.0"to keep this version.
Thai and English document pages to Markdown, with tables as HTML. It is a Thai fine-tune of NVIDIA Nemotron 3.5 Parse (0.63B) from OpenThai (formerly OpenThaiGPT). Developed by iApp, launched with AIEAT. It keeps Parse's layout boxes, block classes and reading order, and its whole serving and postprocessing stack, so it works anywhere Parse does.
New in 2.1 (against OpenThai2.0-OCR-Markdown, tag v2.0.0):
- Phone photos and everyday page types. It is trained on photographed pages and on nine page types beyond government documents: academic papers, books, comics, exams, magazines, newspapers, reports, slides and textbooks, in Thai and English.
- MDPBench (English and Thai): 82.5, up from 73.7. Thai photographed pages are up about 10 points.
- olmOCR-bench 73.1 (2.0: 50.9; the base model: 62.4) and OmniDocBench v1.6 79.6 (2.0: 61.8; the base model: 80.1).
- Formulas come out as LaTeX between
$$delimiters; a formula of several lines as one$$\begin{gathered}...\end{gathered}$$. - Page headers and footers are left out of the Markdown by default, and stay in the block list.
- Blank pages come back empty:
DocumentParserno longer sends a blank sheet to the model, which used to invent text on it. - Standard Thai output: ำ is written as one character (U+0E33), and table cells carry no
rowspan="1"orcolspan="1". - Thai official documents and tables are as before: there is no significant change on th-docs-tables, ThaiOCRBench tables or Thai text.
- The same size and speed as 2.0.
Typhoon OCR V2 2B is still ahead on MDPBench, by 4.5 points, most on photographed pages and tables, and further ahead on olmOCR-bench and OmniDocBench, most on formulas (see Results and Limits).
Built on NVIDIA Nemotron. The base model, tokenizer and serving code are NVIDIA's (nvidia/Nemotron-3.5-Parse,
OpenMDW-1.1). Their licence, copyright notices, third-party notices and tokenizer attribution are included unchanged in
this repository, and NVIDIA's original model card is kept as NVIDIA_NEMOTRON_PARSE_README.md. Our changes to
NVIDIA's code are the Markdown options in nemotron_parse/postprocessing.py and the blank-page check in
nemotron_parse/inference.py, both described under Use.
Model at a glance
Results
| Model | th-docs-tables v1 (65 pages) | ThaiOCRBench tables (193 images) | Thai text, printed (12 sets) | MDPBench EN+TH (320 pages) | MDPBench Thai | olmOCR-bench | OmniDocBench v1.6 | Seconds per page |
|---|---|---|---|---|---|---|---|---|
| OpenThai2.1-OCR-Markdown-20261118 | 94.0 | 69.5 | 90.2 | 82.5 | 80.7 | 73.1 | 79.6 | 1.5 |
| OpenThai2.0-OCR-Markdown | 95.2 | 68.9 | 90.3 | 73.7 | 72.7 | 50.9 | 61.8 | 1.5 |
| Nemotron 3.5 Parse (base) | 91.3 | 68.3 | 89.0 | 79.6 | 77.4 | 62.4 | 80.1 | 1.8 |
| Typhoon OCR V2 2B | 91.6 | 69.4 | 89.5 | 87.0 | 85.0 | 84.7 | 91.5 | 1.0 |
Bold marks the best score in each column (for seconds per page, the fastest).
Against Typhoon OCR V2 2B, with paired 95% intervals:
| Benchmark | Difference | Result |
|---|---|---|
| th-docs-tables v1 | +2.3 [+0.4, +4.8] | ahead |
| ThaiOCRBench tables | +0.1 [−2.7, +2.9] | not significant |
| Thai text | +0.73 [+0.19, +1.24] | ahead |
| MDPBench | −4.5 [−7.0, −2.0] | behind |
| MDPBench Thai | −4.3 [−8.4, −0.4] | behind |
| olmOCR-bench | −11.6 (± 1.0 and ± 0.8) | behind |
| OmniDocBench v1.6 | −11.8 | behind |
Typhoon OCR V2 2B's th-docs-tables, ThaiOCRBench tables and Thai text are from a second read on 25 November 2026, under its current card (images whose long side is under 1,600 px enlarged to 1,600, vLLM 0.31, the same weights). The release gates were decided on the first read, under its card of early November: ThaiOCRBench tables 67.6 and Thai text 89.6, where 2.1 was at +1.9 [−1.0, +4.9] and +0.69 [−0.31, +1.51]. 2.1 passes every gate against both reads.
Against OpenThai2.0 on the same sets: th-docs-tables v1 −1.2 [−2.9, +0.3] and ThaiOCRBench tables +0.6 [−1.6, +2.7], neither significant; Thai text 90.24 against 90.31; olmOCR-bench +22.2 and OmniDocBench +17.8.
Against the base model (Nemotron 3.5 Parse with NVIDIA's package): olmOCR-bench +10.7 and OmniDocBench −0.5, ahead on text and tables and behind on formulas (see below).
- th-docs-tables v1 is 65 real Thai government and university pages, scored on text and tables together.
- ThaiOCRBench tables: table TEDS on the 193 table images of ThaiOCRBench.
- Thai text, printed: character accuracy, 100 × (1 − CER), averaged over 12 printed sets.
- The sets are 1,200 pages and 50 court judgments: budget documents, the Royal Gazette, old books, court judgments, ThaiOCRBench full pages and short document crops.
- It reads ThaiOCRBench full pages better than 2.0 (92.3 against 90.6). It is behind 2.0 on OCR104 Thai+English crops (97.2 against 99.3) and document photos (94.5 against 96.4).
- A page that fails (cut off at the token limit) counts as empty. None of the 2,270 pages failed.
- These three Thai document benchmarks use the 2.0 Markdown conventions,
PostprocessOptions(keep_page_headers_footers=True, formula_display_dollars=False), as 2.0 was measured. Their reference texts include page headers. - MDPBench (English and Thai public set, 320 pages, three quarters of them phone photos):
- Run with Typhoon's public harness recipes and scored with MDPBench's own scorer.
- The formula metric (CDM) is left out, as in our 13 November comparison; with CDM the scores are 80.4 for this model and 86.1 for Typhoon OCR V2 2B.
- This model and Typhoon OCR V2 2B were run together on 16 November 2026. The 2.0 and base rows are from the same setup on 13 November.
- Where Typhoon leads: Thai photographed pages (78.4 against 84.4) and Thai tables (TEDS 87.2 against 95.8). Thai born-digital pages are level (87.7 against 87.1).
- olmOCR-bench (1,403 English one-page PDFs, page 1 at 2,048 pixels) and OmniDocBench v1.6 (all 1,651 pages,
English and Chinese):
- Run with Typhoon's public harness recipes and scored with each benchmark's own scorer. This model, Typhoon OCR V2 2B, OpenThai2.0 and the base model were run in the same setup on 16–17 November 2026.
- The setup reproduces Typhoon's card: Typhoon OCR V2 2B 84.7 and 91.46 here against 84.7 and 90.97 on its card; the base model 62.4 and 80.1 against 62.7 and 80.13; OpenThai2.0 50.9 and 61.8 against 51.2 and 62.02.
- Where Typhoon leads is formulas: OmniDocBench formula CDM 67.0 against 95.1, and olmOCR-bench's two math categories 67.6 and 47.8 against 86.7 and 87.3. On olmOCR-bench's tables, multi-column, long tiny text and baseline categories this model is within 2 points (83.8, 82.1, 90.0, 99.8 against 85.7, 82.5, 91.0, 99.9).
- OmniDocBench's other parts: text edit distance 0.068 against 0.039 (English pages 0.042 against 0.032; most of the gap is on Chinese pages, which this model was not trained for) and table TEDS 78.6 against 83.2.
- Against the base model: with the same 2.1 package, OmniDocBench is level (79.6 against 79.8): text edit 0.068 against 0.088 and table TEDS 78.6 against 77.2, but formula CDM 67.0 against 70.8. Most of the formula gap to Typhoon is already in the base model.
- The 2.1 package's formula fix: the first build of the package wrote a formula of several lines as invalid LaTeX
(
$$a\)\(b$$). This was found in the OmniDocBench outputs and fixed before release; it changes none of the Thai document benchmarks above (they use Parse's\(...\)form) and MDPBench by −0.1. With the first build the scores were olmOCR-bench 72.3, OmniDocBench 75.55 and MDPBench 82.6.
- New Royal Gazette pages, the fourth benchmark on the 2.0 card, were not re-measured for 2.1: the page images are on a storage volume that is currently unavailable.
- Seconds per page: the median of 12 th-docs-tables pages sent one at a time, alone on one H100, served as in Use. Served that way, vLLM with this package's plugin turns on the model's built-in one-token MTP (multi-token prediction) head, which proposes the next token and has 97–98% of its proposals accepted. With no speculation at all a page takes 2.4 s; with the DFlash2 drafter, 0.44 s (see Faster with the DFlash2 drafter). Typhoon OCR V2 2B is the 2.0 card's measurement, served as its card recommends with its EAGLE-3 draft head, on another day. Both models timed on the same H100 in one session: see Against Typhoon OCR V2 2B on the same H100.
Use
Serve with vLLM exactly as the base model. Then parse pages with NVIDIA's DocumentParser (box-and-class prompt, single
pass), from the nemotron_parse package in this repository. Install it from the downloaded model folder; it also
registers the vLLM plugin the model needs:
hf download iapp/OpenThai2.1-OCR-Markdown-20261118 --local-dir OpenThai2.1-OCR-Markdown-20261118
pip install -e "./OpenThai2.1-OCR-Markdown-20261118[vllm,client]"
vllm serve ./OpenThai2.1-OCR-Markdown-20261118 --served-model-name nemotron-parse --trust-remote-code
vLLM runs on Linux; on Windows, use it under WSL2.
from nemotron_parse.inference import DocumentParser, GenerationError
with DocumentParser(base_url="http://localhost:8000/v1", model="nemotron-parse") as parser:
try:
doc = parser.parse("page.png", mode="single")
print(doc["markdown"]) # Markdown; tables as HTML with rowspan/colspan; formulas as $$...$$
except GenerationError:
... # raised if a page is cut off at the token limit (see Limits)
Markdown options (nemotron_parse.postprocessing.PostprocessOptions):
| Option | Default | Effect |
|---|---|---|
keep_page_headers_footers | False | Page headers and footers are left out of the Markdown and stay in doc["blocks"]. Set True to keep them in the Markdown, as 2.0 did. |
standard_output | True | ำ composed to U+0E33 (the model writes U+0E4D U+0E32) and unit rowspan/colspan dropped from table cells. |
formula_display_dollars | True | A formula block is written as $$...$$ (several lines as one $$\begin{gathered}...\end{gathered}$$). Set False for Parse's \(...\) form, as 2.0 did. |
Blank pages: DocumentParser checks each page first and does not send a blank sheet (a blank PDF page, a blank
scan, or a flat light colour) to the model; it comes back with empty Markdown and no blocks. Dark pages, photos and
anything printed are always sent. The check flagged none of 9,555 development pages or of the 5,774 benchmark page
images above. Turn it off with DocumentParser(..., skip_blank=False).
The guide for 2.0 applies unchanged; use the model name iapp/OpenThai2.1-OCR-Markdown-20261118. It covers Linux,
Windows and Mac with Apple silicon, with a script for pictures and PDFs: English ·
ภาษาไทย · 中文.
GGUF for llama.cpp (a Mac, a CPU or a consumer GPU, without vLLM): iapp/OpenThai2.1-OCR-Markdown-20261118-GGUF,
run with our llama.cpp fork (iapp-technology/llama.cpp, branch
nemotron-parse); upstream llama.cpp does not include this architecture. Its Markdown matched the PyTorch model's on
30 of 30 dev pages; about 6 s per page on an Apple M3 Max with Metal.
iApp API: POST https://api.iapp.co.th/v3/store/ocr/document/markdown serves this version since 18 November 2026
(0.15 IC per page read whole).
Faster with the DFlash2 drafter
The dflash2/ folder holds NVIDIA's DFlash2 drafter for Nemotron 3.5 Parse (89.3M parameters). It proposes up to 32
tokens at a time and the model checks them in one step; on this fine-tune about 13 are accepted per step. Tested on
26 November 2026 on one H100, one page at a time, with the DocumentParser client above:
- Speed: 0.44 s per page, against 1.5 s served as in Use (the built-in one-token MTP head) and 2.4 s with no speculation (median of 12 th-docs-tables pages, over 3–4 server starts).
- Accuracy: unchanged within run-to-run noise. Both columns use the same vLLM build; no page of 2,528 failed in either.
| Benchmark | Without the drafter | With DFlash2 (32 tokens) | Difference [95% CI] |
|---|---|---|---|
| th-docs-tables v1 | 93.8 | 93.9 | +0.2 [−0.1, +0.6] |
| ThaiOCRBench tables | 69.5 | 69.1 | −0.4 [−1.7, +0.8] |
| Thai text, printed (12 sets) | 90.25 | 90.22 | −0.03 [−0.09, +0.03] |
The drafter needs vLLM with native Nemotron Parse and DFlash2 support, in its own environment without this package's
[vllm] extra (see docs/serving.md). We used 0.32.1rc1.dev505+g00b6c4c56, the build NVIDIA
validated the drafter on, from vLLM's per-commit wheels; vLLM 0.31.0 on PyPI cannot serve the model natively.
vllm serve ./OpenThai2.1-OCR-Markdown-20261118 --served-model-name nemotron-parse --trust-remote-code \
--max-model-len 16384 --limit-mm-per-prompt '{"image":1}' \
--speculative-config '{"method":"dflash","model":"./OpenThai2.1-OCR-Markdown-20261118/dflash2","num_speculative_tokens":32}'
- Parse pages with the same
DocumentParseras above, installed with the[client]extra only. - That vLLM build returns ำ as two characters (U+0E4D U+0E32);
standard_output=True, the default, composes it. - vLLM guesses the speculative method from the model's path: a folder whose path contains "dflash" makes the built-in MTP head fail to start. Keep the model in a folder without that word.
- Only one page at a time was tested. NVIDIA's own measurements favour 32 tokens up to 16 concurrent pages and 16 above.
Against Typhoon OCR V2 2B on the same H100
On 26 November 2026 the two models were timed in one session on one H100, alternating on freshly started servers, on the
same 12 th-docs-tables pages sent one at a time. Each was served and prompted as its own card recommends, both on the
vLLM build above. Typhoon: typhoon-ai/typhoon-ocr2-2b at 59a143d2, with its EAGLE-3 drafter
typhoon-ai/typhoon-ocr2-2b-eagle3 at a1e29944 (3 draft tokens, greedy decoding).
| Setup | Server starts | Seconds per page (median of runs) |
|---|---|---|
| OpenThai2.1-OCR-Markdown-20261118 + DFlash2 (32 tokens) | 4 | 0.45 |
| Typhoon OCR V2 2B + EAGLE-3 (3 tokens) | 4 | 1.15 |
| Typhoon OCR V2 2B, no drafter | 2 | 1.83 |
- Output length is not the reason. Both write boxes and about as many tokens per page: medians of 1,303 (this model) and 1,267 (Typhoon) over the 65 pages, with different tokenizers. The gap comes from about 15 tokens accepted per step with DFlash2 against 3.7 with Typhoon's EAGLE-3, and a 192M decoder against a 2B model.
- The setups check out: in the same runs th-docs-tables v1 scored 93.9–94.1 for this model and 91.6 for Typhoon, as in Results.
- Limits of the comparison: each model used its own card's prompt, decoding and token cap. One page makes Typhoon repeat itself up to its 16,384-token cap (about 22 s with EAGLE-3), which the median absorbs. Throughput with many pages at once was not measured.
Training
Text labels are exact, never another model's reading. The mix is 77,900 rows:
| Source | Rows |
|---|---|
| OpenThai2.0's mix (54,615 rows), with its layout targets rebuilt at the base model's own block granularity and with pictures kept. 2.0 had merged blocks, which cost block-matched benchmarks such as MDPBench. | 54,615 |
| synthetic Thai documents (forms, memos, tables), two- and three-column pages and other table styles | 26,408 |
| born-digital government pages: parliament budget documents and the Royal Gazette (CC BY 4.0) | 14,939 |
| public table images: FinTabNet and PubTabNet training splits | 4,748 |
| dot-matrix crops | 3,520 |
| replay: handwriting lines, English and lottery-ticket crops | 5,000 |
| New page types, rendered in Chromium, about half as simulated phone photos (11,990 pages). The types are academic papers, book pages, comics, exam papers, magazines, newspapers, reports, slides and textbooks, in Thai, English and mixed. They carry LaTeX formulas (KaTeX), charts, diagrams, captions, running heads, footnotes and page numbers. The text comes from Thai and English Wikipedia (CC BY-SA 4.0). | 14,013 |
| Simulated phone photos of government pages (4,000 pages): bent, creased, wrinkled, held, shadowed, under-exposed and screen captures, with perspective, lighting and camera noise. Every character stays on the page, so labels stay exact. | 4,352 |
| Simulated phone photos of synthetic documents (4,000 pages) | 4,657 |
| Anti-loop rows: pages on which earlier 2.1 fine-tunes fell into a repetition loop, with that loop as a negative target. They are old-book scans (public-domain Wikisource books), synthetic receipt photos and one parliament page, none from a benchmark. | 263 |
- Recipe:
- full fine-tune with AdamW, peak learning rate 1e-5 (vision encoder at half), one epoch of 2,435 steps of 32 samples, on one NVIDIA H100 provided by Siam AI;
- unlikelihood loss on the anti-loop spans, weight 1;
- the released weights blend checkpoint 2,250 with the base model, 70 : 30 in weight space (WiSE-FT).
- No benchmark data in training: no page from th-docs-tables, ThaiOCRBench, MDPBench, OpenThaiOCR-Bench or the docbench sets was trained on. The leak guard is character 8-gram and perceptual-hash matching.
- How it was chosen: by a rule written before training. It picks per run the checkpoint with the best score on
five development parts, then blends at 0.5 and 0.7 with the base model.
- The development parts: 60 real government table pages, a robustness set, 300 FinTabNet/PubTabNet validation tables, 360 synthetic pages of the new types, and 259 simulated phone photos.
- The loop check: 5,255 unlabelled pages, on which a candidate may be cut off on at most 2. This one is cut off on none.
- The release gates against Typhoon OCR V2 2B were read for five candidates in the rule's order. This is the first to pass them all; all five reads are published with the selection log.
- MDPBench was read once, after the gates.
Limits
- MDPBench: behind Typhoon OCR V2 2B by 4.5 points (Thai by 4.3), most on photographed pages and on tables in photographed pages.
- Repetition loops: none on the 2,270 text-benchmark pages, the 193 ThaiOCRBench tables, the 65 th-docs-tables pages
or 5,255 development pages. MDPBench: 1 of 320 pages cut off at the token limit (Typhoon OCR V2 2B: 19). On other
inputs,
DocumentParserraisesGenerationErrorif a page is cut off. - Pages without text: blank sheets are skipped (see Use), but a photo or a figure with no text in it can still come back with invented text.
- Formulas are the weakest part: OmniDocBench formula CDM 67.0 against Typhoon OCR V2 2B's 95.1 (the base model: 71.9), and 47.8 on olmOCR-bench's old scanned math (Typhoon 87.3).
- Chinese is not a target language; Chinese pages read noticeably worse than English ones.
- Text inside pictures and charts is transcribed into the Markdown, as the base model does. MDPBench's and OmniDocBench's references leave it out, which costs some score on slides and figures.
- Tables unlike Thai government documents can still come out with rows missing or a row span wrong.
- Thai digits occasionally come out as Arabic digits.
- Short crops of photographed text read worse than full pages: 94.5 on OCR104 document photos.
- Dot-matrix print: expect less on real passbooks than on our synthetic dot-matrix crops.
- Handwriting is read only at text-line level; full handwritten pages are not a target.
- The DFlash2 drafter in this repository is NVIDIA's, trained for the base model. With this fine-tune it was tested one page at a time, on th-docs-tables, ThaiOCRBench tables and printed Thai text only: not on MDPBench, olmOCR-bench or OmniDocBench, and not with many pages at once.
Acknowledgements
This model was trained on NVIDIA H100 GPUs provided by Siam AI. Thanks to NVIDIA for Nemotron 3.5 Parse, to the authors of MDPBench and of Typhoon's evaluation harness, and to the people behind the public data above.
Licence
The model is a derivative of NVIDIA Nemotron 3.5 Parse and is distributed under the OpenMDW License Agreement, version 1.1. The tokenizer is MIT-licensed (see TOKENIZER_ATTRIBUTION.md).