Skip to content

Ollama OCR

Ollama OCR reads the text in images and PDF documents with an Ollama model that can see, either on your own Ollama server or on Ollama Cloud. It can enhance the image before reading it and follow your instructions about what to extract.

When to use it

  • Reading scanned invoices or delivery notes to record their data.
  • Getting the text from photos of documents that arrive on WhatsApp or by email.
  • Extracting specific fields from a form, such as the name and the amount.
  • You want to read documents with a model running on your own server.

Configuration

For Ollama Cloud you need an Ollama Cloud API credential; with your own server it is not needed. See Credentials.

FieldWhat it does
Ollama Base URL (required)Your Ollama server address or https://ollama.com (default) for Ollama Cloud.
CredentialThe Ollama Cloud API credential. Only with Ollama Cloud.
Model NameThe vision model. Press the refresh button to see those available.
OCR Prompt (required)What the model must do with the document. Default: “Read all the text in the image.”. You can ask, for example, for only certain fields.
Image/PDF InputThe image or PDF to read, for example the output of Binary or of a component that loads files.
Draw Bounding BoxesIf you ask in OCR Prompt for each text’s position, it also returns the image with the boxes drawn. Off by default.
Process PDF PagesReads each page of a PDF as a separate image. On by default.
Enhance ImagesEnhances the image before reading it, only when needed. On by default and recommended.

Advanced options

FieldWhat it does
PDF DPIResolution used to convert PDF pages. Default: 300.
Gentle ContrastSlightly raises the contrast of low-quality images. On by default.
Subtle SharpenSlightly sharpens the image. On by default.
Binarize (Black & White)Turns the image into pure black and white. Off by default and not recommended. Binarize Threshold sets the threshold; 0 computes it automatically.
Max TokensMaximum length of the answer. Default: 4096.
TemperatureHow creative the model is, from 0 to 1. Default: 0.1.

Output

The OCR Results output holds the text read from each image or page.

In tool mode, an agent can use the component by itself. See Tool Mode.

Example

A municipal archive wants to digitise documents without sending them outside.

  1. Type its Ollama server address in Ollama Base URL and choose a vision model.
  2. Connect the documents to Image/PDF Input and save OCR Results.