Top 200 ReposEXPLORER
Browse agents, categories and pages
Back to results
Reported by sourceThe source says this happened. Top 200 Repos has not reproduced it.

Extract invoice fields locally with a vision model on Ollama

Stephen Sebastian replaced a paid cloud OCR API with Gemma 4 E4B on Ollama to pull date, amount and description from contractor invoice photos on his laptop.

The problem

How it works

He pulled gemma4:e4b through Ollama and called it from a Python script on an M1 MacBook Pro with 16GB RAM to extract three fields from photographed and scanned contractor invoices, some handwritten. He compared the results with his cloud OCR service on 50 real invoice photos and added an OpenCV contrast-enhancement step.

Results and limitations

He reports 91% exact-match field accuracy locally against 94% for the cloud API, rising to 95% with preprocessing, at about 2.3 seconds per image versus 4.2 seconds in the cloud, removing a bill he puts at roughly $50 a month.

Before you try it

Small test set and thinly described scoring; the cloud service stayed ahead on difficult handwriting, and blurry or dark images can yield invented values. The post discloses AI help with its prose, and this is a scripted model call rather than an autonomous agent. No year is shown on the post date.

Tools and repositories

Tools
Ollama · Gemma 4 E4B · Python · OpenCV
Prerequisites
Needs a machine with roughly 16GB RAM and ideally GPU or Apple Silicon acceleration.

Try it yourself: Benchmark local invoice extraction before switching

Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].

Preview
Help me test whether a local model can replace my paid OCR service. Using [Local vision model] through Ollama on this machine, write a script that reads images from [Sample image folder] and extracts [Fields to extract] into JSON with a fixed schema, returning null when a field is unreadable instead of guessing. Compare the output with [Hand-labeled answers] and report exact-match accuracy per field, average seconds per image, and the ten worst errors. Then try one image preprocessing step and report the difference. Work on copies only, never move or rename the originals, and do not send any image to an external service.

Hand-label a representative sample first and keep a human check on amounts before anything reaches your books.

Related videos

About ollama/ollama

Independent creators. Listing a video implies no endorsement, sponsorship or partnership.

Sources

  1. I Replaced a $50/Month OCR API with Gemma 4's Native Vision (And You Can Too) (opens in a new tab)

    First-person account · dev.to · Undated · Source checked 9 Nov 2026, 22:24 UTC

    What this source supports
    • gemma4:e4b run through Ollama from Python on an M1 MacBook Pro
    • 50 real contractor invoice photos tested
    • 91% local vs 94% cloud field accuracy; 95% with CLAHE preprocessing
    • About 2.3 s per image locally vs 4.2 s cloud; roughly $50/month saved
Report a problem

Reported by source

Run an open-weight model locally and call it from your code

Install Ollama, pull an open model and call it through the local REST API so prompts stay on your machine.

github.comollama/ollama
Planned, not done

Auto-tag receipts and bills in Paperless-ngx with paperless-ai

paperless-ai suggests titles, tags, correspondents and dates for documents in a Paperless-ngx archive, using a local Ollama model or a cloud LLM, with manual review and undo.

github.comollama/ollama
Reported by source

Control smart-home devices with a local LLM voice assistant

Connect Home Assistant to a local Ollama model as its conversation agent so you can ask it to control exposed devices privately.

github.comhome-assistant/core, ollama/ollama
Planned, not done

Record and summarise meetings on your own machine with Meetily

Meetily records calls, transcribes them on the device with Whisper or Parakeet, and writes summaries with a local Ollama model or a cloud model you pick.

github.comollama/ollama
Reported by source

Get a new OCR model running on unfamiliar GPU hardware with Claude Code in a sandbox

Simon Willison gave Claude Code full permissions inside a Docker container on an NVIDIA Spark and had it get DeepSeek-OCR working; it took four prompts and under 40 minutes, with one nudge from him.

simonwillison.net · 20 Oct 2025anthropics/claude-code, pytorch/pytorch, huggingface/transformers
Planned, not done

Import recipes and plan the week's meals in self-hosted Mealie with an AI provider

Mealie is a self-hosted recipe manager and meal planner; with an OpenAI-compatible provider it can turn web pages, pasted text or photos into recipes, parse ingredients and suggest tags.

github.comollama/ollama