Skip to content

Use cases

Document extraction with a model of your own

Pulling fields out of documents is a job a small model does well: the same fields, many times a day, with answers you can check. Sous trains one on your own documents, whether text, scans or photos, to return the JSON your app expects, and switches your app over only when it matches your current model on documents it never saw.

The short answer

  • What it is. A model that reads a document and returns the fields you need, as JSON.
  • Why a small model. It costs a fraction of a frontier model per page and answers faster, so you can run it on every document.
  • What Sous measured. Its receipt extractor, an 8B model trained on 200 receipts, got all four fields right on 88% of 50 it never saw, the same as gpt-6.1-terra, for $0.25 per 1,000 calls against $1.13.

What it pulls out

DocumentTypical fields
InvoicesSupplier, invoice number, dates, totals, tax, line items
ReceiptsMerchant, date, address, total
ContractsParties, start and end dates, renewal terms, amounts
Forms and applicationsNames, IDs, addresses, the boxes that are ticked
IDs and KYC documentsName, date of birth, document number, expiry date
Your own documentsWhatever fields your app needs, in your formats

Templates, APIs, or a model of your own

ApproachGood atMisses or costs
Templates and rulesFixed layouts from a few sendersNew layouts, and anything that takes reading in context
Pre-built document APIsCommon documents with standard fields, like invoices, receipts and IDsYour own fields, unusual documents, and a price on every page
A frontier model with structured outputsAny layout and any field, from a promptCost and time on every page, and every document sent to another provider
A small model trained on your documentsYour fields and layouts, at a low cost per callIt needs examples to learn from: Sous starts at 30

Many teams combine them: a template for the one supplier that sends half the invoices, a model for the rest. A model trained on your documents covers the layouts and fields the others miss, without sending every page to a frontier model.

What goes in, what comes out

  • Text PDFs. Sous reads their text, page by page.
  • Scans and photos. Send them as images. A scanned PDF has no text layer, so send its pages as images, or the text your OCR already gives you.
  • Text you already have. OCR output, emails, web pages.
  • Out comes JSON. Ask for JSON with a schema, as you do with OpenAI’s structured outputs, and the answer comes back in that shape.

What a receipt extractor scored

Sous trained the receipt extractor on 200 receipts from the ICDAR 2019 SROIE dataset, reading each one’s OCR text, and held out 50 to test. Share of the 50 with all four fields right (company, date, address and total):

ModelAll four fieldsPer 1,000 calls
Qwen3-VL 2B84%$0.06
Qwen3-VL 4B84%$0.12
Qwen3-VL 8B, which Sous recommended88%$0.25
gpt-6.1-terra88%$1.13

Before training, the 8B model got all four fields right on 64% of the same receipts. Training cost $3.34. Then it read 50 more receipts it had never seen, and matched the labels exactly on 32. Of the other 18, all but one differed only in spacing or punctuation, in a misspelling it fixed, or where it copied the receipt and the label had something else. The one real miss was a total: it gave the amount after rounding, and the label the amount before.

How to train one with Sous

  1. Bring documents and answers. Upload a table with each document, or its text, and a column for each field. Without answers, a frontier model labels them. Or wrap the client your app already uses for extraction.
  2. Say what to pull. Name the fields and their formats: dates as YYYY-MM-DD, amounts as numbers.
  3. Train and compare. Sous holds back about 20% of the documents, trains several small models on the rest, and scores each field on the documents none of them saw.
  4. Switch safely. Your app moves to the small model only when one matches. Until then, it keeps calling the model it uses today.
  5. Fix what it gets wrong. Mark a wrong answer and give the right one, and the next round learns from it.

Training starts at 30 examples, and a few hundred train better. See the guide to fine-tuning without an ML team for the full process.

How to measure an extraction model

  • Field by field. One field usually lags. On the receipts it was the address: 68% exact, against 98% for the date and the total.
  • Normalize before you compare. Decide what counts as the same: spaces, commas, capitals, date formats. Exact match alone undercounts.
  • Check the numbers in code. Totals should add up and dates should parse. A rule catches what a model misreads.
  • Look at the labels too. Some misses aren’t the model’s: on the receipts, it sometimes copied the receipt where the label said something else, or fixed a misspelling the label kept.

Questions people ask

What is PDF data extraction?

Pulling specific fields out of PDF documents, such as totals, dates, names and line items, into structured data your app can use, like JSON or rows in a table.

Can a small model extract data from documents accurately?

For one kind of document, often as well as a frontier model. Sous’s receipt extractor, an 8B model trained on 200 receipts, got all four fields right on 88% of 50 receipts it never saw, the same as gpt-6.1-terra, at $0.25 per 1,000 calls against $1.13. Measure on your own documents before you switch.

Does it work on scanned documents and photos?

Yes. Send scans and photos as images, which Sous’s models read. A scanned PDF has no text layer, so send its pages as images, or its OCR text, as the receipt example does.

What’s the difference between OCR and document extraction?

OCR turns an image of text into text. Extraction picks the fields you need out of a document and returns them in your format. A model can read the image itself, or work from OCR text.

Can it return JSON in my schema?

Yes. Ask for JSON with a schema, the way you do with OpenAI’s structured outputs, and the answer comes back in that shape.

How much does it cost?

Sous charges per token at the small model’s rate, from $0.05 per million input tokens and $0.40 per million output tokens. The receipt extractor cost $3.34 to train and $0.25 per 1,000 calls.

Is my data safe with Sous?

Sous is SOC 2 Type I and Type II compliant. Data travels encrypted, and you can delete datasets at any time. You can also download a trained model’s adapter and run it on your own servers.

Want to run it yourself? Private LLMs covers taking a trained model to your own servers.

Sources

Train your first model

Wrap your client and keep calling your model. Sous trains a small one on your calls and switches you over when it’s ready. Every account starts with $20 of credit, and a training that fails costs nothing.

Four steps, from your app’s calls to a small model

  1. 1Make a model and an API keyin the app
  2. 2Wrap your clientSous(OpenAI(), model=…)
  3. 3Use your app as usualSous keeps each call
  4. 4Let it switchwhen a student is ready