Cloudflare open-sources Clairic: Models that pull clean data from invoices and PDFs
Cloudflare has released Clairic (27 billion parameters) and Clairic-flash (9 billion) as open-weight models under Apache 2.0. They specialize in pulling clean, verifiable data fields out of receipts, PDFs and support tickets. Cloudflare says they're faster and cheaper than large language models, but that claim comes from its own tests.

What's going on
Cloudflare is best known for networking and security services, but it now builds its own AI models too. On November 18, 2026, the company released two of them as open weights: Clairic, with 27 billion parameters, and the new, smaller Clairic-flash, with 9 billion. Both are on Hugging Face under the permissive Apache 2.0 license, so you can use them commercially, modify them and redistribute them. Both also run as hosted services on Workers AI, Cloudflare's cloud platform for AI models.
The models do one job: they pull structured data out of unstructured documents. Give them a till receipt, a multi-page PDF invoice or a customer email, and they'll extract things like the vendor, line items, total, order number or date. You don't get prose back. You get properly typed values (real numbers, dates or lists) that a program can process right away.
Cloudflare launched a first preview on October 19, 2026 as a cloud-only service and promised open weights later. But this release is more than that preview with the weights added. Cloudflare says it has fundamentally rebuilt the model.
What's changed since the preview
The preview answered every requested field in a single pass through the model. It didn't generate tokens (chunks of text). It read the answers off directly. That was very fast but error-prone. According to Marktechpost, Cloudflare itself named multi-step calculations, estimates without supporting evidence and simple forecasts as weak spots back then.
For ordinary text and number fields, the new version uses parallel, slot-wise autoregressive generation. Autoregressive means the model writes its answer token by token, with each step building on what it has already written, much like a person typing a word letter by letter. Every field gets its own "slot" and stops at its own end marker. All fields are processed at the same time in the same compute batch. Cloudflare says this costs a little more time but makes the model much more accurate.
For calculations, there are purpose-trained heads, specialized output modules that sit on top of the model. They handle estimates, forecasts, durations, computed dates and explicit arithmetic. So the model can answer "what follows from this" as well as "what does it say", for example a total price including tax or the number of days since delivery.
PDF support is new too. A single request can ask for the vendor, line items and total, even when they sit on different pages. Line items come back as rows that keep the description, quantity and price together. According to Unite.AI, there are hard limits: no more than four images or rendered PDF pages per request, embedded files up to 4 MiB each and 8 MiB combined, and no links to remote media files. You can't throw a whole document archive at it in one go.
Answers you can verify instead of taking on faith
The API hasn't changed, and it's what makes these models interesting. Every answer comes with a confidence score (how sure the model is), a null probability (p_null, how likely it is that the value doesn't appear in the document at all) and, for text answers, character spans. These are character positions that show exactly where in the document the value appears. According to Unite.AI, the span stays empty for image-only receipts or ambiguous matches.
That matters in practice. Large language models love to invent a plausible total that appears nowhere in the document. Clairic is supposed to report missing values as "null" instead. In Cloudflare's preview example, the model returned an empty value for a missing tracking number rather than making one up. Estimates and forecasts come with a median and an 80 percent interval. According to Marktechpost, supported field types are text, number, date, time, timestamp, duration, list, estimate and forecast.
Cloudflare's numbers and speed
Cloudflare ran internal tests comparing both models with the preview and with two competitors: Liquid AI's D1.2 paired with Apple Vision for text recognition (OCR), and ScaleDown's Extract. Each cell shows the number of fields answered correctly:
| Test | Preview | Clairic | Clairic-flash | D1.2 + OCR | ScaleDown |
|---|---|---|---|---|---|
| New text fields (96 requests) | 295/336 | 335/336 | 328/336 | 304/336 | 259/336 |
| Mixed inputs (36 requests) | 207/226 | 221/226 | 213/226 | 116/226 | 156/226 |
| Customer checks (139 request types) | 1,033/1,263 | 1,263/1,263 | 1,263/1,263 | 973/1,263 | 653/1,263 |
| Synthetic receipt fields (text and image) | 369/576 | 576/576 | 576/576 | 397/576 | 280/576 |
Cloudflare says image-reading errors in its internal tests fell from 207 to zero. The company admits there are no public extraction benchmarks and calls its results "directional".
Cloudflare also measured speed, as the full HTTP response from a self-hosted server with all fields included. p50 is the median, and p95 is the time that 95 percent of requests come in under:
| Test scenario | Clairic p50 / p95 | Clairic-flash p50 / p95 |
|---|---|---|
| New text fields | 358 / 736 ms | 155 / 328 ms |
| New image fields | 453 / 976 ms | 305 / 605 ms |
| Commercial leases | 691 / 803 ms | 379 / 519 ms |
| Loan terms | 395 / 407 ms | 188 / 192 ms |
| Traffic forecast | 532 / 585 ms | 243 / 261 ms |
| Expense audit | 632 / 742 ms | 393 / 512 ms |
Every figure is under one second. That means you can call the models from inside a live application instead of scheduling them as an overnight batch job. Cloudflare already demoed an insurance-claims pipeline with the preview. According to Marktechpost, the extraction step took 0.46 seconds there, compared with 16.1 seconds using the large language model GLM-5.3.
Pricing and the switch on Workers AI
During the preview, the @cf/cloudflare/clairic endpoint served the 9B model. Now it's flipped: the 27B model takes over @cf/cloudflare/clairic, and the 9B model moves to @cf/cloudflare/clairic-flash. If you already use the preview endpoint, you'll get the bigger model automatically. The API stays the same.
- Until December 1, 2026: both models cost $0.10 per million input tokens.
- From December 1, 2026: Clairic costs $0.24 and Clairic-flash stays at $0.10 per million input tokens.
- Output tokens: free, even though the new architecture generates them. Cloudflare says it's covering that cost itself.
If you process large volumes and the smaller model is good enough, switch to the flash endpoint before December 1. Otherwise your costs will more than double.
What you need to try it
The easiest option is the hosted route on Workers AI, which needs no hardware of your own. If you want to run the models locally, say because medical records, contracts or financial documents can't leave your network, download the weights from Hugging Face. According to Unite.AI, the repositories include the components for typed output, the tokenizer, the processor and Python helper scripts alongside the weights. Inference runs on PyTorch and Hugging Face Transformers. Versions for llama.cpp or Ollama are unlikely, because the special heads and field logic go beyond a normal chat model.
Cloudflare doesn't publish hardware requirements. As a rough estimate, Clairic-flash (9B) needs about 18 to 20 GB of VRAM (video memory) at full BF16 precision, so a 24 GB card. With 4-bit quantization (shrinking the model by storing its numbers at lower precision), around 8 GB might be enough. Nobody has shown yet whether the special heads still work properly when quantized. Clairic (27B) needs roughly 55 GB in BF16, which means a data-center card or several GPUs. At 4 bits it would be roughly 18 GB. You should also plan for 20 to 60 GB of disk space and at least 32 GB of RAM. The 9B model will probably run on a CPU-only system, but very slowly. For your first local experiments with the flash model, a Google Colab notebook with a larger GPU works well.
The big picture
Cloudflare calls the concept "System One", a nod to Daniel Kahneman's fast, intuitive mode of thinking. The idea is that small, specialized models take on narrowly defined tasks that expensive large language models handle today, working alongside them rather than replacing them. To cover the full chain of extraction, decision and response, Cloudflare offers the decision model Clef in addition to Clairic. The team behind them confidently calls itself the "Workers AI Superintelligence team", and Cloudflare now describes itself as a "neolab", meaning an AI research lab in its own right.
If you build systems that automatically process receipts, invoices, leases or support tickets, the offer is appealing: open weights, a permissive license, verifiable answers that point back to the source, and low prices. The caveats are significant, though. Every accuracy figure comes from Cloudflare itself, measured on its own test sets built around typical Cloudflare use cases, and that includes the competitor comparisons. There are no independent tests yet. The training data and training recipe haven't been released either, only the weights. According to Unite.AI, each application has to decide for itself what confidence threshold counts as reliable. If you want to use the models in production, test them on your own hardest documents first.
Sources
- dev.to #ai dev.to
- unite.ai unite.ai
- marktechpost.com marktechpost.com
- blog.cloudflare.com blog.cloudflare.com
Try it yourself: Clairic (27B) und Clairic-flash (9B)
Explained step by step, no prior knowledge needed – on your own computer or free in your browser.
What can I do with it?
Clairic reads text, JSON, photos and PDFs and extracts exactly the fields you define up front, such as vendor, invoice date, line items and total. Answers come back as real numbers, dates or lists, not chat text. Every value comes with a confidence score, and text values also include their exact location in the document. If a value is missing, the model returns "null" instead of making something up. Special modules can also do simple sums, durations and date calculations, and they deliver estimates and forecasts with an uncertainty range. Each request is limited to four images or PDF pages, so you can't feed it entire binders at once. Cloudflare's own tests put its accuracy ahead of competitors like Liquid AI D1.2 and ScaleDown Extract, but nobody has independently confirmed that. It can't chat, write text or answer general questions. That's not what it's built for.
Who is it worth it for?
It's worth a look if you're a developer or run a small business that regularly processes receipts, invoices, contracts or support emails and currently pays for large language models to do it, especially if the data can't leave your network. If you just want an everyday AI chat or you don't code, a regular chat model will serve you better.
Ideas: What you can do with it
Snap photos of your shopping receipts and have the model read out the store, date, total and line items. A script drops the values straight into a spreadsheet, so at the end of the month you can see where your money went without typing anything.
Incoming PDF invoices are parsed automatically for vendor, invoice number, due date and amount. The system flags shaky values with low confidence for manual review, and the rest goes straight into your accounting list.
From free-form customer emails, the model pulls the order number, delivery date and amount, then calculates the days since delivery. You can see at a glance whether a complaint still falls within the return window.
Feed in lease or loan agreements as PDFs and get the rent, term, interest rate and notice periods back as fields. The source locations let you check every value directly against the original text.
Process business-trip receipts and compare the total with the submitted expense report. Discrepancies and missing details stand out right away, because missing values are reported as "null" rather than invented.
Enter a series of daily visitor or sales figures and ask for a forecast for the next few days. You get a median and an 80 percent interval that shows how uncertain the prediction is.
What your computer needs
Clairic-flash (9B) is the right pick for most local experiments and for high volumes. Cloudflare says it's roughly twice as fast and nearly as accurate in internal tests. At full BF16 precision it needs roughly 18 to 20 GB of VRAM, so a 24 GB card. Clairic (27B) is meant for especially tricky documents and needs about 55 GB in BF16, which means data-center GPUs. 4-bit quantization would cut that to roughly 18 GB, but the source doesn't mention any official quantized versions. If you don't have suitable hardware, the hosted endpoint on Workers AI is the easiest way in.
- Cloudflare doesn't publish official hardware requirements. All VRAM figures here are rough estimates.
- Clairic-flash (9B) in BF16: about 18 to 20 GB of VRAM, for example an RTX 3090 or 4090 with 24 GB.
- Clairic (27B) in BF16: about 55 GB of VRAM. With 4-bit quantization roughly 18 GB, but nobody has checked whether the special heads cope well with that.
- According to the Model Cards, inference runs on PyTorch and Hugging Face Transformers. Ready-made GGUF files for llama.cpp or Ollama aren't mentioned.
- No more than four images or PDF pages per request, each up to 4 MiB and up to 8 MiB combined. More pages cost more memory and time.
- No GPU of your own? Use the hosted service: @cf/cloudflare/clairic or @cf/cloudflare/clairic-flash on Workers AI.
How do I find out what my computer has?
- Windows: Press Ctrl + Shift + Esc → Task Manager → Performance tab → click GPU on the left. At the bottom you'll see Dedicated GPU memory (that's your VRAM). You'll find system memory under Memory.
- Mac: Apple menu at the top left → About This Mac. You'll see your chip (e.g. M2) and memory (e.g. 16 GB). On Apple chips, graphics and processor share this memory.
- Linux: Type
nvidia-smiin the terminal (shows your graphics card and its memory) andfree -hfor system memory.
Guide
This model runs with its developers' own program. The commands below come from the Model Card and the developers' instructions.
Windows 10 / 11
Windows 10 / 11: not officially tested. The source doesn't mention Windows. It should work with an NVIDIA card with about 80 GB, but packages like xgrammar sometimes cause trouble on Windows. The safer bet is WSL2 (Linux running inside Windows) with the Linux steps, or a rented cloud server.
- Check the prerequisites. Install Python 3.11 or newer and tick "Add Python to PATH" during setup. You need an NVIDIA GPU with about 80 GB of memory, a current NVIDIA driver and around 60 GB of free disk space. Open PowerShell and check Python and the driver.
python --version nvidia-smi - Create a working folder. Create a project folder and switch into it.
mkdir clairic-test cd clairic-test - Create a virtual environment. The virtual environment keeps the packages separate from the rest of your system. If PowerShell says scripts aren't allowed, run "Set-ExecutionPolicy -Scope CurrentUser RemoteSigned" once first. Afterwards, your prompt will start with (.venv).
python -m venv .venv .venv\Scripts\Activate.ps1 - Install the download tool. This installs huggingface_hub, which includes the hf command for downloading.
pip install -U huggingface_hub - Download the model and code. This downloads the full repo (around 56 GB) into the clairic folder. It'll take a while.
hf download Cloudflare/clairic --local-dir clairic - Install dependencies. This installs PyTorch, Transformers, xgrammar and the other packages on the list. If PyTorch gets installed without CUDA, it won't detect your GPU. In that case, install the CUDA build of PyTorch afterwards.
pip install -r clairic\requirements.txt - Create a test script. Save this code as demo.py in the clairic-test folder. It's the invoice example from the instructions.
import sys path = "clairic" sys.path.insert(0, path) from clairic_model import load_release_model, systemone model, processor = load_release_model(path, device="cuda") response = systemone( model, processor, { "state": ( "Invoice from Northwind Supply. Issued 2026-09-02. " "Items: Pens; Paper. Total: $1080.00." ), "fields": { "vendor": {"type": "text", "instructions": "The invoice vendor."}, "total": {"type": "number", "decimals": 2}, "issued": {"type": "date"}, "items": { "type": "list", "items": "text", "instructions": "The purchased item names, in order.", }, }, }, ) print(response["answers"]) - Get your first result. Run the script. Once the model has loaded, you'll see the extracted fields vendor, total, issued and items. If you get "CUDA out of memory", your GPU doesn't have enough VRAM.
python demo.py - Result. The terminal shows the answers for the sample invoice: vendor "Northwind Supply", total 1080.00, date 2026-09-02 and the item list "Pens" and "Paper", each with confidence scores.
macOS
macOS: not officially tested. The instructions only load the model with device="cuda", which is for NVIDIA cards. Macs don't have those. The source doesn't mention Apple chips (the "mps" backend). It's only worth a try on a Mac with 96 GB of unified memory or more. Otherwise, a rented cloud server with an NVIDIA GPU is the better choice.
- Check the prerequisites. You need a Mac with an Apple chip and a lot of memory (at least 96 GB), plus Python 3.11 or newer and around 60 GB of free disk space. Install the Xcode command line tools (basic developer tools), then check your Python version in Terminal.
xcode-select --install python3 --version - Create a working folder. Create a project folder and switch into it.
mkdir clairic-test cd clairic-test - Create a virtual environment. This creates an isolated Python environment. If it worked, your prompt will start with (.venv).
python3 -m venv .venv source .venv/bin/activate - Install the download tool. This installs huggingface_hub, which includes the hf command.
pip install -U huggingface_hub - Download the model and code. This downloads the full repo (around 56 GB) into the clairic folder.
hf download Cloudflare/clairic --local-dir clairic - Install dependencies. This installs the packages from requirements.txt. If a package like xgrammar won't install on your Mac, this is where you get stuck.
pip install -r clairic/requirements.txt - Create a test script. Save this code as demo.py. The original uses device="cuda". That doesn't work on a Mac, so this version uses "mps" for Apple's GPU. It's an experiment the source doesn't cover.
import sys path = "clairic" sys.path.insert(0, path) from clairic_model import load_release_model, systemone model, processor = load_release_model(path, device="mps") response = systemone( model, processor, { "state": ( "Invoice from Northwind Supply. Issued 2026-09-02. " "Items: Pens; Paper. Total: $1080.00." ), "fields": { "vendor": {"type": "text", "instructions": "The invoice vendor."}, "total": {"type": "number", "decimals": 2}, "issued": {"type": "date"}, }, }, ) print(response["answers"]) - Get your first result. Run the script. If it works, you'll see the fields vendor, total and issued. If it fails with an error about mps or cuda, the code doesn't support Macs.
python3 demo.py - Result. The terminal shows the answers for the sample invoice: vendor "Northwind Supply", total 1080.00, date 2026-09-02 and the item list "Pens" and "Paper", each with confidence scores.
Linux
Linux: supported. According to the instructions, the model runs with PyTorch and Transformers on an NVIDIA GPU (device="cuda"). The source doesn't name an operating system explicitly, but Linux with an NVIDIA card is the usual route. You need around 68 GB of VRAM. If you don't have a card like that, rent a cloud server with an A100/H100 80 GB.
- Check the prerequisites. You need Python 3.11 or newer, an NVIDIA GPU with about 80 GB of memory and a current NVIDIA driver. You also need around 60 GB of free disk space. These two commands check your Python version and whether the driver detects the GPU.
python3 --version nvidia-smi - Create a working folder. Create a dedicated folder for the project and switch into it. Run all the following commands there.
mkdir clairic-test cd clairic-test - Create a virtual environment. A virtual environment (venv) is an isolated space for Python packages, so nothing clashes with other programs. If it worked, your prompt will start with (.venv).
python3 -m venv .venv source .venv/bin/activate - Install the download tool. The huggingface_hub package includes the hf command, which you use to download files from Hugging Face.
pip install -U huggingface_hub - Download the model and code. This downloads the whole repo into the clairic folder. It contains the weights (around 56 GB), the Python code clairic_model.py and requirements.txt. Depending on your connection, this can take a long time. When it's done, the folder holds 18 model-…safetensors files.
hf download Cloudflare/clairic --local-dir clairic - Install dependencies. This installs every package on the bundled list, including PyTorch, Transformers and xgrammar. xgrammar makes sure the answers match the requested schema exactly. If you don't see any red error messages, it worked.
pip install -r clairic/requirements.txt - Create a test script. Save the following code as demo.py in the clairic-test folder. It's the invoice example from the instructions, with one difference: the code points directly to the downloaded clairic folder.
import sys path = "clairic" sys.path.insert(0, path) from clairic_model import load_release_model, systemone model, processor = load_release_model(path, device="cuda") response = systemone( model, processor, { "state": ( "Invoice from Northwind Supply. Issued 2026-09-02. " "Items: Pens; Paper. Total: $1080.00." ), "fields": { "vendor": {"type": "text", "instructions": "The invoice vendor."}, "total": {"type": "number", "decimals": 2}, "issued": {"type": "date"}, "items": { "type": "list", "items": "text", "instructions": "The purchased item names, in order.", }, }, }, ) print(response["answers"]) - Get your first result. Run the script. Loading the model onto the GPU takes a few minutes. After that, the answers for vendor, total, issued and items are printed. If the program reports "CUDA out of memory", your GPU doesn't have enough VRAM.
python demo.py - Result. The terminal shows the answers for the sample invoice: vendor "Northwind Supply", total 1080.00, date 2026-09-02 and the item list "Pens" and "Paper", each with confidence scores.
What to do after your first result
- Replace the text in "state" with your own text, such as emails or invoices. Under "fields" you define which fields you want back. Options include text, number, date, boolean, enum, list, estimate and forecast.
- Pass images with "images": [Image.open("receipt.png")] (this needs from PIL import Image). You can send up to four images or PDF pages. Each file can be at most 4 MiB, and all of them together at most 8 MiB.
- For estimates and forecasts, set a min and a max on estimate or forecast. Add "options": {"include_quantiles": True} to get uncertainty ranges as well.
- Check confidence, p_null and truncated in the response before you rely on a result. If you need a smaller model, use Cloudflare/clairic-flash (9B).
Try it
Photo of a till receipt with the fields: merchant (text), date (date), total_amount (number), discount (number)Two-page invoice PDF, fields: vendor (text), line_items (list with description, quantity, unit price), invoice_total (number), due_date (date)Support email "I received order 48213 on November 3, the kettle is broken, it cost €39.90 plus €4.90 shipping", fields: order_number (text), delivery_date (date), total_price incl. shipping (number), tracking_number (text)Lease agreement as a PDF, fields: monthly_rent (number), lease_start (date), lease_term (duration), notice_period (duration)Table of visitor numbers for the last 30 days, field: forecast_next_7_days (forecast with 80 percent interval)
Tips for better results
- Give each field a short plain-language instruction, such as "gross amount including VAT", so the model picks the right value.
- Set a rule: if the confidence score is low or the source location (character span) is missing, a human checks the value instead of accepting it blindly.
- Test with your toughest real-world documents, like crooked receipt photos or handwriting, not clean demo invoices.
- Run the same documents through Clairic and Clairic-flash and compare the results. The faster 9B model is often enough.
- Request line items as a list so the description, quantity and price of each row stay together.
If something goes wrong
This isn't a chat model. It probably won't work in Ollama or LM Studio, because the typed output modules need custom Python code from the repository.
You have to define the fields you want, including their types (text, number, date, duration, list, estimate, forecast), up front. Open questions like "What's in this?" aren't supported.
Links to remote images or PDFs aren't accepted. Files have to be embedded in the request and stay under 4 MiB each and 8 MiB in total.
You can't send more than four images or PDF pages per request. Split long documents into sections.
On Workers AI, @cf/cloudflare/clairic now points to the 27B model. From December 1, 2026, it costs $0.24 instead of $0.10 per million input tokens. To keep costs down, you have to switch to @cf/cloudflare/clairic-flash explicitly.
According to the preview documentation, a very wide field schema can cost more tokens than the document itself. Leave out fields you don't need.
“out of memory,” a crash, or your computer freezes
The model is too big for your VRAM (video memory). Pick a smaller variant from the table above and close other programs, especially games and browsers with lots of tabs.
It runs, but extremely slowly
Your CPU is probably doing the work instead of your graphics card. In Ollama, the PROCESSOR column of ollama ps shows how much runs on the GPU. If it says "100% CPU", update your graphics driver or pick a smaller variant that fits entirely into VRAM (video memory).
“ollama” or “python” is not found
Close the terminal window and open it again so it recognizes the newly installed program. For Python on Windows: reinstall it and check Add python.exe to PATH.
Windows: "Running scripts is disabled on this system"
Run the script with exactly the command above: powershell -ExecutionPolicy Bypass -File try_windows.ps1. This allows execution for this one time only.
Error message when loading the model (version, "trust_remote_code", unknown architecture)
Brand-new models often need the latest software version. With Ollama: update Ollama. With Python: pip install -U transformers in the activated environment. The Model Card usually lists the exact version.
Tokenstrom generates the scripts and notebook automatically. Please take a quick look before running them – they're plain, readable text. Mind the model's license: apache-2.0.
Ask the AI assistant
Questions about this article, installation or background? Our assistant knows this page and runs on our own machine, not in someone else's cloud.
The Assistant is an AI (Gemma 4) and can make mistakes – please check important details against the source. Questions are used only to generate an answer and are deleted after one hour. Please don't enter any personal data.
Comments
What do you think? Already tried it? Write it here, no sign-up needed.
Comments are public. Links aren't allowed, and we delete abusive posts. You can delete your own comment at any time in this browser. Learn more in the Privacy Policy.