High-throughput document processing with LLMs
How to process thousands of documents a day with an LLM: what limits throughput, how to measure it, and what it costs per document, not per token.
Updated
Part of: AI for customs and logistics
High-throughput document processing means running one model over thousands of documents a day and finishing the batch on schedule at a cost you can predict. The work is usually the same instruction repeated over every file: pull the parties from a lease, find the notice period in a supplier agreement, read the totals off an invoice. Because the instructions never change, most of the effort goes into the pipeline around the model: how files arrive, how answers are checked, and how the job is measured.
What limits throughput
Throughput is the total number of tokens a serving system finishes per second across all its requests. Document jobs hit three limits, roughly in this order. Input size comes first, since a long agreement has to be read in full before any answer is possible. Output speed comes second, because the model writes one token at a time. Concurrency comes third: how many documents the system works on together before new ones wait in a queue.
Extraction has a useful property. Answers are short, a quoted clause, a date or a dollar amount, so most of the clock goes to reading. A model that answers in a few tokens will finish more documents per hour than one that writes a paragraph for every file, even if the second model is better at prose.
Choosing a tier
On the public CUAD extraction exam, 510 commercial contracts scored with 5-fold cross-validation, our Accuracy tier scored 0.717 against 0.635 for Claude Opus, our faster Standard tier scored 0.650, and Claude Haiku scored 0.584. At 32 requests at a time, Accuracy processed about 5,100 tokens per second and Standard about 14,000, counting input and output across all requests, so Standard finishes 2.7x as many documents an hour. One request at a time, they write about 90 and 174 output tokens per second. The full results show the contracts and how each score was measured.
The choice is a trade. Pick the more accurate tier when a missed field costs more than the extra time, such as a renewal date that triggers an automatic extension. Pick the faster tier when volume is high and a review step can catch its misses. Your own test set should make that call, not a public exam.
Measure on your own documents
Start with a test set made from your own files, with answers checked by the people who own the work. Score the model you run today on that set, then score the candidate, and record throughput and quality side by side. A faster model that misses fields only moves the cost into review hours. Measure at the concurrency you will run in production, and check the numbers at the start and end of a batch, because queues and retries change them.
Common mistakes:
- Timing one document at a time, which hides queueing.
- Splitting the test set by chunk instead of by document, so text from one contract lands on both sides of the split.
- Testing on clean, digital PDFs when the real batch includes scans and faxed pages.
For how to get exact text out of files, see extracting exact text from documents with an LLM.
Cost per document
Budget per document, not per token. A per-token price means little until you multiply it by the length of your files, the size of the output your schema asks for, and the retries you will pay for. Two jobs at the same per-token price can differ widely in total cost if one reads short NDAs and the other reads long credit agreements. Enter your real page counts into the LLM cost calculator before you commit to a volume.
Batch interfaces at many providers cost less than real-time calls, in exchange for results that arrive later. If your overnight job can wait, check the batch price first. The batch API vs real-time comparison covers when the saving is worth the delay.
A worked example: invoice intake
Take an accounts payable team that receives invoices as PDFs from hundreds of vendors, each with its own layout. The job reads each invoice and returns vendor name, invoice number, invoice date, due date, currency, subtotal, tax and total as JSON. The answer is short, so reading dominates the cost, as expected.
The checks do the real work:
- Subtotal plus tax must equal the total, to the cent.
- The due date must fall on or after the invoice date.
- The currency must be a three-letter code that appears in the document.
An invoice that fails any check goes to a person with the failing rule named. A lease job follows the same pattern. A notice period written as “ninety days before the end of the term” is a date calculation, so compute the date from the term end, compare it with the stated period, and flag any mismatch.
Running the job safely
- Run five documents end to end before the full batch, so format errors show up early.
- Validate every output against a schema, and retry or flag bad answers instead of storing them. The structured output guide and the JSON reliability guide cover this in more depth.
- Log the model version on every result, so a later rerun can be compared with the first.
- Keep document text inside your environment for the whole run, including logs and error traces.
- Sample a fixed slice of finished documents each day and score it against answers your reviewers accept. Watch the retry rate too. When it climbs, the input has changed, and the throughput number you started with no longer holds.
Concurrency raises throughput until queues or rate limits push back, and it raises the memory your serving system needs. Output length is the other lever. Asking for only the fields you use is often the cheapest speedup available. Shaving time off one request rarely changes a batch that runs overnight, so spend your effort on concurrency and output length first.
If you process documents through a frontier API today, the free audit maps where your AI spend goes, task by task, and shows which jobs are worth a test. The Own Weights homepage explains how we build and measure these pipelines. Book a call when you want to test one of your own document jobs.
Questions
What is high-throughput document processing?
It means running a model over a large volume of documents, often thousands a day, and finishing the batch on time at a predictable cost. The job is usually extraction, classification or summarizing many files with the same instructions. Cost per document and documents finished per hour matter more than the speed of any single reply.
How do I measure the throughput of an LLM for documents?
Measure tokens per second and documents per hour at the concurrency you will run in production, using your own files. Record the quality score next to the speed, because a faster model that misses fields adds review work later. Check the numbers at the start and the end of a batch, since queues and retries change them.
Is a batch API the same as high-throughput processing?
No. A batch API trades time for price: results come back later, usually at a discount, and it suits jobs that can wait. High-throughput processing is about how much work a system finishes per hour, and you can reach it with real-time calls too.