Run this model with HF Jobs
Run Chulinz/Aan-1.0 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/Chulinz/Aan-1.0. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Chulinz/Aan-1.0 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/Chulinz/Aan-1.0. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/Chulinz/Aan-1.0. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use Chulinz/Aan-1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Chulinz/Aan-1.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Chulinz/Aan-1.0", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Chulinz/Aan-1.0", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Chulinz/Aan-1.0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Chulinz/Aan-1.0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Chulinz/Aan-1.0", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/Chulinz/Aan-1.0
- SGLang
How to use Chulinz/Aan-1.0 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Chulinz/Aan-1.0" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Chulinz/Aan-1.0", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Chulinz/Aan-1.0" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Chulinz/Aan-1.0", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use Chulinz/Aan-1.0 with Docker Model Runner:
docker model run hf.co/Chulinz/Aan-1.0
Aan-1.0
Aan (อ่าน, "read") is a 0.6B-parameter Thai and English document parser fine-tuned from NVIDIA Nemotron 3.5 Parse. It keeps the base architecture, prompt, output format and pipelines and outputs reading-order text with per-block layout classes, bounding boxes and tables in LaTeX.
In single-pass runs, Aan-1.0 ties Typhoon OCR V2 2B on MDPBench (text and table TEDS) while leading AksonOCR-Lite, OpenThai 2.2 and OpenThai 2.1. On the ThaiOCRBench three-task mean (document parsing, full-page OCR and table parsing), it ties AksonOCR-Lite while leading Typhoon OCR V2 2B, OpenThai 2.2 and OpenThai 2.1. On 348 private real pages, Aan-1.0 scores 91.2, tied with Typhoon OCR V2 2B (90.6) and above the others.
Results
Benchmarks and protocol
Every benchmark includes Thai pages. MDPBench covers Thai and English in the Typhoon OCR harness, allowing direct checks against Typhoon OCR and OpenThai's published scores. On ThaiOCRBench, we score only the three full-page tasks and exclude the two region-query QA tasks because Aan-1.0 reads whole pages rather than answering questions about isolated regions. The private 348-page set adds the author's documents, handwriting and forms. No MDPBench or ThaiOCRBench image was used in training.
- MDPBench: 320 Thai/English pages from Typhoon OCR, scored with its harness.
- Reproductions (ours vs published): Typhoon OCR V2 2B 79.5 vs 79.8; OpenThai 2.1 75.4 vs 75.2; AksonOCR-Lite Thai 79.6 vs 79.5 (rotation on, dewarp off).
- OpenThai 2.2 used its default prompt and postprocessing with orientation and dewarping off (its 86.1 card score enables both in another harness).
- ThaiOCRBench: 358 full-page items (document parsing, full-page OCR, table parsing), scored with
eval.pyafter Thai vowel recomposition (AksonOCR-Lite document parsing: 0.648 vs 0.640). - Private 348-page set: Printed Thai (100), printed English (100), handwriting (100) and other (48).
- Sources: 263 personal photos and scans (filled forms, name cards) plus 85 public pages (Thai/English handwritten paragraphs and XFUND forms in five European languages).
- Setup: 60 photos were rotated upright. All engines produced output on all 348 pages (empty scores 0).
- Metrics (markup and whitespace stripped): character-trigram F1 x 100 (order-invariant for forms) and CER % (counts reading order).
- Decoding: Single pass. Aan-1.0 and Nemotron 3.5 Parse used base settings (temperature 0.2, top-k 50, repetition penalty 1.05, seed 0, max 8,744 new tokens); others used card settings (including Typhoon OCR V2 2B's 1,600 px long-side upscaling). On ThaiOCRBench and the private set, every engine keeps page headers and footers (OpenThai
keep_page_headers_footers=True, Typhoonkeep_header_footer=True). MDPBench's scorer ignores them, so each engine uses its default there. - Runtime: All engines ran on NVIDIA DGX Spark.
- GPU: Aan-1.0, Typhoon OCR V2 2B, OpenThai 2.2, OpenThai 2.1 and Nemotron 3.5 Parse.
- CPU: AksonOCR-Lite.
- Reproduce:
reproduce/reruns all public benchmarks (run_engine.sh <engine> <setting>) on one CUDA GPU from pinned code, data and weights. Our reruns land within 0.5 MDPBench points and 0.004 ThaiOCRBench points of the card (temperature 0.2 sampling adds minor variance).reproduce/card/stores the per-page outputs; rescoring them on CPU reproduces all 192 card numbers and bootstrap CIs exactly. The private set is not released and cannot be rerun.
Fresh reruns vs card (MDPBench overall / ThaiOCRBench mean of the 3 tasks)
| Setting | Engine | Card | Fresh rerun |
|---|---|---|---|
| Plain | Aan-1.0 | 80.8 / 0.655 | 81.1 / 0.652 |
| AksonOCR-Lite | 76.9 / 0.648 | 76.8 / 0.648 | |
| Typhoon OCR V2 2B | 79.5 / 0.618 | 79.0 / 0.615 | |
| OpenThai 2.2 | 74.8 / 0.598 | 75.0 / 0.602 | |
| OpenThai 2.1 | 75.4 / 0.617 | 75.4 / 0.616 | |
| Nemotron 3.5 Parse | 74.2 / 0.630 | 74.6 / 0.629 | |
| MonkeyOCRv2 dewarp | Aan-1.0 | 82.9 / 0.646 | 83.4 / 0.647 |
| AksonOCR-Lite | 81.9 / 0.647 | 81.9 / 0.647 | |
| Typhoon OCR V2 2B | 79.4 / 0.616 | 79.1 / 0.613 | |
| OpenThai 2.2 | 77.7 / 0.599 | 77.5 / 0.603 | |
| OpenThai 2.1 | 78.3 / 0.615 | 78.1 / 0.613 | |
| Nemotron 3.5 Parse | 79.8 / 0.628 | 80.0 / 0.627 | |
| OpenThai 2.2 orient + dewarp | Aan-1.0 | 83.7 / 0.650 | 83.6 / 0.646 |
| OpenThai 2.2 | 79.9 / 0.601 | 80.1 / 0.601 |
Scores
| Benchmark / metric | Aan-1.0 | AksonOCR-Lite | Typhoon OCR V2 2B | OpenThai 2.2 | OpenThai 2.1 | Nemotron 3.5 Parse |
|---|---|---|---|---|---|---|
| MDPBench | ||||||
| Overall | 80.8 | 76.9 | 79.5 | 74.8 | 75.4 | 74.2 |
| Thai | 83.4 | 79.6 | 80.9 | 76.5 | 76.9 | 74.5 |
| English | 78.3 | 74.3 | 78.1 | 73.1 | 74.0 | 73.8 |
| Digital | 86.5 | 85.8 | 82.2 | 81.7 | 81.2 | 85.4 |
| Photo | 78.9 | 73.9 | 79.3 | 72.4 | 73.5 | 70.4 |
| Table TEDS | 0.624 | 0.369 | 0.614 | 0.551 | 0.557 | 0.565 |
| Reading-order edit (lower is better) | 0.133 | 0.198 | 0.154 | 0.162 | 0.165 | 0.202 |
| ThaiOCRBench | ||||||
| Document parsing | 0.462 | 0.648 | 0.422 | 0.320 | 0.372 | 0.463 |
| Full-page OCR | 0.875 | 0.855 | 0.867 | 0.895 | 0.891 | 0.847 |
| Table parsing | 0.627 | 0.443 | 0.564 | 0.578 | 0.589 | 0.580 |
| Mean of the 3 tasks | 0.655 | 0.648 | 0.618 | 0.598 | 0.617 | 0.630 |
| Private 348-page set (trigram F1) | ||||||
| All 348 pages | 91.2 | 81.7 | 90.6 | 88.2 | 88.3 | 87.0 |
| Thai | 91.0 | 87.4 | 89.8 | 88.7 | 88.7 | 87.5 |
| English | 93.7 | 89.9 | 93.6 | 89.4 | 90.6 | 91.2 |
| Handwriting | 87.2 | 67.7 | 87.3 | 85.2 | 84.3 | 79.3 |
| Other | 94.5 | 81.9 | 92.8 | 90.9 | 91.0 | 93.2 |
| Private 348-page set (CER %, lower is better) | ||||||
| All 348 pages | 20.6 | 37.0 | 20.5 | 25.3 | 25.2 | 25.0 |
| Thai | 26.8 | 44.3 | 26.6 | 29.0 | 30.2 | 31.4 |
| English | 20.8 | 29.0 | 18.2 | 29.4 | 27.6 | 24.4 |
| Handwriting | 10.1 | 55.1 | 10.6 | 13.3 | 14.7 | 15.8 |
| Other | 16.3 | 21.4 | 19.4 | 21.3 | 20.2 | 20.5 |
Paired bootstrap (95% CI, Aan-1.0 minus opponent): 5,000 resamples for MDPBench (317 to 319 text pages both engines read and 200 tables) and ThaiOCRBench (358 items, points x 100; Typhoon OCR V2 2B and OpenThai 2.2 compare against Aan-1.0's 0.650 DGX run); 2,000 page resamples for the private 348-page set.
| Benchmark / metric | AksonOCR-Lite | Typhoon OCR V2 2B | OpenThai 2.2 | OpenThai 2.1 | Nemotron 3.5 Parse |
|---|---|---|---|---|---|
| MDPBench & ThaiOCRBench | |||||
| MDPBench text | +5.06 [+2.59, +7.52] | -1.33 [-3.78, +1.12] | +5.02 [+2.92, +7.14] | +4.03 [+2.01, +6.03] | +7.55 [+5.51, +9.69] |
| MDPBench table TEDS | +25.50 [+20.36, +30.71] | +1.00 [-4.12, +6.14] | +7.30 [+3.32, +11.38] | +6.71 [+2.41, +11.02] | +6.57 [+2.97, +10.25] |
| ThaiOCRBench, 3 tasks | +0.62 [-1.98, +3.14] | +3.27 [+0.87, +5.68] | +5.25 [+3.30, +7.28] | +3.72 [+2.07, +5.46] | +2.46 [+0.46, +4.50] |
| Private 348-page set, trigram F1 | |||||
| All | +9.5 [+7.8, +11.3] | +0.6 [-0.2, +1.3] | +3.0 [+2.2, +3.7] | +2.9 [+2.2, +3.6] | +4.2 [+3.2, +5.3] |
| Thai | +3.6 [+2.5, +4.7] | +1.2 [+0.0, +2.6] | +2.3 [+1.3, +3.4] | +2.4 [+1.3, +3.5] | +3.5 [+2.2, +5.1] |
| English | +3.8 [+2.8, +5.0] | +0.2 [-0.5, +0.9] | +4.3 [+3.1, +5.8] | +3.1 [+2.2, +4.1] | +2.5 [+0.9, +4.7] |
| Handwriting | +19.5 [+14.5, +24.3] | -0.1 [-1.8, +1.7] | +2.0 [+0.9, +3.1] | +2.9 [+1.9, +4.0] | +7.9 [+5.9, +10.2] |
| Other | +12.6 [+8.7, +16.9] | +1.7 [-0.8, +4.7] | +3.6 [+0.9, +7.7] | +3.5 [+0.6, +7.9] | +1.3 [-0.2, +3.2] |
| Private 348-page set, CER % (negative = fewer errors) | |||||
| All | -16.4 [-19.1, -13.8] | +0.1 [-1.4, +1.5] | -4.7 [-6.1, -3.3] | -4.6 [-5.9, -3.4] | -4.4 [-6.3, -2.8] |
| Thai | -17.5 [-21.2, -14.1] | +0.2 [-2.4, +2.6] | -2.2 [-4.4, +0.0] | -3.4 [-5.2, -1.7] | -4.6 [-7.1, -2.0] |
| English | -8.1 [-11.6, -5.1] | +2.6 [+0.5, +4.6] | -8.6 [-10.9, -6.1] | -6.8 [-8.8, -4.8] | -3.6 [-8.6, +0.3] |
| Handwriting | -45.1 [-49.5, -40.0] | -0.5 [-1.7, +0.7] | -3.2 [-4.5, -1.9] | -4.6 [-5.9, -3.4] | -5.7 [-7.7, -4.0] |
| Other | -5.1 [-10.3, +0.3] | -3.1 [-7.8, +0.1] | -5.0 [-9.3, -1.4] | -3.9 [-8.4, -0.3] | -4.2 [-8.2, -1.0] |
Across bootstrap CIs, Aan-1.0 ties Typhoon OCR V2 2B on MDPBench and the private 348-page set (where English CER favors Typhoon by 2.6 [0.5, 4.6]) and ties AksonOCR-Lite on ThaiOCRBench (AksonOCR-Lite leads document parsing by 0.186; Aan-1.0 leads table parsing by 0.184). Against all other engines, Aan-1.0 leads across every benchmark except Nemotron 3.5 Parse on private Other trigram F1 and OpenThai 2.2 on private Thai CER (ties). AksonOCR-Lite trails on private handwriting and forms (46.7 English handwriting, though 86.4 vs 76.5 on 25 Thai handwritten pages).
With page dewarping
Running AksonOCR-Lite's optional MonkeyOCRv2 CPU dewarper modifies 232 of 320 pages on MDPBench, 52 of 358 items on ThaiOCRBench and 8 of 348 pages on the private set.
| Benchmark / metric | Aan-1.0 | AksonOCR-Lite | Typhoon OCR V2 2B | OpenThai 2.2 | OpenThai 2.1 | Nemotron 3.5 Parse |
|---|---|---|---|---|---|---|
| MDPBench + dewarp | ||||||
| Overall | 82.9 | 81.9 | 79.4 | 77.7 | 78.3 | 79.8 |
| Thai | 86.3 | 85.5 | 79.9 | 80.2 | 80.4 | 81.5 |
| English | 79.6 | 78.3 | 79.0 | 75.2 | 76.3 | 78.2 |
| Digital | 86.6 | 85.8 | 80.7 | 81.8 | 81.3 | 86.2 |
| Photo | 81.7 | 80.6 | 79.0 | 76.3 | 77.3 | 77.7 |
| Table TEDS | 0.678 | 0.447 | 0.609 | 0.588 | 0.611 | 0.644 |
| ThaiOCRBench + dewarp | ||||||
| Document parsing | 0.457 | 0.651 | 0.419 | 0.327 | 0.376 | 0.461 |
| Full-page OCR | 0.870 | 0.848 | 0.869 | 0.891 | 0.885 | 0.841 |
| Table parsing | 0.612 | 0.441 | 0.561 | 0.580 | 0.585 | 0.581 |
| Mean of the 3 tasks | 0.646 | 0.647 | 0.616 | 0.599 | 0.615 | 0.628 |
| Private 348-page set + dewarp | ||||||
| Trigram F1 (All) | 91.1 | 81.6 | 90.6 | 88.1 | 88.1 | 87.0 |
| CER % (All, lower is better) | 20.6 | 37.0 | 20.4 | 25.4 | 25.4 | 25.0 |
Paired bootstrap (Aan-1.0 + dewarp minus each dewarped engine, 95% CI; 5,000 resamples on MDPBench and ThaiOCRBench, 2,000 on the private set):
| Benchmark / metric | AksonOCR-Lite | Typhoon OCR V2 2B | OpenThai 2.2 | OpenThai 2.1 | Nemotron 3.5 Parse |
|---|---|---|---|---|---|
| MDPBench text | +2.97 [+0.70, +5.08] | +1.11 [-1.04, +3.28] | +4.77 [+2.97, +6.60] | +2.99 [+1.33, +4.61] | +4.36 [+2.76, +5.98] |
| MDPBench table TEDS | +23.09 [+17.58, +28.62] | +6.88 [+1.98, +11.81] | +8.95 [+5.22, +12.78] | +6.67 [+2.43, +10.87] | +3.36 [-0.04, +6.92] |
| ThaiOCRBench, 3 tasks | -0.03 [-2.62, +2.52] | +2.99 [+0.55, +5.34] | +4.68 [+2.67, +6.70] | +3.08 [+1.21, +4.94] | +1.87 [-0.18, +3.95] |
| Private 348-page set, trigram F1 (All) | +9.5 [+7.8, +11.3] | +0.5 [-0.2, +1.3] | +3.0 [+2.2, +3.7] | +3.0 [+2.3, +3.7] | +4.1 [+3.2, +5.2] |
| Private 348-page set, CER % (All) | -16.3 [-19.1, -13.8] | +0.2 [-1.2, +1.5] | -4.8 [-6.2, -3.4] | -4.8 [-6.1, -3.6] | -4.3 [-6.1, -2.7] |
On MDPBench, dewarping lifts Aan-1.0 over its non-dewarped baseline (80.9 overall, 0.631 TEDS) by +1.95 [+0.47, +3.56] text and +4.73 [+1.80, +7.68] TEDS. Among dewarped engines, Aan-1.0 leads every row, tying Typhoon OCR V2 2B on text while leading on TEDS (+6.88 [+1.98, +11.81]) and tying Nemotron 3.5 Parse on TEDS (+3.36 [-0.04, +6.92]; Nemotron rises 74.2 to 79.8). On ThaiOCRBench and the private set, rankings hold: Aan-1.0 ties AksonOCR-Lite and Nemotron 3.5 Parse on ThaiOCRBench, ties Typhoon OCR V2 2B on the private set and leads the rest.
OpenThai 2.2 orientation + dewarping
Running both engines on images preprocessed with OpenThai 2.2's orienter and UVDoc dewarping (orient=True, dewarp=True, rotating 42 of 320 MDPBench pages) under our formula-on harness (unlike OpenThai's 86.1 card setup), Aan-1.0 leads on all three benchmarks: MDPBench 83.7 vs 79.9 (text +3.8 [+2.4, +5.4], TEDS +4.1 [+0.3, +7.8]), ThaiOCRBench 0.650 vs 0.601 (+4.9 [+2.9, +6.9]; one Aan-1.0 item came back empty and scored 0.02) and private 348-page F1 91.1 vs 88.2 (+2.9 [+2.2, +3.7]) and CER 20.7% vs 25.2% (-4.5 [-5.9, -3.1]). Compared with MonkeyOCRv2 dewarping on Aan-1.0, this preprocessing adds +1.4 [+0.2, +2.8] on MDPBench text and ties on TEDS (-1.7 [-4.7, +1.4]) and ThaiOCRBench (+0.4 [-0.1, +1.0]).
Performance
Measured in vLLM on one NVIDIA RTX PRO 6000.
| Mode | Concurrency 1 | Concurrency 8 | Concurrency 32 | p50 latency (c=1) |
|---|---|---|---|---|
| No drafter | 0.33 pages/s | 1.68 pages/s | 2.77 pages/s | 2.27 s |
| DFlash16 | 0.51 pages/s | 2.67 pages/s | 4.48 pages/s | 1.15 s |
Roughly 3% to 5% of pages hit the 16k-token length cap in every mode, lowering overall throughput.
With DFlash16, peak VRAM is roughly 6 GB at concurrency 1 and 8 GB at concurrency 32 (1.4 GB for weights and the drafter, with the rest used by KV cache and vLLM activations). Because vLLM reserves 85% of GPU memory by default, lower --gpu-memory-utilization when sharing a GPU.
Usage
vLLM (recommended)
Serve Aan-1.0 with the base model's DFlash2 drafter (16 draft tokens; DRAFT_TOKENS=0 disables it). Requires a vLLM build with native Nemotron Parse and DFlash2 support (evaluated on 0.32.1rc1.dev505+g00b6c4c56).
hf download Chulinz/Aan-1.0 --local-dir aan-1.0
bash aan-1.0/serve.sh aan-1.0 # OpenAI-compatible server on port 8000
Install dependencies and download the page orienter (OpenThai2.2-OCR-Text) and UVDoc dewarper, then parse a directory of images:
cd aan-1.0
pip install pillow httpx beautifulsoup4 huggingface_hub
python -m nemotron_parse.preprocessors preprocessors
pip install -r preprocessors/orient/requirements.txt
python -m nemotron_parse.inference --image-dir pages --output parsed --write-page-files --allow-partial \
--orient-models preprocessors/orient --dewarp-models preprocessors/dewarp
Or in Python:
from nemotron_parse.inference import DocumentParser
with DocumentParser(orient=True, orient_models="preprocessors/orient",
dewarp=True, dewarp_models="preprocessors/dewarp") as parser:
document = parser.parse("page.jpg")
print(document["markdown"])
--allow-partialkeeps text from pages that hit the length cap and logs them inincomplete_pagesinsidemetrics.json(without it, the first capped page stops the run).- Preprocessing: Dewarping leaves flat pages unchanged, so both steps are safe on mixed inputs (turning takes ~0.7 s on one CPU thread for a 12 MP photo). Bounding boxes map to the transformed image described in
document["inference"]["preprocessing"]. - Postprocessing:
nemotron_parse.postprocessingrecomposes Thai sara am (สระ อำ, U+0E33) from split NFKC tokens (U+0E4D U+0E32) and strips defaultrowspan="1"/colspan="1"attributes from HTML table cells. Results scores include both.
Transformers (single page)
import torch
from PIL import Image
from transformers import AutoModel, AutoProcessor, GenerationConfig
model_path = "Chulinz/Aan-1.0"
model = AutoModel.from_pretrained(model_path, trust_remote_code=True, dtype=torch.bfloat16).to("cuda").eval()
processor = AutoProcessor.from_pretrained(model_path, trust_remote_code=True)
image = Image.open("page.jpg").convert("RGB")
prompt = "</s><s><predict_bbox><predict_classes><output_markdown><predict_text_in_pic>"
inputs = processor(images=[image], text=prompt, return_tensors="pt", add_special_tokens=False).to("cuda")
generation_config = GenerationConfig.from_pretrained(model_path)
generation_config.max_new_tokens = 8744
with torch.inference_mode():
outputs = model.generate(**inputs, generation_config=generation_config)
raw = processor.batch_decode(outputs, skip_special_tokens=False)[0]
Convert raw output to Markdown with HTML tables and per-block bounding boxes:
from nemotron_parse.postprocessing import postprocess_document # from this repository, needs beautifulsoup4
document = postprocess_document(raw, image_size=image.size)
print(document["markdown"])
Published float32 weights match the evaluated checkpoint byte-for-byte; load in bfloat16 to match evaluation precision.
Limitations
- Document parsing format: ThaiOCRBench document parsing scores only line and heading structure (tree edit distance), not text. Its references put each HTML table tag on its own line; Aan-1.0 writes each table on one line and loses most of the score. Reformatting tables to match (same text) lifts every engine except AksonOCR-Lite (table below). Aan-1.0 still trails AksonOCR-Lite by 5.19 points [-7.72, -2.73].
- Formulas: read worse than prose; not a training target.
- Loops: dense photographed pages (newspapers, magazines) can repeat to the token limit: 3 of 320 MDPBench pages, scored as emitted. Re-decoding an unclosed last block with repetition penalty 1.10 or 1.15 usually finishes it.
- Languages: trained and tested on Thai and English only; other base-model languages were not measured.
| ThaiOCRBench | Aan-1.0 | AksonOCR-Lite | Typhoon OCR V2 2B | OpenThai 2.2 | OpenThai 2.1 | Nemotron 3.5 Parse |
|---|---|---|---|---|---|---|
| Document parsing, as scored (used in Results) | 0.462 | 0.648 | 0.422 | 0.320 | 0.372 | 0.463 |
| Document parsing, tables reformatted | 0.596 | 0.648 | 0.584 | 0.508 | 0.551 | 0.580 |
Citation
@misc{wannasiwaporn2026aan,
author = {Wannasiwaporn, Jirameth},
title = {Aan-1.0: A Thai and English Document Parser},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/Chulinz/Aan-1.0}}
}
License
The model weights are released under the OpenMDW License Agreement, version 1.1, matching the base model. The tokenizer is released under the MIT license described in TOKENIZER_ATTRIBUTION.md. Third-party notices are in THIRD_PARTY_NOTICES.md. Aan-1.0 is built on Nemotron 3.5 Parse, developed by NVIDIA.
- Downloads last month
- 12
Model tree for Chulinz/Aan-1.0
Base model
nvidia/Nemotron-3.5-Parse


