Skip to main content

What is DeepSeek OCR (Ollama)?

DeepSeek OCR with Ollama backend provides a simple, easy-to-use OCR solution that runs locally through Ollama. Perfect for users who want high-quality OCR without complex GPU setups.

Usage

from upsonic.ocr import OCR
from upsonic.ocr.layer_1.engines import DeepSeekOllamaOCREngine
# Also available: from upsonic.ocr import DeepSeekOllamaOCREngine

# Create DeepSeek Ollama engine
engine = DeepSeekOllamaOCREngine(
    host="http://localhost:11434",
    model="deepseek-ocr:3b",
    rotation_fix=True
)

# Create OCR orchestrator
ocr = OCR(layer_1_ocr_engine=engine)

# Extract text from image or PDF
text = ocr.get_text('document.pdf')
print(text)

Parameters

ParameterTypeDefaultDescription
hoststr"http://localhost:11434"Ollama server host URL
modelstr"deepseek-ocr:3b"Ollama model name to use
promptstr"<image>\nFree OCR."OCR prompt template

Features

  • Simple Setup: Just install Ollama and pull the model
  • Local Processing: All processing happens on your machine
  • Multi-language Support: Supports 20+ languages including English, Chinese, Japanese, Korean