Mend What’s Broken. Build Systems That Scale.
AI & Automation 4 min read

Cutting PDF & Invoice Extraction Costs by 80%: Why 9B Clairic-Flash Beats Per-Seat SaaS

Cloudflare has open-sourced Clairic and its 9-billion-parameter Clairic-flash extraction model on Workers AI and Hugging Face, delivering sub-second p50/p95 latency across PDFs, tables, and receipts. We examine the unit-cost benchmark and show how to pair 4-page PDF batching with line-level mixed UK VAT validation in TypeScript.

One of the largest sources of avoidable software spend in UK finance and operations teams is document extraction. Businesses either pay £45 to £120 per seat every month for rigid document-capture SaaS platforms, or send multi-page supplier PDFs through heavyweight frontier LLMs that take 6 seconds per page and charge steep token rates. Cloudflare's open-weight release of Clairic and the 9-billion-parameter Clairic-flash model shows how purpose-built extraction architectures cut back-office inference costs by up to 80% while returning typed confidence scores and character spans in under a second.

Unit-Economics and Latency Benchmark: 9B Clairic-Flash vs. Per-Seat SaaS

Cloudflare's Workers AI team built Clairic and Clairic-flash around parallel slot autoregressive generation, where every requested JSON field advances simultaneously in the serving batch alongside dedicated heads for dates, durations, and explicit arithmetic. In Cloudflare's internal evaluations, Clairic-flash matched the full model at 1,263/1,263 on tracked customer assertions (139 request shapes) and 576/576 on synthetic receipt fields while delivering sub-second HTTP response times:

Cloudflare Self-Hosted HTTP Latency Benchmark (p50 / p95):
- Fresh text fields (96 requests):       Clairic 358 / 736 ms  | Clairic-flash 155 / 328 ms
- Fresh image fields (48 requests):      Clairic 453 / 976 ms  | Clairic-flash 305 / 605 ms
- Commercial leases (180 requests):      Clairic 691 / 803 ms  | Clairic-flash 379 / 519 ms
- Expense audit workloads (60 requests): Clairic 632 / 742 ms  | Clairic-flash 393 / 512 ms

Mendscale UK SME Monthly Cost Comparison (4,000 supplier PDFs across 20 staff):
1. Per-Seat Document Capture SaaS (£45/seat + page overages): ~£900 to £1,250 / month
2. Frontier General-Purpose LLM API (4 to 8s latency/doc):    ~£180 to £350 / month
3. 9B Clairic-flash on Workers AI + Deterministic TypeScript: ~£12 to £35 / month (£0 seat tax)

Because the full weights are published on Hugging Face and hosted on Workers AI, UK businesses avoid both per-seat SaaS inflation and single-vendor model lock-in.

Handling the 4-Page PDF Limit and Mixed-Rate UK VAT Rounding in Code

Two engineering constraints must be handled in code when deploying Clairic-flash for UK accounts payable. First, Cloudflare specifies that a single request accepts up to four images or PDF pages in total; when chunking a 14-page supplier statement into 4-page requests, pin Page 1 (or carry its extracted supplier header and invoice number forward) so continuation pages never lose invoice metadata. Second, deterministic validation must never multiply an invoice subtotal by a flat 20% VAT rate, because UK supplier bills frequently mix standard-rated (20%), reduced-rated (5% energy or mobility), and zero-rated (0%) lines on the same document.

On a typical mixed-rate UK supplier bill containing 45000p @ 20% = 9000p, 12000p @ 5% = 600p, and 8500p @ 0% = 0p, the exact net total is 65500p (£655.00) and the exact VAT is 9600p (£96.00). A naive flat 20% check computes 13100p (£131.00), introducing a 3500p (£35.00) false error. Furthermore, because HMRC allows suppliers to calculate VAT either per line item or per tax-rate bucket subtotal, your validator should account for multi-line rounding drift rather than hardcoding a 1-penny whole-invoice tolerance:

// 1. Chunk multi-page PDFs into 4-page windows while preserving Page 1 header context
const MAX_PAGES_PER_CALL = 4;
const pageChunks = chunkPdfPagesWithHeader(pdfPages, MAX_PAGES_PER_CALL);

// 2. Validate mixed UK VAT rates (20% standard, 5% reduced, 0% zero-rated) with HMRC bucket tolerance
const expectedNetPence = draft.lines.reduce((acc, l) => acc + l.netPence, 0);
const expectedVatPence = draft.lines.reduce(
  (acc, l) => acc + Math.round((l.netPence * l.vatRatePercent) / 100),
  0
);
const maxRoundingDriftPence = Math.max(1, draft.lines.length);

if (
  expectedNetPence !== draft.totalNetPence ||
  Math.abs(draft.totalVatPence - expectedVatPence) > maxRoundingDriftPence ||
  draft.minConfidence < 0.92
) {
  return stageForHumanApproval(draft, "LINE_OR_HEADER_VAT_MISMATCH");
}

By pairing fast open-weight extraction with penny-exact deterministic TypeScript checks and a human exception queue, our human-in-the-loop AI and workflow automation practice helps UK finance teams eliminate manual data entry under a fixed-price scope with 100% code ownership.

Source: Cloudflare Blog

FIXED-PRICE BESPOKE DELIVERY

AI Automation & Consulting UK

Production-grade, human-in-the-loop AI workflows with UK GDPR-ready architecture.