Model reference · open weights

AksonOCR-Lite

LLMs Remtir Image→text 1 build Open weights 1k dl/mo

AksonOCR-Lite is an open-weight language model from Remtir.

For self-hosting, compare this build's requirements below with the GPU you plan to rent.

  • AksonOCR-Lite is an open-source image-to-text model by Remtir designed for Thai document OCR.
  • It converts PDFs and images into Markdown, plain text, or JSON with layout blocks and tables.
  • The model supports Thai and English, uses an Apache-2.0 license, and has 81M parameters.

Summary of the Remtir/AksonOCR-Lite model card, 2026-11-20

What it is

Released byRemtir
Released2026-11-16

From the model card

What Remtir says about AksonOCR-Lite

Read the model card

Fast, open-source Thai document OCR with a grapheme-cluster CTC recognizer. Turns PDFs and images into Markdown, plain text or JSON with layout blocks, reading order, text-line boxes and tables. Runs on ONNX Runtime, on CPU or GPU, with no PyTorch or Paddle install.

Try it in your browser → Upload a page image or PDF (up to 7 MB) and see the Markdown, layout and tables. No install.

81M params, runs on CPU: ~3× faster per page than 2B-param OCR VLMs on a GPU, and more accurate than VLMs on average across MDPBench, ThaiOCRBench and SEA-DocBench (benchmarks).

pip install git+https://github.com/Remtir/AksonOCR-Lite
aksonocr invoice.pdf > invoice.md
  • Thai first: the text recognizer is trained for Thai (with English), predicting whole grapheme clusters so stacked vowels and tone marks come out in the right order.
  • Document structure: 25 layout classes (titles, paragraphs, tables, figures, headers/footers, ...) and reading order from PP-DocLayoutV3; tables become HTML with row/column spans.
  • Photos too: page-orientation correction, upside-down line detection, and optional page dewarping.
  • Light: about 330 MB of weights by default (≈620 MB with dewarping), fetched from the Hugging Face Hub on first run.

Benchmarks

MDPBench-th 85.6 with --dewarp (79.5 default) · ThaiOCRBench DP 0.640 · SEA-DocBench-th text NED 0.058 · 1.5 s per page on CPU only.

Averages over MDPBench-th, ThaiOCRBench Document parsing and SEA-DocBench-th. Full benchmark → per-benchmark charts, default vs --dewarp, speed tables, text recognition only.

Requirements

Python3.10 or newer (CI tests 3.10 and 3.13)
OSLinux, macOS (Apple Silicon). Windows is untested so far.
HardwareAny x86-64 or ARM64 CPU. No GPU needed; NVIDIA GPU optional (see GPU).
RAMabout 1.3 GB peak for one page, about 2.8 GB with --dewarp
Diskabout 330 MB of model weights, plus 290 MB for --dewarp, in the Hugging Face cache (~/.cache/huggingface)
Networkonly on first run, to download the weights. Use AKSONOCR_WEIGHTS for fully offline machines.

No PyTorch, Paddle or system packages are needed. pip installs everything else: onnxruntime, numpy, opencv-python-headless, pillow, pypdfium2 (PDF rendering), pyclipper, shapely and huggingface_hub.

For the GPU build (onnxruntime-gpu): an NVIDIA driver with CUDA 12 and cuDNN 9, the versions current onnxruntime-gpu wheels are built against.

Usage

Command line

aksonocr page.jpg                        # Markdown to stdout
aksonocr report.pdf --out out/           # out/report.md (every page of the PDF)
aksonocr scan.png -f json -o out/        # boxes, blocks, lines, confidences
aksonocr photo.jpg --dewarp              # flatten a photographed / curled page
aksonocr doc.pdf --device cpu --dpi 200 --max-pages 10

Python

import aksonocr_lite

conv = aksonocr_lite.load()                 # device="auto" | "cpu" | "cuda", dewarp=False, tables=True, ...
for page in conv.convert("report.pdf"):     # path, bytes, PIL.Image or BGR numpy array
    print(page.markdown)
    for block in page.blocks:               # reading order
        print(block.label, block.bbox, block.text or block.html)
    for line in page.lines:
        print(line.text, line.confidence, line.poly)

lines = conv.ocr(bgr_image)                  # text lines only, no layout

Page fields: markdown, text, blocks (label, bbox, score, order, text, html, line_ids), lines (text, confidence, bbox, poly), rotation, dewarped, width, height, timings. All coordinates are in the pixel space of the (rotated, dewarped) page image.

GPU

The default install runs on CPU, on Linux and macOS (Apple Silicon). For CUDA, swap ONNX Runtime for its GPU build:

pip uninstall -y onnxruntime && pip install onnxruntime-gpu

device="auto" then picks CUDA. Inputs have variable shapes, so the CPU path is often just as fast for single pages; the GPU pays off mostly with dewarping and large batches.

Offline / custom weights

Set AKSONOCR_WEIGHTS=/path/to/dir to load models from a local folder instead of the Hub. It must contain layout.onnx det.onnx doc_ori.onnx textline_ori.onnx rec.onnx rec_charset.json tatr.onnx, plus dewarp_mask.onnx dewarp_grid.onnx for --dewarp.

How it works

page image ─┬─ (dewarp: MonkeyOCRv2 preprocessor)            optional
            ├─ page orientation: PP-LCNet doc_ori             0/90/180/270
            ├─ layout + reading order: PP-DocLayoutV3        ┐
            ├─ text lines: PP-OCRv6_medium_det (DB)           │ run on the same page
            │    └─ line orientation (PP-LCNet textline_ori)  │
            │    └─ recognition: AksonOCR Thai CTC (+180° re-read, keeps the more confident reading)
            ├─ tables: re-detect text in the crop → TATR v1.1 grid → fill cells with OCR lines → HTML
            └─ merge: each line → the layout block holding its centre (nearest block as fallback),
                      blocks in reading order → Markdown

Thai recognizer: grapheme-cluster CTC

Thai stacks vowels and tone marks on the consonant, so one glyph can be 2–3 code points (ผู้ = ผ + ู + ้). Instead of emitting them one by one, the recognizer predicts the whole cluster as one token.

  • Correct order, always: marks inside a cluster always come out in Unicode order, never swapped.
  • No impossible output: only real clusters are in the vocabulary (2,149 of 2,455 classes).
  • Shorter sequence: one token per glyph (15 vs 22 on the line above).
  • Tiny and fast: 1.5M parameters, 88.6% exact match at 8 ms per line on one CPU thread (comparison).

Details worth knowing:

  • Text

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms