Run this model with HF Jobs
Run kaopanboonyuen/KaoOCR-Ledger-1.0c 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/kaopanboonyuen/KaoOCR-Ledger-1.0c. 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/kaopanboonyuen/KaoOCR-Ledger-1.0c 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/kaopanboonyuen/KaoOCR-Ledger-1.0c. 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/kaopanboonyuen/KaoOCR-Ledger-1.0c. 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 kaopanboonyuen/KaoOCR-Ledger-1.0c with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kaopanboonyuen/KaoOCR-Ledger-1.0c with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="kaopanboonyuen/KaoOCR-Ledger-1.0c", 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("kaopanboonyuen/KaoOCR-Ledger-1.0c", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kaopanboonyuen/KaoOCR-Ledger-1.0c with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kaopanboonyuen/KaoOCR-Ledger-1.0c" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kaopanboonyuen/KaoOCR-Ledger-1.0c", "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/kaopanboonyuen/KaoOCR-Ledger-1.0c
- SGLang
How to use kaopanboonyuen/KaoOCR-Ledger-1.0c 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 "kaopanboonyuen/KaoOCR-Ledger-1.0c" \ --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": "kaopanboonyuen/KaoOCR-Ledger-1.0c", "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 "kaopanboonyuen/KaoOCR-Ledger-1.0c" \ --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": "kaopanboonyuen/KaoOCR-Ledger-1.0c", "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 kaopanboonyuen/KaoOCR-Ledger-1.0c with Docker Model Runner:
docker model run hf.co/kaopanboonyuen/KaoOCR-Ledger-1.0c
KaoOCR-Ledger-1.0c
Thai documents in, clean Markdown out.
From GSB AI Lab Β· Government Savings Bank
Overview Β· Quick start Β· Benchmark Β· Model family Β· Acknowledgements
| 54.0 | 66.7 | +8.8 | +5.1 |
|---|---|---|---|
| OCR Β· NLS | Parsing Β· TEDS/NLS | OCR gain vs 1.0a | Parsing gain vs 1.0a |
πΉπ KaoOCR Β· Local OCR LLM ΰΈΰΈ±ΰΈ§ΰΉΰΈ£ΰΈΰΈΰΈΰΈΰΈΰΈΰΈ²ΰΈΰΈ²ΰΈ£ΰΈΰΈΰΈ‘ΰΈͺΰΈ΄ΰΈ
KaoOCR ΰΈΰΈ²ΰΈΰΈΰΈ΅ΰΈ‘ΰΉΰΈ₯ΰΉΰΈ AI ΰΈΰΈΰΈΰΈΰΈΰΈ²ΰΈΰΈ²ΰΈ£ΰΈΰΈΰΈ‘ΰΈͺΰΈ΄ΰΈ (GSB AI Lab) Β· ΰΉΰΈ«ΰΉ AI ΰΈΰΉΰΈ²ΰΈΰΉΰΈΰΈΰΈͺΰΈ²ΰΈ£ΰΉΰΈΰΈ’ ΰΈΰΈΰΉΰΈΰΈ£ΰΈ·ΰΉΰΈΰΈΰΈΰΈΰΈΰΉΰΈ£ΰΈ²ΰΉΰΈΰΈ
ΰΈ£ΰΈΈΰΉΰΈ Ledger ΰΈΰΉΰΈ²ΰΈΰΈ ΰΈ²ΰΈΰΉΰΈΰΈΰΈͺΰΈ²ΰΈ£ΰΈ ΰΈ²ΰΈ©ΰΈ²ΰΉΰΈΰΈ’ΰΉΰΈ₯ΰΈ°ΰΈΰΈ±ΰΈΰΈΰΈ€ΰΈ© ΰΉΰΈ₯ΰΉΰΈ§ΰΉΰΈΰΈ₯ΰΈΰΉΰΈΰΉΰΈ Markdown
βοΈ Disclaimer Β· ΰΈΰΈ²ΰΈΰΈ«ΰΉΰΈΰΈΰΉΰΈ₯ΰΉΰΈ
ΰΈΰΈ΅ΰΉΰΈΰΈ·ΰΈΰΉΰΈ§ΰΈΰΈ£ΰΉΰΈΰΈ±ΰΈΰΈΰΈΰΈ₯ΰΈΰΈΰΈΰΈ²ΰΈΰΈ«ΰΉΰΈΰΈΰΉΰΈ₯ΰΉΰΈΰΈ§ΰΈ΄ΰΈΰΈ±ΰΈ’ΰΈΰΈ±ΰΈΰΈΰΈ²ΰΈΰΈ£ΰΈ°ΰΈΰΈ΄ΰΈ©ΰΈΰΉΰΈΰΈΰΈΰΈΰΈΰΈ²ΰΈΰΈ²ΰΈ£ΰΈΰΈΰΈ‘ΰΈͺΰΈ΄ΰΈ
β¨ Overview
KaoOCR-Ledger reads a document page image and returns structured Markdown: headings, paragraphs and tables. 1.0c is the current release: OCR level with 1.0b at 54.0, and parsing +5.1 over 1.0a.
page image βββΊ vision encoder βββΊ autoregressive decoder βββΊ post-process βββΊ Markdown
| Family | KaoOCR Β· Ledger (document parsing, GPU) |
| Version | 1.0c |
| Parameters | 0.63B (vision encoder + autoregressive decoder) |
| Input | Document page image, or a single text-line crop |
| Output | Markdown (page mode) Β· plain text (line mode) |
| Languages | Thai, English |
| Fine-tuned from | KaoOCR-Ledger-1.0a |
Lineage
NVIDIA Nemotron 3.5 Parse
βββΊ KaoOCR-Ledger-1.0a (https://huggingface.co/kaopanboonyuen/KaoOCR-Ledger-1.0a)
βββΊ KaoOCR-Ledger-1.0b
βββΊ KaoOCR-Ledger-1.0c βββ you are here
The diagram shows release order. 1.0b and 1.0c were each fine-tuned from the 1.0a weights.
π Quick start
pip install -U huggingface_hub
hf download kaopanboonyuen/KaoOCR-Ledger-1.0c --local-dir KaoOCR-Ledger-1.0c
cd KaoOCR-Ledger-1.0c
pip install -r requirements.txt
python inference.py page.png # document page -> Markdown on stdout
python inference.py page.png -o page.md # ... saved to a file
python inference.py line.png --line # one handwriting line -> plain text
Run inference.py from inside the repo folder: the bundled nemotron_parse/ post-processor sits next to it. A GPU is recommended; --device cpu works but is slow.
For throughput, serve it with vLLM:
pip install -e ".[vllm,client]"
vllm serve . --served-model-name nemotron-parse --trust-remote-code
π Benchmark
Benchmark: ThaiOCRBench. Scores are 0β100, higher is better. NLS = 1 β normalised edit distance. TEDS is used for parsing pages whose ground truth has a table.
| Model | OCR (NLS) | Parsing (TEDS/NLS) |
|---|---|---|
| KaoOCR-Ledger-1.0a | 45.2 | 61.6 |
| KaoOCR-Ledger-1.0b | 54.0 | 67.6 |
| KaoOCR-Ledger-1.0c | 54.0 | 66.7 |
| OpenThai2.1-OCR-Markdown (reference) | 50.4 | 68.1 |
| typhoon-ocr2-2b (reference) | 55.8 | 63.6 |
OCR tasks Β· NLS (β KaoOCR Β· β reference)
typhoon-ocr2-2b ββββββββββββββββββββββ 55.8
KaoOCR-Ledger-1.0b ββββββββββββββββββββββ 54.0
KaoOCR-Ledger-1.0c ββββββββββββββββββββββ 54.0 β
OpenThai2.1-OCR-Markdown ββββββββββββββββββββ 50.4
KaoOCR-Ledger-1.0a ββββββββββββββββββ 45.2
Parsing tasks Β· TEDS/NLS (β KaoOCR Β· β reference)
OpenThai2.1-OCR-Markdown βββββββββββββββββββββββββββ 68.1
KaoOCR-Ledger-1.0b βββββββββββββββββββββββββββ 67.6
KaoOCR-Ledger-1.0c βββββββββββββββββββββββββββ 66.7 β
typhoon-ocr2-2b βββββββββββββββββββββββββ 63.6
KaoOCR-Ledger-1.0a βββββββββββββββββββββββββ 61.6
Ahead: parsing +3.1 vs typhoon-ocr2-2b, OCR +3.6 vs OpenThai2.1-OCR-Markdown.
Not ahead: OCR β1.8 vs typhoon-ocr2-2b, parsing β1.4 vs OpenThai2.1-OCR-Markdown.
c vs b. OCR is level at 54.0; parsing is β0.9 (66.7 vs 67.6). Pick c as the current release, b if parsing and tables are your main workload.
Numbers come from our own ThaiOCRBench run and scorers, not an official leaderboard. VQA and key-information tasks are not included. Deltas use unrounded scores, so they can differ by 0.1 from subtracting the rounded values. Please test on your own documents.
π¬ How it was made
1.0c is a fine-tune of KaoOCR-Ledger-1.0a, a handwriting-tuned, weight-blended (WiSE-FT) model. Tokenizer, runtime code (nemotron_parse/) and licence files are carried over unchanged.
π§© Model family
| Release | Ledger Markdown Β· GPU |
General plain text Β· CPU |
|---|---|---|
| 1.0a | KaoOCR-Ledger-1.0a | KaoOCR-General-1.0a |
| 1.0b | KaoOCR-Ledger-1.0b | KaoOCR-General-1.0b |
| 1.0c | KaoOCR-Ledger-1.0c β | KaoOCR-General-1.0c |
β οΈ Limitations
- Formulas, scene text and unusual layouts remain hard (inherited from the base architecture).
- Line mode (
--line) is for cropped single lines; page mode uses the native page-parsing prompt. - A speculative-decoding drafter, if present in the base repo, was not re-tested.
π License
OpenMDW-1.1 (derivative of NVIDIA Nemotron 3.5 Parse). Tokenizer terms are in TOKENIZER_ATTRIBUTION.md where present.
The 1.0a handwriting stage used iapp/thai_handwriting_dataset and sivakorn-su/thai-handwriting-textdisjoint-v1. They carry their own terms: check them before commercial use.
π Acknowledgements
Thai OCR moves forward because people share their work openly. We are proud to build on it, and we hope KaoOCR adds something useful back to the community.
- iApp Technology Β· for openly releasing OpenThai. KaoOCR-Ledger-1.0c descends, through KaoOCR-Ledger-1.0a, from
iapp/OpenThai2.1-OCR-Markdown-20261118. - Typhoon by SCB 10X Β· for pushing Thai OCR forward and for ThaiOCRBench, which we evaluate on.
- NVIDIA Β· for Nemotron 3.5 Parse, the architecture underneath.
- Downloads last month
- 65
Model tree for kaopanboonyuen/KaoOCR-Ledger-1.0c
Base model
nvidia/Nemotron-3.5-Parse