Moon OCR

A page as an image.
Its text in Markdown.

Moon OCR reads a scanned or photographed page and returns its text in Markdown, with tables in HTML, on your own machine. It is LightOn’s LightOnOCR-3 0.8B model, unchanged, published for Ollama by Stellarr Studio.

The published model

LightOn’s model, ready for Ollama.

Moon OCR is LightOnOCR-3 0.8B, the smallest model in LightOn’s LightOnOCR-3 family, released under the Apache 2.0 licence. The weights are LightOn’s: Stellarr Studio has not retrained them. Only the format changes, converted to GGUF with llama.cpp so that Ollama can serve it.

We offer it for reading French documents, such as invoices, letters, forms or tables: we measured it on real French pages.

See Moon OCR on Ollama
Moon OCRSTELLARRSTUDIO / moon-ocr
  • Page as an image
  • Markdown
  • Tables in HTML
Publication
Ollama
Original model
LightOnOCR-3-0.8B
Created by
LightOn
Licence
Apache 2.0
Ollama tags
latest · lightonocr3-0.8b

Sources: versions published on Ollama and original model card from LightOn.

First launch

One page, one request.

Install Ollama 0.40.16 or a newer version: this is the version we tested. Older versions shrink the image before reading it, and the model then reads less well. Then download the model:

Terminal · Ollama
ollama pull STELLARRSTUDIO/moon-ocr

Then send the page to Ollama’s local API: the image encoded in base64, with an empty prompt. The model then returns all the text on the page. The example below runs in a Linux or macOS terminal, with jq to display the text of the response.

Terminal · Ollama
curl -s http://localhost:11434/api/chat -d @- <<EOF | jq -r .message.content
{"model": "STELLARRSTUDIO/moon-ocr", "stream": false,
 "messages": [{"role": "user", "content": "",
   "images": ["$(base64 < page.png | tr -d '\n')"]}]}
EOF

The ollama run command is not suited to this use: without text alongside the image, it sends nothing to the model. For a PDF, render each page as an image, with a longest side of about 2,048 pixels, then send one request per page.

Sources: Moon OCR page on Ollama and Ollama API documentation.

Two tags, one file.

Both registry tags point to the same file, with no quantisation. The size shown is the download displayed by Ollama.

latest

The default tag, used when no tag is specified.

1.7 GB
lightonocr3-0.8b

The same file, under the original model’s name.

1.7 GB

Sizes displayed by Ollama for Moon OCR. Tags and files may change.

One measurement, and what it shows.

We measured Moon OCR on the test split of fr-bench-pdf2md, a public benchmark of difficult French pages: 110 pages, in the subset without charts, scored by a simplified grader.

  • 45.7%of tests passed by Moon OCR, served by Ollama 0.40.16
  • 46.1%of tests passed by the original LightOnOCR-3 0.8B, run with transformers

The two results are close: the Ollama version reads like the original model. That is what this measurement shows, and nothing more. Our grader is not the benchmark’s official code: these figures cannot be compared with its leaderboard or with the scores published by LightOn.

Benchmark: fr-bench-pdf2md, published on Hugging Face.

What to check.

Handwriting is read much less well than printed text. Over an unreadable area, the model may write a plausible word or figure: check amounts, IBANs, dates and names before using them. A very dense page may be cut off, as the response is limited to 4,096 tokens.

A trial on your own pages.

  1. 01

    Choose representative pages

    Gather a few pages you actually handle: letters, invoices, forms, tables. Use documents you are authorised to process in this environment.

  2. 02

    Compare with the document

    Check the returned text against the page: figures, names, reading order and table cells. Note the errors that matter for your use.

  3. 03

    Decide what comes next

    A trial on a few pages helps form a hypothesis. A project then needs acceptance criteria, a document volume and a clear review process.

Your questions about Moon OCR.

Is Moon OCR a Stellarr Studio model?

No. Moon OCR is LightOnOCR-3 0.8B, a LightOn model released under the Apache 2.0 licence. Stellarr Studio published it for Ollama without retraining it. “LightOn” and “LightOnOCR” are names of LightOn; this Ollama version is not published, endorsed or supported by LightOn.

Why not retrain it?

We tried two fine-tunes on French documents. On real documents, neither did better than the original model, so we publish LightOnOCR-3 0.8B as it is.

Which version of Ollama do I need?

Ollama 0.40.16 or a newer version: this is the version we tested. Older versions shrink the image before reading it, and the model then reads less well.

Can it locate the blocks on a page?

Yes, with the grounding prompt instead of an empty prompt: each block is then preceded by its type, such as a title, text, table or image, and by its position on the page. Any other prompt is outside what the model has learned.

From the page to your use case.

Describe your documents, their volume and what you want to do with them. We can clarify what an initial prototype should help verify.

Let’s talk about your project

Discover Moon6 on Ollama · Discover the Moon AI platform · Integrate AI into your tools

A first conversation

Let’s talk about your project.

Tell us about your project in a few lines. Your message will be sent directly to our team.

PhoneMonday to Friday, 10:00 to 22:00

Saturday and Sunday: email only

Paris time (Europe/Paris)

An anti-bot check protects this form. It also runs when you choose to send your message.

Your contact details and message are used to handle your enquiry and reply to you. Learn more about your data.

You can also email contact@stellarrstudio.com.

Explore the studio

What are you looking for?

Enter a few words to find a page.

    Cookies and external content