AI Comparatives
Document Processing
8 min reading

Typed Extraction vs Parsers vs LLMs: When to Use Each

A document branching into three review paths: a highlighted text span, a page with a coordinate grid, and a JSON object passing a verification gate.

Summarize this article with:

summary

Cloudflare's Clairic returns typed values with character spans, confidence scores and a probability that each answer is null. This comparison sets it beside document parsers and LLM structured outputs. It asks what evidence each gives a reviewer when a field looks wrong, then recommends an approach for each situation.

Cloudflare has introduced Clairic, hosted on Workers AI as @cf/cloudflare/clairic. Cloudflare describes it as a System One-style model that can extract, compute, estimate and forecast values from inputs. Instead of free text, Clairic returns typed values. Extracted text comes with character offsets and a confidence score, and Cloudflare's example output adds p_null, the probability that an answer is null.

That makes typed extraction a third option beside document parsers and LLMs with structured outputs. When a field looks wrong, each approach gives a reviewer different evidence: a position in the text, a region on the page, or checks you build yourself. These forms of evidence are not interchangeable.

This comparison is for teams that pull application data from PDFs, scans, forms, receipts, invoices and text. It covers what each approach returns, what a reviewer can inspect, how billing works and where the limits are. It ends with a recommendation for each situation.

Typed extraction exampleCloudflare Clairic, @cf/cloudflare/clairic on Workers AI
Model sizesClairic 27B and Clairic Flash 9B, per Cloudflare's repositories
Review evidenceCharacter spans, confidence, p_null
Prompt limit65,273 input tokens (state plus fields)
Media per request4 images or rendered PDF pages in total
Hosted price in Cloudflare's docs$0.10 per M input tokens (December 1, 2026)
License of the weightsApache-2.0

The three approaches at a glance

Start with the evidence your reviewers need. Then weigh schema stability, how much interpretation the task needs, and file constraints.

ApproachReturnsReviewer seesBest for
Typed extraction (Clairic)Typed fields with confidence and p_nullCharacter spans in the input textCustom fields that need text-level evidence
Document parserProvider-defined fields and textPage coordinates and confidence, when the provider returns themStable invoices, receipts and scans
LLM structured outputJSON in your own schemaChecks you build: quotes, rules, human reviewChanging schemas, cross-field interpretation

Sources: Cloudflare's Clairic model reference, extraction models page and Hugging Face repositories (typed extraction row). Parser and LLM rows are selection criteria. Checked December 1, 2026.

For parsers and LLMs, the evidence depends on the provider. Read a real response before you design the review screen.

Typed extraction with Clairic

In Cloudflare's extraction models documentation, you send an input state and define each value you want, with its type and constraints. The model returns a typed result for each one. The same page warns that typed results "provide a predictable structure but do not guarantee correctness."

Cloudflare's model reference splits answers into two groups. Generated answers (text, number, boolean, enum, object, source_only fields and lists) carry valid and complete metadata. Typed answers (date, time, datetime, duration and compute) carry a guess instead.

Nulls need interpretation. The model reference says a value is null when the input does not determine it. Cloudflare's extraction models page adds that, for fields that extract or compute a single value, a null means the model considers the input insufficient: "The information may be missing, or the model may have failed to identify it." Lists return an empty list when the model finds no matching values, and estimates and forecasts return predictions even when the input provides little information. In Cloudflare's examples, a guess field still shows what the model would otherwise have picked, which helps a reviewer decide.

Spans need care. Cloudflare's documentation says a source span identifies start and end positions in the input. The repository adds that image-only or ambiguous evidence has null spans. A character offset points into text, so don't present it as a region on a scanned page.

Cloudflare's own early notes say one- and two-step calculations seem reliable, but multi-step arithmetic isn't yet. Its advice for now is to "have Clairic predict the value and let code do the math."

Limits and price

According to the model reference, each prompt (state plus fields) must fit in 65,273 input tokens. Input is never truncated, and oversized requests are rejected.

A request can embed up to four PNG, JPEG or WebP images and up to four PDFs. Rendered pages plus images must total at most four. Each file is limited to 4 MiB, with 8 MiB decoded across images and documents. If your files are longer, parse or split them first.

Cloudflare's announcement says fields that don't fit beside the input in one pass are split into parallel passes that each see the whole input. Measure input tokens on your real schemas, not only on the documents.

On December 1, 2026, Cloudflare's model reference labeled Clairic a preview and listed $0.10 per M input tokens. Cloudflare's announcement says the model has no charge for output tokens.

