Image-Text-to-Text
LiteRT-LM
LiteRT
multilingual
litertlm
on-device
edge
ocr
document-parsing
table-recognition
formula-recognition
vision-language
Instructions to use litert-community/Unlimited-OCR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT-LM
How to use litert-community/Unlimited-OCR with LiteRT-LM:
# LiteRT-LM runs on various platforms (Android, iOS, Windows, Linux, macOS, IoT, Web/WASM) # and supports many APIs (C++, Python, Kotlin, Swift, JavaScript, Flutter). # For platform-specific integration guides, please refer to the official developer website: # https://ai.google.dev/edge/litert-lm # To try LiteRT-LM, the easiest way is to use our CLI tool. # 1. Install the LiteRT-LM CLI tool: pip install -U litert-lm # 2. Download and run this model locally: # See: https://ai.google.dev/edge/litert-lm/cli # A single .litertlm file in the repo is picked automatically; otherwise the CLI asks which one to run # (or pass its name right after the repo id). litert-lm run \ --from-huggingface-repo=litert-community/Unlimited-OCR \ --prompt="Write me a poem"
- LiteRT
How to use litert-community/Unlimited-OCR with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Card: the fastest passing form on the phones, in place of the speed note
Browse files
README.md
CHANGED
|
@@ -21,7 +21,7 @@ base_model_relation: quantized
|
|
| 21 |
|
| 22 |
# Unlimited-OCR — LiteRT-LM (OCR)
|
| 23 |
|
| 24 |
-
On a Galaxy S26 this file reads a page in 18–22 s on the CPU, engine creation included (2026-11-15). This repository is a conversion of [baidu/Unlimited-OCR](https://huggingface.co/baidu/Unlimited-OCR) to LiteRT-LM (`.litertlm`), made with [hf-to-litertlm](https://github.com/john-rocky/hf-to-litertlm) for Google's [LiteRT-LM](https://github.com/google-ai-edge/LiteRT-LM) (tested with 0.19.2, and one page with 0.19.1).
|
| 25 |
|
| 26 |
[Unlimited-OCR](https://huggingface.co/baidu/Unlimited-OCR) (Baidu, 2026-06-22) is a 3.3B document-parsing model: a vision encoder (DeepEncoder: SAM ViT-B and CLIP-L, with a projector; 401M parameters) and a 12-layer DeepSeek-V2 text decoder (2.9B parameters; the first layer dense, then 11 mixture-of-experts layers of 64 routed experts, 6 per token, and 2 shared) with sliding-window attention: while it writes, each new token attends to the whole prompt and to the last 128 generated tokens. It writes a page as its layout blocks, each with a label (`title`, `text`, `equation`, `table`, …), a box and the block's content (in our tests, tables as HTML and formulas as LaTeX). This file reads one page per request, as one 1,024 × 1,024 view of 273 image tokens: the original's base setting, one of the two single-page settings in its README and the view it takes of each page of a multi-page document.
|
| 27 |
|
|
@@ -108,7 +108,7 @@ Peak is the process's peak resident memory (VmHWM). On the Galaxy S26 GPU row it
|
|
| 108 |
|
| 109 |
On the Mac each row holds four requests made on 2026-11-16 (LiteRT-LM 0.19.2 from PyPI on macOS 27.0, 4 threads for the decoder on the CPU, a runtime cache directory for each row): the page once with an empty cache directory (cold) and once with the cache written, the paragraph twice with the cache written; the Engine, First token, Decode and Peak cells give the range over the four. Each request started right after the model file, and for a cached request its cache files, had been read in full (untimed). Peak there is the process's peak memory footprint as `/usr/bin/time -l` reports it, not VmHWM. The CPU's slowest decode (32.3 tok/s) is the cold page request.
|
| 110 |
|
| 111 |
-
|
| 112 |
|
| 113 |
## Conversion notes
|
| 114 |
|
|
|
|
| 21 |
|
| 22 |
# Unlimited-OCR — LiteRT-LM (OCR)
|
| 23 |
|
| 24 |
+
On a Galaxy S26 this file reads a page in 18–22 s on the CPU, engine creation included (2026-11-15). This repository is a conversion of [baidu/Unlimited-OCR](https://huggingface.co/baidu/Unlimited-OCR) to LiteRT-LM (`.litertlm`), made with [hf-to-litertlm](https://github.com/john-rocky/hf-to-litertlm) for Google's [LiteRT-LM](https://github.com/google-ai-edge/LiteRT-LM) (tested with 0.19.2, and one page with 0.19.1).
|
| 25 |
|
| 26 |
[Unlimited-OCR](https://huggingface.co/baidu/Unlimited-OCR) (Baidu, 2026-06-22) is a 3.3B document-parsing model: a vision encoder (DeepEncoder: SAM ViT-B and CLIP-L, with a projector; 401M parameters) and a 12-layer DeepSeek-V2 text decoder (2.9B parameters; the first layer dense, then 11 mixture-of-experts layers of 64 routed experts, 6 per token, and 2 shared) with sliding-window attention: while it writes, each new token attends to the whole prompt and to the last 128 generated tokens. It writes a page as its layout blocks, each with a label (`title`, `text`, `equation`, `table`, …), a box and the block's content (in our tests, tables as HTML and formulas as LaTeX). This file reads one page per request, as one 1,024 × 1,024 view of 273 image tokens: the original's base setting, one of the two single-page settings in its README and the view it takes of each page of a multi-page document.
|
| 27 |
|
|
|
|
| 108 |
|
| 109 |
On the Mac each row holds four requests made on 2026-11-16 (LiteRT-LM 0.19.2 from PyPI on macOS 27.0, 4 threads for the decoder on the CPU, a runtime cache directory for each row): the page once with an empty cache directory (cold) and once with the cache written, the paragraph twice with the cache written; the Engine, First token, Decode and Peak cells give the range over the four. Each request started right after the model file, and for a cached request its cache files, had been read in full (untimed). Peak there is the process's peak memory footprint as `/usr/bin/time -l` reports it, not VmHWM. The CPU's slowest decode (32.3 tok/s) is the cold page request.
|
| 110 |
|
| 111 |
+
On the Galaxy S26 and the Pixel 11 Pro, this file on the CPU is the fastest form we found that passes our tests (with the near-tie rule in Correctness). The GPU took longer per page on both phones and missed 5 tests, and a version with the decoder's routed experts in int4 was faster on the Pixel 11 Pro's CPU but missed the second receipt photo at a token that is not a near tie.
|
| 112 |
|
| 113 |
## Conversion notes
|
| 114 |
|