Instructions to use altslate/indic-ocr-0.9b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use altslate/indic-ocr-0.9b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="altslate/indic-ocr-0.9b", 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("altslate/indic-ocr-0.9b", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("altslate/indic-ocr-0.9b", trust_remote_code=True, device_map="auto") 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?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use altslate/indic-ocr-0.9b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "altslate/indic-ocr-0.9b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "altslate/indic-ocr-0.9b", "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/altslate/indic-ocr-0.9b
- SGLang
How to use altslate/indic-ocr-0.9b 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 "altslate/indic-ocr-0.9b" \ --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": "altslate/indic-ocr-0.9b", "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 "altslate/indic-ocr-0.9b" \ --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": "altslate/indic-ocr-0.9b", "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 altslate/indic-ocr-0.9b with Docker Model Runner:
docker model run hf.co/altslate/indic-ocr-0.9b
indic-ocr-0.9b
An OCR model for printed text in Indian languages: give it an image of a text block (a paragraph, a few lines, a heading) and it returns the text. 0.9B parameters, fine-tuned from PaddleOCR-VL-1.6, and licensed Apache-2.0 with no use or revenue restrictions.
On the Sarvam Indic OCR Bench (23 languages, 22 Indian + English):
- it is ahead of Patram 1.5 (7B), a model about eight times its size, on both the representative split (62.3 vs 46.0 word accuracy) and the full 6,908-block test (63.8 vs 47.0), and on 21 of 23 languages in each (not English or Nepali);
- it reads Manipuri in Meetei Mayek (56.0 word accuracy, full test) and Santhali in Ol Chiki (36.4) on this bench, where both Patram 1.5 and Surya OCR 2.5 score 0โ14;
- it is behind Surya OCR 2.5 (689M; weights under a modified OpenRAIL-M licence with a revenue cap) overall: 63.8 vs 67.1 on the full test. It is ahead of Surya on 9 of 23 languages (Telugu, Tamil, Bodo, Konkani, Maithili, Nepali, English, Manipuri, Santhali) and well behind on Urdu, Odia, Malayalam, Kannada and Punjabi. Use Surya if those scripts matter most to you and its licence fits.
It reads one block at a time. It does not do layout analysis: crop the page into blocks first (any layout model, or a simple line/paragraph splitter), then send each block.
Usage
vLLM (recommended)
Tested with vllm/vllm-openai:v0.32.0:
vllm serve altslate/indic-ocr-0.9b --served-model-name ocr --trust-remote-code --max-model-len 8192 \
--limit-mm-per-prompt '{"image": 1}'
import base64, requests
img = base64.b64encode(open("block.png", "rb").read()).decode()
r = requests.post("http://localhost:8000/v1/chat/completions", json={
"model": "ocr", "temperature": 0, "max_tokens": 2048,
"messages": [{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{img}"}},
{"type": "text", "text": "OCR:"}]}]})
print(r.json()["choices"][0]["message"]["content"])
transformers (โฅ 5.0)
Tested with transformers 5.23.0 and torch 2.14:
import torch
from PIL import Image
from transformers import AutoProcessor, AutoModelForImageTextToText
model = AutoModelForImageTextToText.from_pretrained("altslate/indic-ocr-0.9b", dtype=torch.bfloat16).to("cuda").eval()
processor = AutoProcessor.from_pretrained("altslate/indic-ocr-0.9b")
image = Image.open("block.png").convert("RGB")
messages = [{"role": "user", "content": [{"type": "image", "image": image}, {"type": "text", "text": "OCR:"}]}]
inputs = processor.apply_chat_template(messages, add_generation_prompt=True, tokenize=True, return_dict=True,
return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=1024, do_sample=False, repetition_penalty=1.05)
print(processor.decode(out[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
The prompt is always OCR:. The model was trained only on that task; the other PaddleOCR-VL prompts (tables, formulas, charts)
were not trained further and may have degraded.
Results
Sarvam Indic OCR Bench, scored with the benchmark's own metrics.py --normalize. Word accuracy = 100 ร (1 โ WER), averaged
over blocks. All models were run by us, in the same harness, greedy decoding:
- this model: vLLM v0.32.0, prompt
OCR:; - Patram 1.5 7B: vLLM v0.30.0 with BharatGen's own vLLM patch and chat template, a plain "transcribe exactly" prompt;
- Surya OCR 2.5: vLLM v0.30.0, Surya's own block prompt, image resizing and sampling settings from the
surya-ocrpackage (0.24.0), its HTML output converted to plain text. (On vLLM v0.32.0 Surya returned empty output for 59% of blocks, so we used v0.30.0; its valid-block word accuracy there, 70.0, matches the number Sarvam publishes for it.)
The benchmark's word_accuracy leaves out blocks with an empty prediction. This model and Patram had none on either split; Surya had 6
(representative split) and 46 (full test), so its numbers are very slightly flattered.
Overall
| Split | Model | Params | Licence | Word acc | Valid-block word acc | Valid-block CER | Loops |
|---|---|---|---|---|---|---|---|
| representative (1,173 blocks) | indic-ocr-0.9b | 0.9B | Apache-2.0 | 62.3 | 65.2 | 0.165 | 55 |
| representative | Patram 1.5 | 7B | Apache-2.0 | 46.0 | 50.2 | 0.279 | 102 |
| representative | Surya OCR 2.5 | 0.7B | OpenRAIL-M (modified) | 63.9 | 66.9 | 55 | |
| full test (6,908 blocks) | indic-ocr-0.9b | 0.9B | Apache-2.0 | 63.8 | 67.2 | 0.148 | 386 |
| full test | Patram 1.5 | 7B | Apache-2.0 | 47.0 | 50.7 | 0.271 | 534 |
| full test | Surya OCR 2.5 | 0.7B | OpenRAIL-M (modified) | 67.1 | 70.0 | 291 |
"Loops" = blocks the benchmark flags as repetition loops or catastrophic output; "valid-block" columns leave those out.
Wall-clock for the 6,908-block full test in the same harness on one NVIDIA GB10 (DGX Spark), vLLM: this model 11 min (10.3 blocks/s) and Surya OCR 2.5 17 min (6.9 blocks/s), both with 32 concurrent requests; Patram 1.5 6.4 h (0.3 blocks/s) with 16 (7B needs more memory). A rough indication from our runs, not a tuned speed benchmark.
Per language, representative split (word accuracy)
| Language | indic-ocr-0.9b | Patram 1.5 7B | Surya OCR 2.5 |
|---|---|---|---|
| Assamese | 66.6 | 40.4 | 76.5 |
| Bengali | 70.7 | 56.8 | 76.2 |
| Bodo | 63.2 | 44.4 | 52.5 |
| Dogri | 56.2 | 44.5 | 57.0 |
| English | 94.8 | 97.5 | 95.3 |
| Gujarati | 65.4 | 50.3 | 60.5 |
| Hindi | 80.1 | 77.9 | 85.2 |
| Kannada | 65.5 | 36.5 | 74.7 |
| Kashmiri | 22.1 | 7.8 | 28.3 |
| Konkani | 82.2 | 71.6 | 77.6 |
| Maithili | 79.9 | 59.1 | 77.7 |
| Malayalam | 50.7 | 48.3 | 73.4 |
| Manipuri (Meetei Mayek) | 55.8 | 0.0 | 0.0 |
| Marathi | 80.9 | 75.4 | 85.1 |
| Nepali | 76.6 | 77.3 | 77.4 |
| Odia | 34.3 | 18.1 | 60.9 |
| Punjabi | 75.6 | 51.7 | 84.7 |
| Sanskrit | 46.2 | 37.6 | 46.9 |
| Santhali (Ol Chiki) | 37.3 | 17.2 | 5.1 |
| Sindhi | 71.9 | 64.0 | 77.9 |
| Tamil | 77.3 | 53.0 | 79.0 |
| Telugu | 76.4 | 41.1 | 69.3 |
| Urdu | 52.2 | 28.8 | 77.3 |
Per language, full test (word accuracy)
| Language | indic-ocr-0.9b | Patram 1.5 7B | Surya OCR 2.5 |
|---|---|---|---|
| Assamese | 79.2 | 45.1 | 83.7 |
| Bengali | 75.3 | 54.4 | 78.4 |
| Bodo | 70.7 | 48.2 | 57.7 |
| Dogri | 62.7 | 47.8 | 64.8 |
| English | 95.8 | 97.3 | 94.6 |
| Gujarati | 59.1 | 43.9 | 60.8 |
| Hindi | 77.9 | 77.5 | 83.0 |
| Kannada | 63.1 | 39.4 | 73.4 |
| Kashmiri | 21.6 | 6.8 | 26.3 |
| Konkani | 88.7 | 75.6 | 78.5 |
| Maithili | 81.0 | 62.4 | 71.1 |
| Malayalam | 50.5 | 48.6 | 73.7 |
| Manipuri (Meetei Mayek) | 56.0 | 0.0 | 0.0 |
| Marathi | 79.0 | 76.4 | 83.9 |
| Nepali | 81.9 | 83.0 | 78.2 |
| Odia | 37.8 | 16.9 | 65.3 |
| Punjabi | 69.1 | 47.9 | 79.2 |
| Sanskrit | 46.2 | 32.7 | 57.0 |
| Santhali (Ol Chiki) | 36.4 | 14.3 | 9.8 |
| Sindhi | 77.4 | 65.4 | 83.3 |
| Tamil | 78.7 | 57.7 | 77.1 |
| Telugu | 74.3 | 39.9 | 66.0 |
| Urdu | 55.5 | 27.9 | 82.2 |
Limitations
- Weak on Odia and Malayalam (38 and 51 word accuracy on the full test), and well behind Surya on Urdu (56 vs 82), Kannada and Punjabi. Real print was added only for Malayalam, Kannada, Odia, Telugu, Gujarati and Punjabi; Urdu and the rest are still trained on synthetic renders only.
- Script confusion: on a few Telugu pages it still writes Kannada script (22 of 300 full-test Telugu blocks are mostly Kannada script, down from 114 in the first release), and on some Santhali pages it confuses Ol Chiki with Meetei Mayek. Check the output script if this matters.
- Small regressions vs the first release (full test): English 97.2 โ 95.8, Manipuri 60.0 โ 56.0, Sindhi 79.5 โ 77.4,
Dogri 64.1 โ 62.7. The first release is kept under the
v4tag (revision="v4"). - Repetition loops on about 6% of full-test blocks (386 of 6,908), mostly long or very dense blocks. Use
repetition_penaltyaround 1.05 and amax_tokenslimit; split very long blocks. - Printed text only. Not trained on handwriting, tables, formulas or scene text.
- Blocks, not pages. Full pages exceed what it was trained on; crop first.
- Kashmiri (20 word accuracy) is not usable yet.
Training
Six rounds of full fine-tuning from PaddleOCR-VL-1.6 (8k + 6k + 3k + 2k steps on synthetic data, then 4k + 3k steps on real print plus synthetic replay; batch 8, lr 1e-5, cosine schedule, loss on the answer only). Checkpoints were chosen only on our own dev sets: a synthetic dev set (held-out fonts and sentences) and real-print strips from Wikisource books held out of training (1,411 strips, whole books). The Sarvam benchmark was used for evaluation only, never for training or checkpoint selection.
Real print (rounds 5โ6): about 42k text blocks cut from page scans of public-domain and CC-licensed books on Malayalam, Kannada, Odia, Telugu, Gujarati and Punjabi Wikisource, paired with the human-proofread text of the same page (Wikisource text: CC BY-SA 4.0; scans: public domain or CC, recorded per page; pages without a free scan licence were skipped). Text lines were found from the ink profile; our own earlier model's OCR was used only to locate each block's span in the proofread page, and the label is the proofread text, never the OCR. Blocks whose OCR disagreed too much with the matched span, or that contained lines absent from the page text (headers, page numbers, footnotes), were dropped. Test-leak guard: any block sharing a 6-word sequence with the benchmark's ground truth for its language was removed.
Synthetic data (rounds 1โ4, and replayed in 5โ6), rendered with Pillow + raqm (HarfBuzz shaping) with scan-like degradations (noise, blur, rotation, low-resolution rescans, an "old print" profile with faded ink, bleed-through and speckle):
- text: Dakshina native-script Wikipedia sentences (train split; CC BY-SA 4.0), the Indic side of allenai/nllb (ODC-BY 1.0), Wikipedia 20231101 dumps for Assamese, Odia, Nepali, Maithili, Sanskrit, Konkani, Santhali, Manipuri and Kashmiri (CC BY-SA 4.0), English sentences from allenai/nllb;
- fonts: open fonts from Google Fonts (OFL) and Indic print fonts from the Ubuntu archive (Lohit, SMC, Samyak, Gubbi, Kalapi, Uniol and others; OFL or GPL with the font exception). Fonts were used to render training images and are not redistributed;
- mixed-script blocks: English words and lines inside Indic text, each word drawn in a font of its own script, and bilingual blocks that alternate lines of two languages (Santhali and Manipuri with Bengali, the others with English);
- test-leak guard: every sentence that appears in the benchmark's ground truth for its language was removed before rendering.
No closed or proprietary models were used to make the data.
Versions
| Revision | Full-test word acc | Notes |
|---|---|---|
main (Nov 30, 2026) |
63.8 | + real print for ml/kn/or/te/gu/pa |
v4 (Nov 28, 2026) |
59.2 | first release, synthetic data only |
Licence
Apache-2.0, the same as the base model. The training text came from CC BY-SA 4.0 and ODC-BY 1.0 sources, and the real-print images from public-domain and CC-licensed scans; no text or images are distributed with the model.
Citation
If you use it, please cite this repository and the base model, PaddleOCR-VL (PaddlePaddle). Benchmark: Sarvam AI, Indic OCR Bench.
- Downloads last month
- 138
