Clairic graduates from preview, while Clairic-flash joins the repertoire on Workers AI. We’re doing an open-weight release for both extraction models.

306 points•reddmachine•1 day ago•62 comments•

62 comments

Koffiepoederabout 23 hours ago
For local OCR, after quite some fiddling, for me the best result currently seems to converge on this custom pipeline:

    0) some preprocessing steps (contrast/brightness)
    1) layout detection by paddle [0]
    2) layout detection by granite docling heron [1]
    3) a smart merging algorithm, eg non overlapping surface maximization. Just ask your llm and iterqte a bit.
    4) Custom models for table areas [3] and text nodes [4]
    -
    5) Optional: postprocessing with gemma for structured output
I am now reaching >99% accuracy for invoice and receipt scanning. Even low quality pictures in bad light usually come out fine.

    0: https://www.paddleocr.ai/main/en/version3.x/algorithm/PP-StructureV3/PP-StructureV3.html
    1: https://docling-project.github.io/docling/usage/model_catalog/#stages-and-models-overview
    3: currently mobile, I will complete these later, don't know the exact models by heart
    4:
ybkshawabout 23 hours ago
I'm very interested in what this pipeline looks like - care to share more about this process? I ask because I'm interested in doing document scanning for my family and my small business and ultimately I want to be able to keep an OCR'd, searchable-text archive of anything that comes in, and have an LLM auto categorize and input things like medical expenses into a tax deduction section of my document management app.
deancabout 23 hours ago
Comment below me mentioned paperless-ngx. It has built in OCR (not sure which lib) but it's quite excellent and does a good enough job getting most of the text out. The main thing is getting most of the keywords indexable so you can find them later - not necessarily getting a perfect transcription. It also does auto classification of sends and tags and such. It's pretty good.
Koffiepoederabout 9 hours ago
Sorry for the delay, I see that this thread got a lot of comments, so, in the interest of preservation I will not update my original post, but rather continue here. I got around to reviewing my full pipeline just now.

For the preprocessing, I forgot to mention that I also DO use paddle here: I combine usage of (paddle) PP-LCNet and (paddle) UVDoc for page rotation and straightening. [0] [1]

For OCR of detailed text fragments, I use MinerU2.5-Pro-2605-1.2B (Q8_0) with some blank detection (i.e. if the response is blank, I try some variations with widening pixels at each edge and brightness/contrast). [2]

For tables, the full pipeline looks as follows:

- (paddle) PP-LCNet for detecting which kind of table: bordered or borderless [3]

- (paddle) SLANet Plus is used to propose a cell grid. However results here are not always adequate, as such: we also run MinerU's UnetStructure for bordered tables or if SLANet plus output is bad (low cell count). [3] [4]

- For the text extraction step, we use (paddle) PP-OCRv6 Small to detect the areas, then the regular mineru for the real text extraction. [5] [2]

- A final step is to reassemble the tables in to html, this is more procedural/code based.

If interested, I can maybe extract relevant parts into a custom pipeline and push it, though the code is not polished.

EDIT: formatting (list items were not on new lines)

  [0] https://huggingface.co/PaddlePaddle/PP-LCNet_x1_0_doc_ori_onnx
  [1] https://huggingface.co/PaddlePaddle/UVDoc_onnx
  [2] https://huggingface.co/mradermacher/MinerU2.5-Pro-2605-1.2B-GGUF 
  [3] https://www.paddleocr.ai/v3.3.1/en/version3.x/module_usage/table_structure_recognition.html
  [4] https://github.com/opendatalab/MinerU/blob/79d6d8d79fb8f3ddba5cc34c07a16f0ec36f56c7/mineru/model/table/rec/unet_table/table_structure_unet.py
  [5] https://www.paddleocr.ai/main/en/version3.x/module_usage/text_detection.html
ArtRichardsabout 23 hours ago
i have a stack for this built around paperless-ngx. Been thinking about open sourcing it. Interested?
barrenkoabout 13 hours ago
Thank you so much for lining this out - as much as I understand it, the OCR is not the problem with LLMs, but a sort of a layout understanding and e.g. "stitching" together tables that are spread across pdf pages.

OpenRouter uses cloudflare as it's api provider for the file parsing for LLMs that may not support files natively, but in some personal benchmarks the mistral's version of the OpenRouter file processing performed better (with GLM 5.3 Flash as the "backend").

hmokiguessabout 17 hours ago
Do you have advice for more complex documents like forms or requisitions?
troupoabout 23 hours ago
Why not just use PaddleOCR? I get excellent results from it.
Koffiepoederabout 17 hours ago
Pure paddle degraded rapidly for non english content in my case. I have quite a few Dutch documents coming in. It also struggled with pictures of receipts with bad print quality. Worked great for PDF's though!
Very excited for Extraction models to catch on, as decision models helped remind developers that not everything needs to be agentic LLM calls.
reddmachine1 day ago
Exactly this. Intelligence needs to be right-sized.
ravipatipabout 5 hours ago
Really appreciate Cloudflare making these models open-weight. Great to see an Infra company actively contributing to a more open and accessible AI ecosystem.
kingcauchyabout 24 hours ago
I’d love to see an moe qwen version or the smaller qwens as the backbone since running it locally would be much nicer with those

I’m excited to try this out with an ocr pipeline using a lightweight decision engine (not decision model) to route to either general ocr or know table schema extraction) like in legal where you know evidence might satisfy some schema but other stuff is just pdfs

Youdenabout 22 hours ago
I have a DGX Spark with Qwen3.8-Flash-Next hooked up to Paperless as the OCR engine, it works really well. I even had it (Qwen) build some kind of abomination combining Qwen's ability to recognize and nicely format text with Tesseract's ability to produce word positions so that the PDFs have selectable text.
janalsncmabout 22 hours ago
Honestly I’d be curious to see how this stacks up against something like qwen vl. The small quants can run on a laptop.
kingcauchyabout 9 hours ago
LightOnOcr and Clairic are just qwen vl but fine tuned and trained with adapters basically
SSLyabout 20 hours ago
Qwen VL is now "just" Qwen, right?
sarkarghyaabout 20 hours ago
Well im a little surprised that it is so cheap.

According to the announcement 1080 × 1920 px = 2,042 input tokens and a receipt would just cost $0.00049 @ $0.24 per million. Or like 1000 pages is like $0.49

That is like 8x cheaper than something like Mistral OCR 4.1 @ $4 per 1000 pages

The benchmarks also look good. have to try it out

sarkarghyaabout 1 hour ago
i tried it and it is absolutely abysmal. could not parse any of the 10 receipts. do not recommend

Read the full thread on Hacker News →

Related stories