Ollama and OCR
This section configures the engine that gives AnyText its “meaning”: semantic search, answers to questions, image descriptions and recording transcripts. This is also where the languages for recognising text on scans are set — but the recognition itself (OCR) works without Ollama: it is handled by Tesseract, built into AnyText.
What Ollama is and what a model is
Ollama is a free program that AnyText uses to work with neural network models. It is installed on your computer and runs the models on it too: neither documents nor questions are sent anywhere.
A model is a program trained on an enormous amount of text that “understands” language: it can find meaning in what is written, answer questions, and some models can also look at images or listen to recordings. A model is a file several gigabytes in size; it is downloaded once and then works without the internet.
Put simply: Ollama is like a player, and the model is what is played in it. AnyText passes your documents and questions to the model, and the model returns the result: pieces of text similar in meaning, an answer, an image description or a recording transcript.
If Ollama is not installed or the needed model is missing, AnyText searches by exact words and recognises scans and images with the built-in Tesseract — nothing needs to be installed for that. Without Ollama, only semantic search, answers to questions, image descriptions and recording transcripts are missing.
Why AnyText needs Ollama
AnyText uses models for four different jobs:
- Semantic search — the embedding model turns text into numbers (vectors), which are used to find similar things. This is what distinguishes search “in your own words” from exact word search.
- Answers to questions — the answer model reads the found document fragments and writes an answer with references to them.
- Image descriptions — a vision model looks at an image and describes it.
- Recording transcripts — a model with hearing turns wav, mp3, flac into text.
For each job there is its own model and its own settings section. Only the first, the search one, is configured here.
Speed: graphics card and processor
Models work well on a graphics card (GPU): if the computer has a suitable graphics card, the answer comes in seconds. If there is no graphics card, everything is computed on the processor — it will work, but noticeably slower.
The recommended models are chosen so that together they fit into 8 GB of graphics card memory. If your graphics card is weaker or you have none, take the smaller models from the list below — they are lighter and faster, although they answer more simply.
Models come in different sizes
Models differ in size, and that is the main trade-off:
- Small and light — answer quickly and take less memory, but understand worse: they can get confused in long text and answer more simply.
- Large and powerful — understand better and answer more precisely, but need more memory and time.
We tested the available models and chose those that give the best balance of quality and computer requirements for AnyText’s tasks. These are the ones AnyText offers — but the model field accepts any name, and an experienced user can install their own model.
What is configured here
- Ollama address — where the engine runs. Usually
http://localhost:11434; change it only if Ollama is on another computer. - Search model (embeddings) — the model that turns text into vectors. By default
embeddinggemma:latest. Buttons: “Download the model” — install it if the engine does not know it yet; “Test” — make sure the engine sees it; “Save” — remember the choice. - OCR languages — the languages in which the text on scans and photographs is written, separated by commas:
eng,rus.
If you change the search model
Vectors computed by one model cannot be compared with vectors from another. That is why, when the model changes, AnyText will offer to rebuild the indexes of all collections. It is not quick — the text is read and computed again — but otherwise semantic search stops finding anything.
What we recommend
- Search model —
embeddinggemma:latest. Compact, fast and local. - Answer model —
gemma4:e4bto save resources and get quick answers (about 6.6 GB),deepseek-r1:8bfor more precise answers (needs more memory and works slowly without a graphics card). - Image description model —
gemma4:e4borgemma4:e2b. - Transcription model —
gemma4:e4borgemma4:e2b.
Local or in the cloud
Models run in two ways:
- Local (
embeddinggemma,gemma4,deepseek-r1and others without a suffix) — run on your computer, documents, images and recordings are not sent anywhere. This is the default choice. - Cloud (marked
:cloud) — run on Ollama’s servers, an account and subscription are needed. Images then go to the cloud, and cloud models do not listen to recordings at all, so they are not suitable for AnyText.
AnyText is built so that everything that can work locally does.
OCR: text from scans and photographs
OCR is the recognition of text in images: scans, photographs of documents, screenshots with text. It is handled by Tesseract, which is built into AnyText — nothing needs to be installed, only the languages specified.
The languages eng and rus are built into AnyText. Keep only those that really occur in your documents: the fewer languages, the faster and more precise the recognition.
Example: install a search model
- Settings → “Ollama and OCR”.
- Make sure the address field contains
http://localhost:11434— that is the engine on your computer. - In the “Search model (embeddings)” field, leave
embeddinggemma:latest. - Click “Download the model” and wait for the download to finish.
- Click “Test” — AnyText will report that the engine sees the model.
- Click “Save”.
What you get: semantic search starts working. If you later install a different search model, AnyText will offer to rebuild the collection indexes — old vectors are not comparable with the new model.
Example: find text printed on a scan
- Put a scan of a contract (a PDF or an image with text) into the collection folder.
- Settings → “Collections” → next to the collection, click “Scan (changed)”.
- Nothing else needs to be turned on: the text from the image is recognised during the scan. The recognition languages are here too, in the “OCR languages” field (
eng,rus). - Go back to the search and type a word that is in the contract but appears only on the scan.
What you get: the word is found — OCR read it.