For self-hosting, Cloudflare publishes Clairic, a 27B multimodal model, and Clairic Flash, a 9B multimodal model, on Hugging Face. Both are released under the Apache-2.0 license.

How the review queue works

Store the original input state with every extracted record. For text fields, show the returned span in context. Send nulls, generated answers marked incomplete and values outside your acceptance policy to review.

Don't copy one threshold across document classes. Cloudflare's repository says scores "should be evaluated for the application's own acceptance thresholds." Test yours on representative documents.

A typed extraction review path

Extract

Request named fields with explicit types and instructions.

Inspect metadata

Check p_null and confidence. For generated answers, also check valid and complete; typed answers carry a guess instead.

Resolve source

Open the character span in the stored input text.

Apply rules in code

Recompute totals and check dates, identifiers and required fields.

Accept or review

Queue the field for a person, with its evidence attached.

What does Cloudflare's benchmark show?

Cloudflare compared a cascade of Clairic, its decision model Clef and GLM-5.3 against GLM-5.3 doing every step. The cascade took 19.3 seconds end to end. The all-LLM version took 61.7 seconds.

Cloudflare's end-to-end pipeline latency

seconds

  • Clairic, Clef and GLM-5.3
  • GLM-5.3 for every step

Source: Cloudflare's Clairic announcement, vendor-run benchmark. Checked December 1, 2026.

In Cloudflare's table, the extraction step took 0.46 s with Clairic and 16.1 s with GLM-5.3. Cloudflare put the cost at $6,032 per million claims for the cascade and $11,740 for the all-LLM pipeline. This is one vendor-run pipeline. It compares speed and cost, not extraction accuracy across approaches.

OCR and specialized document parsers

A document parser is the better starting point when review depends on the page itself. If reviewers must open a scan and see where a value came from, require word or field coordinates.

Keep general OCR separate from specialized parsing. OCR supplies text for later steps. An invoice or receipt parser should be judged on the fields, tables and metadata your application needs. Our overview of the document parsing and OCR API landscape maps the options.

Don't assume parsers share a geometry or confidence scale. Before you choose one, inspect a real response for bounding-box units, page numbering, confidence granularity, table structure and how it reports an absent field. If you are starting small, our list of free OCR APIs and open-source models is a place to begin.

For the review queue, keep the original file and the full parser response. Show a low-confidence value beside its page location only when the provider returns both. Parsers fit stable document classes such as invoices and receipts, and they can prepare text or tables for a later typed extraction or LLM step.

LLMs with structured outputs

Use an LLM when fields change often or when extraction needs interpretation across several parts of a document. Schema validity proves the format, not that a value agrees with the source.

Cloudflare's announcement lists the failure modes it sees: "The output may not be valid JSON," a digit can be misread as it is generated, and a returned excerpt can't be traced to where it appeared. Build the evidence layer yourself. Ask for short source quotations where the API supports them, then match them against the document. Add code checks for dates, totals, identifiers and required fields.

A second model call can flag inconsistencies, but it is another prediction. Check consequential values against the document or send them to a person.

Token billing changes the cost model. An LLM pipeline pays for the document text, instructions, schema and generated output. Price the complete pipeline, including retries and validation calls. For files longer than a context window, see our guide to processing huge documents with LLMs.

Which evidence does your workflow need?

Pick the approach whose evidence your reviewers can act on. Add a stage only when it supplies something missing, such as page geometry, interpretation or a deterministic check.

Selection guide

Choose by the review evidence

Text evidence

Typed custom fields

Use typed extraction when reviewers need exact positions in the source text. Treat a null as a review signal: the value may be missing, or the model may have failed to find it.

Page evidence

Invoices, receipts and scans

Choose a parser that returns the page coordinates and confidence your review screen needs.

Interpretation

Changing or contextual schemas

Use an LLM when the task depends on cross-field interpretation. Add source matching and rules in code.

Hybrid

Parser before typed extraction

Parse or split files when page geometry matters or the files exceed the next model's documented input limits.

Hybrid

Parser followed by an LLM

Keep the parser's evidence, then use an LLM to normalize labels or handle ambiguous cases.

Higher risk

Human confirmation

Before consequential or irreversible actions, Cloudflare advises checking results against other evidence or requiring human review.

Where Eden AI fits

Eden AI exposes LLMs and expert models for OCR, text analysis, image, translation and audio through two API endpoints. It gives access to more than 1,000 models, language and expert models together, from more than 80 providers, as its catalog shows.

For the parser step, start with the docs for text detection (OCR), multipage OCR and table extraction. Check each provider's response for coordinates and confidence before you build the review screen.

