Discuss your project
Architecture IA

Extract the right invoice lines from a PDF with Clairic

On a two-page invoice, line items and totals sit on different pages. Compare Clairic and Clairic-flash on sample documents to see which fields are reliable and when to send an invoice for review.

Extraire les bonnes lignes d’une facture PDF avec Clairic

An invoice shows its total on page two and its line items on page one. If a price lands in the next row, the output can look tidy while being unusable for accounting.

What changed from the preview

On November 18, Cloudflare released weights for Clairic and Clairic-flash on Hugging Face alongside Workers AI endpoints. Both model cards specify Apache 2.0. The old Clairic preview reference served a 9-billion-parameter model. Clairic now serves the 27-billion model and Clairic-flash serves the 9-billion one. Cloudflare reports an unchanged API schema and support for a combined total of four images or PDF pages. Its accuracy and latency figures come from its own evaluations.

Measure the mistakes that affect data entry

  1. Create twenty synthetic invoices with tilted scans, multiple tax rates, rows spanning two pages, and missing fields. Write expected values for supplier, total, currency, and prices and quantities grouped by row.
  2. Send both models the same schema. Check exact fields, intact rows, and figures against the document. Missing values should stay empty. Send uncertain results for review.
  3. Record end-to-end time and documents that need rework. Work out cost per accepted invoice, including review. Pick a threshold on one set and check it on different documents.

The Partitech invoice tutorial starts with distinguishing the tax from the total. Here the scope extends to PDF rows and a model change behind an existing endpoint. Pin the deployed version and rerun the reference invoices after every migration.

Share this article