# Adding OCRia-1 to looksneat

> Source: <https://www.lukasrieder.com/blog/ocria-1-in-looksneat/>
> Published: 2026-11-27 16:15:00+00:00

**Key takeaway:** OCRia-1's original weights lack Qwen's normalization offset, so add it during conversion; the converter produces affine 4-bit MLX language weights in groups of 64 while the vision encoder stays in BF16, from a 10.37 GB source download.

# Adding OCRia-1 to looksneat

OCRia-1 shares a model architecture with Xiaomi. I reused the Rust/MLX runtime and added local weight conversion to looksneat.

- Published
- Reading time
- 3 min read

I added [OCRia-1](https://huggingface.co/llamaindex/OCRia-1/tree/489f5fa8f63858545368b9aff44256bbea6e46bc) to looksneat, my command-line OCR tool for Apple Silicon. LlamaIndex built it on Qwen3.5-4B to transcribe documents, including tables, charts and formulas. I wanted it to work through the same command as the other models, with inference inside the Rust process.

The adapter is in [v0.1.0-alpha.1](https://gitlab.com/parlant-co/looksneat/-/releases/v0.1.0-alpha.1). I have tested the runtime with synthetic tensors; the full OCRia checkpoint still needs an authorized run. I have no document results or performance measurements to share yet.

## Reusing the Xiaomi implementation

My [XIAOMI-OCR-0 port](https://www.lukasrieder.com/blog/xiaomi-ocr-in-looksneat/) already had the Qwen3.5 computation OCRia needed. I moved that code into a shared engine and made the model dimensions configurable. OCRia uses a larger vision encoder and a 32-layer language decoder. Both providers now use the same attention and recurrent code.

Weight preparation needed separate handling. The community Xiaomi checkpoint already includes Qwen’s normalization offset. OCRia’s original weights need that offset added during conversion. I kept conversion in setup so the recognizer can load prepared weights directly.

For batches and PDFs, I load the weights and tokenizer once and reuse them across pages. Each page gets fresh generation state. PDF pages arrive through looksneat’s existing lazy rasterizer, and recognition processes them in order. That keeps the model-loading cost out of the per-page work.

## Local conversion

I found a community MLX conversion, but its repository was gated. I could read the artifact metadata, while the configuration and tensors needed for verification required access. I chose to build a converter for the pinned upstream checkpoint.

Setup downloads about 10.37 GB of source files, checks their sizes and SHA-256 hashes, and converts the language weights to affine 4-bit MLX in groups of 64. The vision encoder stays in BF16. The converter runs in Rust through MLX, so installing this model adds no Python environment to maintain.

The initial download is substantial. Source weights and converted weights also coexist during setup. I delete the large source checkpoint after successful conversion and retain verified downloads after a failure so a retry can reuse them. Inference reads the prepared local files.

## Page transcription

LlamaIndex trained OCRia around a fixed transcription prompt. It asks for Markdown, HTML tables, LaTeX formulas and Mermaid diagrams. Charts are represented as tables of their data. I kept that prompt unchanged and disabled thinking as the publisher recommends.

The `document`, `table`, `formula` and `chart` selectors all send the same instruction. For an isolated table, the input is a crop:

```
looksneat --model ocria-1 --task table table-crop.png
```

A whole page goes through the same transcription call and comes back as one block. Looksneat preserves the generated markup and removes the outer Markdown fence. I left the publisher’s separate attention-based grounding pipeline out of this port, so OCRia blocks have no coordinates. The existing spatial engines can supply located regions.

## License and availability

OCRia’s [license](https://huggingface.co/llamaindex/OCRia-1/blob/489f5fa8f63858545368b9aff44256bbea6e46bc/LICENSE) restricts competing OCR and document-extraction products regardless of revenue, with an exception for research. It also has revenue and funding thresholds. This affects software such as looksneat; integration, distribution and intended use need licensing review with LlamaIndex.

Setup requires `--accept-ocria-license` to acknowledge those terms and confirm authorization. The flag grants no permission. The release contains the runtime and documentation; model weights remain external.

The Apple Silicon archive and checksums are on the [release page](https://gitlab.com/parlant-co/looksneat/-/releases/v0.1.0-alpha.1), along with signing and installation details. I recorded the conversion policy, supported options and remaining model tests in the [integration report](https://gitlab.com/parlant-co/looksneat/-/blob/v0.1.0-alpha.1/docs/ocria-1.md).
