Ten local models tested for Paperless: why an 8B gemma4 replaces the larger gemma3

Summary

My Paperless server reads scanned pages with a local vision model and also suggests title, correspondent and tags locally. In one night I ran ten models on a 16 GB graphics card against 41 real pages and 15 real documents, using the same check that decides in production. The previous 12B gemma3 passed 15 of 41 pages, the smaller 8B gemma4 passed 35, and along the way several traps showed up that anyone choosing local models should know.

Starting point: 15 out of 41 is not enough

Every document I keep ends up in Paperless-ngx. paperless-gpt re-reads scanned pages with a vision model, then Paperless-AI suggests title, correspondent, document type, date and tags. Both run locally through Ollama on an RTX 5070 Ti with 16 GB (affiliate link: if you buy something, I get a small commission and the price does not change for you). No document leaves the house.

For months this used gemma3 with 12 billion parameters in its QAT build. When I recently uploaded about 860 documents at once, text recognition failed on several of them, and the obvious question was: is there something better by now that fits the same card? Instead of trusting rankings from blogs, I measured it with my own documents.

What you can take away: Rankings on the web rarely measure what you need. The page llamaperf.com, for example, lists only speed and memory for 16 GB cards; it says nothing about quality on German scans.

How I tested

The sample had 41 pages: 30 randomly drawn scanned pages from 30 different documents, i.e. pages without their own text layer, and 11 pages on which text recognition had failed before. Each page was rendered exactly as in production and sent to the model with the same prompt.

Real documents have no answer key. paperless-gpt therefore uses a trick that I adopted: Tesseract also reads the page the classic way and reports a confidence for each word. Every word with at least 85 percent confidence is an anchor. A model answer passes if there are at least five anchors, it contains 85 percent of them and it does not get stuck in repetition. This does not prove that every word is right, but it reliably shows whether the model reproduces the clearly legible text or makes something up.

anchors  = Tesseract words with confidence >= 85
passed   = anchors >= 5  and  found >= 85 %  and  no repetition loop
budget   = 4096 answer tokens in the test (1024 first in production, 4096 there too since 20 Nov)

For the metadata, the real Paperless-AI logic ran in a throwaway container without access to Paperless; only the model was swapped. 15 random documents, plus my real lists with 542 tags, 190 correspondents and 42 document types. There is no answer key here either, so I counted whether the answer was valid and whether the model used existing entries instead of inventing new ones.

To keep the night from getting longer than necessary, an abort rule applied: as soon as a model could no longer reach the best score even with all remaining pages, it was out. My SoftwareSklave (German for “software slave”) ran the tests; I steered the selection and followed the interim results.

What you can take away: If you have no answer key, look for a second, independent method that at least checks the reliable part. Tesseract anchors cost nothing and reliably expose invented text.

Results: text recognition

ModelPassed of 41of which failure pagesMedian per pageNote
Qwen3.6-35B-A3B (NVFP4, FreeToken)37 (90 %)9 of 118.6 soccupies the whole card, experts partly in RAM
gemma4 8B (Q4_K_M)35 (85 %)8 of 115.0 snew production model
glm-ocr (2.7 GB)34 (83 %)8 of 113.2 spure OCR model, fastest
qwen2.5vl 7B32 of 395 of 98.2 saborted, could no longer win
gemma3 12B QAT (previous)15 (37 %)3 of 118.8 s
gemma4 12B QAT4 of 9not reached8.6 saborted; the 8B gemma4 passed 8 of the same 9 pages
qwen3-vl 8B8 of 29not reached40.8 sfilled almost every page up to the limit
PaddleOCR-VL 0.9B (community upload)0 of 7not reachedno valueOllama build without vision part, accepts no images

The large MoE model behind FreeToken reads best, but only two pages more than gemma4, and it takes the whole card to do so. No second model fits on the GPU next to it, and Paperless-AI still needs one for the metadata.

The 23 pages gemma3 failed show why it failed so often. Its answers there were about as long as those of gemma4, a median of 186 versus 202 words, so it left out little. But only two thirds of its words also appeared in the Tesseract text, compared with 92 percent for gemma4. gemma3 fluently wrote text that was not on the page in that form.

What you can take away: More parameters do not mean better text recognition. The 12B gemma4 was clearly worse than the 8B gemma4 on the same nine pages, and qwen3-vl was eight times slower than the leaders because it got lost in repetition.

Results: metadata

ModelValidCorrespondent from my listDocument type from my listTags from my listMedian per document
gemma4 8B15 of 15100 %93 %98 %1.3 s
gemma4 12B QAT15 of 15100 %100 %93 %3.2 s
qwen3 14B15 of 1587 %100 %95 %4.9 s
gemma3 12B QAT (previous)15 of 1573 %100 %100 %4.0 s
Qwen3.6-35B-A3B (FreeToken)6 of 750 %100 %96 %4.3 s
gpt-oss 20B0 of 1no valueno valueno valueno value

For metadata the Ollama models are close; all deliver valid answers. The difference lies in the correspondents: gemma3 invented a new one instead of using an existing one for four of the 15 documents. Over several hundred documents, the correspondent list fills up with duplicates that way.

FreeToken and gpt-oss failed because of two quirks that have nothing to do with intelligence. More on that below.

What you can take away: For metadata, measure not only whether the JSON is valid but whether the model uses your existing structure. Every invented correspondent means manual work later.

