Instructions to use prithivMLmods/OCRia-1-MTP-Repacked with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/OCRia-1-MTP-Repacked with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="prithivMLmods/OCRia-1-MTP-Repacked") 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("prithivMLmods/OCRia-1-MTP-Repacked") model = AutoModelForMultimodalLM.from_pretrained("prithivMLmods/OCRia-1-MTP-Repacked", 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 prithivMLmods/OCRia-1-MTP-Repacked with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/OCRia-1-MTP-Repacked" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/OCRia-1-MTP-Repacked", "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/prithivMLmods/OCRia-1-MTP-Repacked
- SGLang
How to use prithivMLmods/OCRia-1-MTP-Repacked 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 "prithivMLmods/OCRia-1-MTP-Repacked" \ --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": "prithivMLmods/OCRia-1-MTP-Repacked", "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 "prithivMLmods/OCRia-1-MTP-Repacked" \ --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": "prithivMLmods/OCRia-1-MTP-Repacked", "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 prithivMLmods/OCRia-1-MTP-Repacked with Docker Model Runner:
docker model run hf.co/prithivMLmods/OCRia-1-MTP-Repacked
OCRia-1-MTP-Repacked
OCRia-1 is a 4B-parameter vision-language model developed by LlamaIndex on top of Qwen3.5-4B for high-fidelity single-page document parsing directly from page images without external OCR engines or text layers. Trained on 100,979 real and synthetic pages via supervised fine-tuning, GRPO reinforcement learning with verifiable dimension-specific rewards, and checkpoint averaging, it transcribes complex documents into structured Markdownβconverting multi-level and merged-cell tables (
colspan/rowspan) as well as plot charts into HTML<table>elements, diagrams into Mermaid blocks, math and handwriting into LaTeX, and fine-grained formatting (strikethrough, underlines, highlights, checkboxes, page furniture, and watermarks) into semantic tags, with optional post-hoc visual grounding viaocria_grounding. Ranking as the top open-weight model on both ParseBench 2 (85.24 overall across 4,317 pages) and ParseBench 1 (84.65 overall across 2,078 pages, scoring 82.47 on charts), it is distributed in unoptimized BF16 weights (10.35 GB) forvLLM,Transformers, andOllamaunder the custom OCRia-1 Model and Code License (free for research, personal use, and non-competing organizations under $2M in annual revenue and funding).
This repository contains the MTP-repackaged BF16 weights of OCRia-1 | The GGUF (MTP-supported) is available here β https://huggingface.co/prithivMLmods/OCRia-1-GGUF
For other inference setups, kindly refer to the original model card β https://huggingface.co/llamaindex/OCRia-1. It is recommended to follow the system message prompt.txt without providing any user text, with thinking turned off.
MTP-Repacked [Transformers, BF16]
| File Name | File Type | File Size | File Link | Description |
|---|---|---|---|---|
| chat_template.jinja | Jinja Template | 7.76 kB | Link | Chat template for formatting conversations and prompts. |
| config.json | JSON | 2.89 kB | Link | Core model architecture and configuration parameters. |
| generation_config.json | JSON | 204 Bytes | Link | Default text generation parameters (e.g., temperature, top_p). |
| model.safetensors | Safetensors | 10.6 GB | Link | Unsharded model weights. Required to load the model. |
| processor_config.json | JSON | 1.3 kB | Link | Configuration for the multimodal (vision/OCR) processor. |
| tokenizer.json | JSON | 20 MB | Link | Complete tokenizer vocabulary and encoding rules. |
| tokenizer_config.json | JSON | 1.1 kB | Link | Tokenizer-specific configuration parameters. |
License and Attribution
This model is based on and/or incorporates the following open-source projects and models:
- Qwen3.5-4B (Base): https://huggingface.co/Qwen/Qwen3.5-4B (licensed under the Apache License 2.0)
- OCRia-1: https://huggingface.co/llamaindex/OCRia-1
This model is released under the ocria-1-license.
- Downloads last month
- -