Our take
- Activity
- 20
- Community
- 18
- Issues
- 47
- Pull requests
- 21
+6 stars in the last 16 days
Overview
Ollama-OCR is a Python OCR tool that sends images and PDFs to vision-language models available through Ollama. It turns visual documents into text or structured output, with options for formats such as Markdown, JSON, tables, and key-value pairs.
It is intended for developers and users who want to run document extraction through an Ollama model rather than use a conventional OCR service. Choose it when you need a Python workflow or a local web interface, and can provide and run a compatible vision model.
Key Features
- Processes images and PDFs using vision models supported through Ollama.
- Provides a Python API for processing one file or batches of files.
- Offers output formats including Markdown, plain text, JSON, structured data, key-value pairs, and tables.
- Supports custom extraction prompts and a requested text language.
- Includes batch options for parallel processing, progress tracking, recursive file discovery, and image preprocessing.
- Provides a Streamlit web application with uploads, previews, batch processing, and downloadable results.
Use Cases
- Developers can add document text extraction to Python applications that already use Ollama.
- Teams can extract dates, names, or other specified fields from scans and images using custom prompts.
- Users processing folders of images can run batch extraction and review success and failure statistics.
- Analysts can turn tables, charts, and other visual document content into structured outputs for further use.
- Non-developers can try document extraction through the Streamlit interface instead of integrating the package directly.
Getting Started
Install the package:
pip install ollama-ocr
Install Ollama and pull a compatible vision model before processing files. See the README for model setup, usage examples, batch processing, and Streamlit instructions.
Alternatives
- Marker: Marker converts PDFs and images into structured formats with its own document-processing pipeline, rather than relying on Ollama-served vision-language models.
- PaddleOCR: PaddleOCR provides a production-oriented OCR and document AI engine with broad language support, rather than a workflow centered on Ollama VLMs.
| Project | Language | License | Stars | Status |
|---|---|---|---|---|
| Ollama-OCR | Jupyter Notebook | MIT | 2.8k | Not checked yet |
| marker | Python | Apache-2.0 | 40.2k | Active |
| PaddleOCR | Python | Apache-2.0 | 90.6k | Active |
Considerations
- OCR depends on an Ollama installation and a compatible vision-language model, which must be available separately.
- Output quality can vary by model. The README specifically cautions that LLaVA can sometimes produce incorrect output.
- Processing speed and resource needs depend on the chosen model and runtime; the repository does not provide benchmark figures.
- The repository reports Jupyter Notebook as its language, even though the documented package and web app are used from Python.
Found this useful?
Share it with someone who would like Ollama-OCR.