Five traps I found along the way

  • “latest” is not a version. The tested gemma4 had been on the server for seven months as gemma4:latest. In the Ollama library that name now points to a different model file. A harmless ollama pull would therefore have silently swapped the production model for an untested one. I stored the tested build under a fixed name of its own with ollama cp.
  • A community upload is not the model. PaddleOCR-VL is known as an OCR specialist, but the build in my Ollama did not accept images at all. Ollama answered every request with “image input is not supported … you may need to provide the mmproj”: the upload lacked its vision part. I would be just as careful with the Qwen3.8 distillation for FreeToken offered on Hugging Face; its own model card says images were not tested and the distillation covered text only.
  • Thinking models eat the answer budget. gpt-oss always thinks, even when you try to switch it off. Paperless-AI gives an answer 512 tokens in my setup, and on the first document they were used up by thinking before a single line of JSON appeared.
  • Without an enforced schema you get broken JSON. Ollama can bind the output to a JSON schema. The FreeToken server refused that (“no constrained decoding”). On the seventh document, incomplete JSON came back. For a model working in a pipeline without a human, that is a hard drawback, no matter how clever it is.
  • The test can be the bug. My filter that kept secrets out of the test container’s configuration removed everything with “TOKEN” in its name, including TOKEN_LIMIT and RESPONSE_TOKENS. The first metadata run promptly failed with “Insufficient metadata context budget”. FreeToken, too, failed twice because of my test setup before it failed on its own on the third run.

What you can take away: With every outlier, check your own setup first. A model that fails immediately and completely in a test is more often wired up wrongly than actually bad.

The decision

The 8B gemma4 now handles both tasks: text recognition in paperless-gpt and metadata in Paperless-AI. In text recognition it is only just behind the large model, for metadata it leads, it is clearly faster than gemma3 and it does not occupy the card on its own. One model for both tasks has another advantage: Ollama does not have to swap between two models.

I changed only three configuration entries and recreated the two affected containers. gemma3 stays installed; going back is one line per entry. Before switching over, the same probe ran that the update mechanism uses: an arithmetic question as text and a number in an image, both with the answer 42. After that I sent a 101-page document on which gemma3 had failed through the whole pipeline again.

What you can take away: Do not choose the test winner, choose the model that fits your operation. Two more pages do not justify a fully occupied graphics card and unreliable JSON.

Addendum: 400 older documents in production

The small sample left one question open: does the result hold for the whole collection? The answer came sooner than expected. paperless-gpt had recognised many of my documents in mid-September, a few days before I added the Tesseract check. About 600 documents therefore carried text that nobody had ever checked.

A look into the database showed 115 pages that had been stored empty back then. Tesseract finds readable text on 113 of them. I already knew the pattern: when the model hit the answer limit, it used to return an empty page instead of an error. For many of these pages Paperless still had its own text, but for 51 pages it was missing entirely or in part.

I then checked up to three pages of each of these documents against the current Paperless content. 400 documents with weakly supported text went through the whole pipeline once more: text recognition with gemma4 and the Tesseract check, then new metadata from Paperless-AI. For pages with their own text layer, paperless-gpt now takes the text straight from that layer. The answer budget for text recognition is 4096 tokens in production as well now.

Measured on 651 pages with at least five anchorsbeforeafter
mean anchor coverage in the Paperless text70.6 %96.8 %
pages below 85 %55121
pages below 50 %652

This is not a second model comparison: the weak documents were selected on purpose, and many pages came from the text layer this time. It does show that the check holds up in production. 610 pages got better, 2 slightly worse.

Paperless-AI assigned new metadata to 394 documents. 286 titles, 192 document types and 63 dates changed, and 908 tags were added. No existing tag, correspondent or document type was lost. A run like this does overwrite manual corrections to titles, though. That was fine for me here, and I still backed up the old metadata first.

Five documents did not make it. Each contains a scanned page without a text layer whose transcript failed the check three times. paperless-gpt then stopped and flagged the document instead of storing unchecked text; the old text stayed in place. That is exactly how it should be: better five cases to look at than silent errors like in September.

What you can take away: If your collection contains AI text recognition from a time without a cross-check, check it again. Empty or invented pages do not stand out in search, they are simply missing.

Numbers at a glance

  • In the test, the 8B gemma4 passed 35 of 41 pages, the 12B gemma3 15 of 41.
  • Passing requires at least five Tesseract anchors with 85 percent confidence, 85 percent of which must appear in the model answer.
  • The Qwen3.6-35B-A3B model in FreeToken passed 37 of 41 pages, but its server does not support an enforced JSON schema.
  • gpt-oss 20B used up the answer budget of 512 tokens that Paperless-AI has in my setup with thinking.
  • After re-running 400 older documents, the mean anchor coverage on 651 checked pages rose from 70.6 to 96.8 percent.
  • Tested on an RTX 5070 Ti with 16 GB under Ollama 0.34.4, with paperless-gpt 0.31.0 and Paperless-ngx 3.2.1.

References

Remarks

  • The sample is small: 41 pages and 15 documents from my own collection, mostly German. For other languages, handwriting or very poor scans the order may look different. The addendum with 400 documents supports running gemma4 in production, but it does not replace a second model comparison.
  • The gemma4 results apply to the tested model file, not to whatever appears under gemma4:latest in the future. Anyone reproducing this should pin the build they checked.

View paperless-gpt on GitHub

Found a mistake or have something to add? Get in touch.