Eden AI automatically handles fallback on both LLM and Universal AI expert-model requests.

The illustrative sample below starts from a parser result, applies a review rule in its own function and sends accepted fields through Eden AI's OpenAI-compatible LLM endpoint for normalization. It names a backup model. The 0.90 threshold is a placeholder to test on your own documents. Separately, a single request can require zero data retention with routing.zero_data_retention: true.

Python

import requests

BASE_URL = "https://api.edenai.run/v3"
API_KEY = "YOUR_EDENAI_API_KEY"
MIN_CONFIDENCE = 0.90

def needs_review(field, min_confidence=MIN_CONFIDENCE):
    return field["confidence"] < min_confidence or not field["source"]

parsed = {"invoice_total": "1080.00", "confidence": 0.97,
          "source": "Total: $1,080.00"}

if needs_review(parsed):
    print("Queue for human review:", parsed)
else:
    response = requests.post(
        f"{BASE_URL}/chat/completions",
        headers={"Authorization": f"Bearer {API_KEY}"},
        json={
            "model": "compactifai/glm-5-3",
            "fallbacks": ["zai/glm-5.3"],
            "messages": [{"role": "user", "content": "Return JSON with total_usd as a number. Input: invoice_total 1080.00, source 'Total: $1,080.00'"}],
        },
        timeout=30)
    if response.ok:
        print(response.json()["choices"][0]["message"]["content"])
    else:
        print("Not processed, queue for human review:", parsed,
              response.status_code, response.text)

Compare the returned total_usd with the parsed value in code before you save it.

Zero data retention can also be required for the whole organization, for every member, API key and model.

If documents must be processed in Europe, Eden AI's EU endpoint routes requests only to providers and models cleared for European processing.

To pick the LLM step, Eden AI's side-by-side comparison page shows each model at its cheapest provider. For agent workflows, Eden AI's hosted MCP server makes OCR, web search, image analysis, speech and translation callable tools.

What to keep in mind

  • The evidence is Cloudflare's: the benchmark and examples come from the vendor. Test accuracy on your own documents before choosing.
  • Calibration varies: Cloudflare says Clairic's intervals are calibrated on most held-out sets but "can run narrow on unfamiliar data."
  • Keep math in code: recompute totals and multi-step values yourself rather than trusting a single extracted figure.

Decision rule

Choose the method whose evidence your reviewers can inspect. Add another stage only when it supplies a missing capability: page geometry, interpretation or deterministic validation.

FAQ

Does Clairic charge for output tokens?
Cloudflare's announcement says Clairic has no charge for output tokens. On December 1, 2026, Cloudflare's model reference listed $0.10 per M input tokens.
What does p_null mean?
In Cloudflare's example output, p_null is the probability that an answer is null. Treat it as a review signal and set your own thresholds for it.
What do Clairic's character spans point to?
They identify start and end positions in the input text. Cloudflare's repository says image-only or ambiguous evidence has null spans, so spans are not page coordinates.
Can Clairic be self-hosted?
Yes. Cloudflare publishes the weights and Python loading instructions for Clairic (27B) and Clairic Flash (9B) on Hugging Face, both under the Apache-2.0 license.
When should OCR or a parser come first?
Put it first when reviewers need page coordinates, or when a specialized parser already covers stable document fields. It also comes first when files exceed the next model's input limits, such as Clairic's four images or rendered PDF pages per request.
Does valid JSON mean the extracted values are correct?
No. Schema validity checks the structure of the response. Validate important values against the source text, the page, business rules or a human reviewer.

Further reading

Similar articles

A stream of water fills a locked private reservoir before overflowing into a shared lake, with a separate aqueduct leading to distant towers.
AI Comparatives
Generative AI
Microsoft Foundry Model Router Can Use Your PTU. Should It?
11/30/2026
·
Written byClément Moreau
A railway switchyard where a first switch leads to different stations and a second switch leads to identical stations in several towns, showing provider fallback and regional routing as two layers.
AI Comparatives
Generative AI
SageMaker Cross-Region Routing vs Cross-Provider Fallback: Which Failures Each Covers
11/19/2026
·
Written byClément Moreau
A coin rolls along three tracks of different lengths toward one finish line, showing how three Gemini tiers reach a completed task at different costs.
AI Comparatives
Generative AI
Gemini 4 Carbon vs Argon vs 3.8 Flash: Cost per Completed Task
11/16/2026
·
Written byClément Moreau
let’s start

Start building with Eden AI

A single interface to integrate the best AI technologies into your products.