Contract review on a local LLM: how long-context models read a whole data room without the files leaving the building
TL;DR
Contract review on a local LLM works today, and for a due diligence data room it is usually the only version the NDA allows.
An agreement is a graph, not a page: a page-level extractor returns text deleted by Amendment No. 2 with full confidence. A long-context model reads the cap, the carve-outs and the amendment together.
A 60-page master services agreement with two amendments and four schedules is on the order of 50,000–90,000 tokens. Keep working sets in the low hundreds of thousands of tokens at most.
Illustrative scenario: a 5,000-document room of about 100,000 hard pages costs roughly €2,060 in GPT-4.1 sticker price versus about €150 of rented EU GPU compute — and a €600 reserved GPU covers this room and the next.
No quote, no value: every extracted field returns a verbatim quote, a page reference and a confidence. Explicit fields are reliable with spot checks; change of control, liability caps and indemnities are review-grade, not final.
Questions people ask
Can a local LLM do contract review?
Yes. A long-context open-weight model such as Llama 4 Scout can read a full agreement with its amendments and schedules in one prompt and pull parties, term, governing law, change of control and liability terms into a schema with a page reference for each answer. Qwen3-VL reads the scanned exhibits — signature pages, stamps, photographed pricing tables. Explicit fields are trustworthy with spot checks; composed clauses are review-grade.
Why not send a data room to ChatGPT or a cloud API?
A data room exists because of an NDA, and typical terms restrict disclosure to employees and advisers who need to know. Uploading 5,000 documents to a third-party inference API is a disclosure to a sub-processor the NDA did not anticipate, and virtual data room terms often forbid bulk export. Agreements also name people, so a US provider is a GDPR transfer under Articles 44–49. A local model removes the third party entirely.
How much does it cost to run a data room through a local model?
In the article’s illustrative scenario, a 5,000-document room of 100,000 hard pages costs about €150 of rented EU GPU compute — roughly 83 GPU-hours at €1.80 an hour — against about €2,060 on GPT-4.1 and €3,310 on Claude Sonnet 5 at list price. With 1.5× retries that is €225 versus €3,090 on GPT-4.1. The whole-file extraction pass adds about €100 locally. A reserved GPU at about €600 a month covers this room and the next.
What GPU do you need for long-context contract review?
Sizing this workload is about memory for context, not throughput. One A100-class 80 GB card carries a quantized long-context model and the OCR model for a room of about 100,000 pages, and a rented EU A100-class card is enough for a first room. Keep each prompt to tens of thousands of tokens by retrieving candidate clauses from the assembled bundle rather than loading the whole room, because quality and latency degrade past the low hundreds of thousands.
How accurate is AI contract review?
Anyone quoting one accuracy number has not defined the task. Explicit fields — parties, dates, governing law, payment terms in a clean schedule — are reliable enough to trust with spot checks, and errors there are mostly OCR or assembly mistakes. Composed fields such as change of control, liability caps and indemnities are review-grade. Absence is the hardest answer. Measure precision and recall per field on 50–100 lawyer-reviewed agreements.
Why does page-by-page OCR fail on contracts?
Because the number you want is rarely on the page the model is looking at. “Subject to Clause 14.3” on page 6 means nothing until page 31 has been read; Amendment No. 2 deletes a section the original PDF still shows; defined terms like “Change of Control” live in a definitions clause; pricing sits in a schedule and a side letter can change the deal. Page-level pipelines are right for 100,000 invoices and wrong for 5,000 agreements.
Want this worked out on your documents?
We will price a real sample against OpenAI or Anthropic and tell you whether Local document models or a local model on your hardware is the cheaper first step.
Contract review on a local LLM works today, and for a due diligence data room it is usually the only version the NDA allows. A long-context open-weight model — Llama 4 Scout for questions across a whole agreement, Qwen3-VL for scanned exhibits — can read a full file with its amendments and schedules, pull the parties, term, governing law, change-of-control and liability terms into a schema, and cite the page for each answer. Illustrative scenario: a 5,000-document room of about 100,000 pages costs roughly €2,060 in GPT-4.1 sticker price on the hard-page profile, versus about €150 of rented EU GPU compute. The cost is not the argument. The argument is that the files never leave the room.
An invoice is a page with a fixed set of fields. An agreement is a graph. The number you want is rarely on the page the model is looking at.
Cross-references. “Subject to Clause 14.3” on page 6 means nothing until the model has read page 31. A liability cap is often a formula — “the fees paid in the twelve months preceding the claim, except as set out in Schedule 4” — and the exception is the part that matters.
Amendments. Amendment No. 2 deletes Section 5 and replaces it. The original PDF still says Section 5. A page-level extractor returns the deleted text with full confidence.
Defined terms. “Change of Control” is capitalized for a reason: its meaning lives in a definitions clause or Schedule 1, and it can be narrower or wider than the plain phrase.
Attachments. Pricing lives in a schedule; the signature page tells you whether the agreement is even executed; a side letter changes the deal without touching the main text.
Classic OCR-then-extract pipelines — excellent for invoices, and what we run for bulk document processing — treat each page as an island. That is the right design for 100,000 invoices and the wrong one for 5,000 agreements.
Long-context local models change what one prompt can hold
Two model families make this practical on hardware you control.
Llama 4 Scout for whole-file questions
Llama 4 Scout is an open-weight model with a context window advertised in the millions of tokens. In practice you neither need nor want anything near that. A 60-page master services agreement with two amendments and four schedules is on the order of 50,000–90,000 tokens of text. Loading that bundle into one prompt lets the model answer “what is the liability cap after Amendment 2?” by reading the cap, the carve-outs and the amendment together — exactly what a page-level pass cannot do. Keep working sets in the low hundreds of thousands of tokens at most; answer quality and latency both degrade past that.
Qwen3-VL for scanned exhibits
Data rooms are never fully digital: executed signature pages are scans, older agreements carry stamps and handwritten dates, and pricing schedules are tables photographed from a binder. Qwen3-VL is an open-weight vision-language model that reads those pages directly: it recovers table structure, copes with stamps and handwriting, and can be asked a structured question about a page image rather than a lossy text dump. For plain OCR volume, a compact document model such as PaddleOCR-VL or DeepSeek-OCR is faster; our comparison of local OCR and document models covers where each one fits.
The extraction schema
A review schema is the field list a lawyer would put on the front page of a due diligence report. The useful part is not the list but the difficulty column, which tells you where the human hours go.
A typical due diligence extraction schema. Difficulty reflects how often the answer depends on text elsewhere in the file — not model quality.
Clause / field
Difficulty
Method
Parties and roles
Low
Cover page and signature block; cross-check the definitions for renamed entities
Effective, signing and expiry dates
Low–medium
Cover page and term clause; amendments can restate the effective date
Term and renewal
Medium
Term clause plus notice-period math; auto-renewal windows are the most common miss
Governing law and jurisdiction
Low
Usually explicit; watch for arbitration seats that differ from governing law
Change of control
High
Defined term plus assignment clause plus termination rights; carve-outs for intra-group transfers
Limitation of liability and caps
High
Cap formula plus exclusions plus indemnity carve-outs; frequently amended
Assignment and subcontracting
Medium
One clause, but consent conditions and affiliate exceptions matter
Indemnities
High
Several clauses; scope, procedure and interaction with the cap
Termination rights
Medium
Convenience vs cause; notice periods; effects of termination in schedules
Exclusivity and non-compete
High
Rare but deal-relevant; often in side letters or schedules
Payment terms and price adjustment
Medium
Schedules; indexation and step-up clauses
Data protection and confidentiality
Medium
Standalone DPA or annex; sub-processor and transfer clauses
A typical due diligence extraction schema. Difficulty reflects how often the answer depends on text elsewhere in the file — not model quality.
The low-difficulty rows are what a single-page extractor already does well. The high rows are where long context earns its place: the answer is a composition of three or four passages, and at least one of them is in a different document.
The pipeline: OCR, assembly, retrieval, extraction, review
Five stages, each with one plain job.
OCR and layout. Every page becomes text with structure — headings, numbered clauses, tables — plus the original image. Digital PDFs keep their text layer; scans go through a local document model. Compute here is the cheap part: the same €0.0015 per page as any other batch in our local vs OpenAI cost model.
Document assembly. Group the files that make one agreement: main body, amendments in order, schedules, side letters, executed signature pages. Folder names are unreliable; use titles, party names, dates and internal references (“this Amendment No. 2 to the Agreement dated…”) to link them, and have a human confirm the groups at the top of the room by value.
Clause retrieval. For each schema field, pull the candidate passages from the assembled bundle — the defined term, the clause, the amendment that touches it. This keeps each prompt at tens of thousands of tokens instead of the whole room.
Extraction with evidence. The long-context model returns each field as a value, a verbatim quote, a page reference and a confidence. No quote, no value. That rule is what makes the output reviewable.
Review UI. A lawyer sees the value, the quoted text and the page image side by side, accepts or corrects, and the correction is logged. The output is a table — CSV or JSON — that drops into the diligence report.
The stack is the one we deploy as local document models; the data-room version adds assembly, retrieval and a review screen. GPU sizing for this workload is about memory for context, not throughput: one A100-class 80 GB card carries a quantized long-context model and the OCR model for a room this size.
Accuracy expectations and human review
Anyone who quotes you one accuracy number for contract review has not defined the task. Three things are true without a benchmark:
Explicit fields are reliable enough to trust with spot checks — parties, dates, governing law, payment terms in a clean schedule. Errors here are mostly OCR or assembly errors (the wrong amendment attached), and they show up in a 50-document sample.
Composed fields are review-grade, not final — change of control, liability caps, indemnities. The model’s job is to find every passage that touches the question and put them on one screen. The judgment stays with the lawyer, who fixes the misses quickly because the evidence is already open.
Absence is the hardest answer. “There is no change-of-control clause” requires having read everything. Treat a negative as a prompt to check, not a finding, until your own test set shows the model’s misses are rare on your document types.
How to measure: have your own lawyers review a gold set of 50–100 agreements, run the pipeline, and score precision and recall per field — not one number for the room. Then measure the metric that pays: lawyer minutes per agreement with and without the pipeline. That is the number to report to a partner.
Why data-room files do not go to a US API
A data room exists because of an NDA. Typical terms restrict disclosure to the recipient’s employees and professional advisers who need to know, forbid copying beyond the review, and require deletion when the process ends. Uploading 5,000 documents to a third party’s inference API is, at minimum, a disclosure to a sub-processor the NDA did not anticipate. On the seller side, the virtual data room’s own terms often forbid bulk export outright.
Then GDPR. Agreements name people — signatories, key personnel, employees in HR schedules. Sending them to a US provider is an international transfer under Articles 44–49, which means the Data Privacy Framework or standard contractual clauses plus a transfer assessment, and a conversation about the US CLOUD Act that Schrems II made unavoidable. EU-region endpoints and zero-retention terms exist, and they help. They do not remove the third party, and they do not answer the counterparty’s lawyer. Our GDPR checklist for document AI covers the mechanics.
A local model is the short version of that memo: no third party, no transfer, and deletion is a directory you own. That is why long-context local models are the default for contracts in the hybrid stack even at volumes where an API would be cheaper, and why regulated sectors — pharma and medical diligence, for example — rarely consider anything else.
Cost sketch: a 5,000-document room
Illustrative scenario, assumptions stated in the table caption. We use the hard-page profile because agreements are dense text with long schemas, and because high-resolution scans of executed originals land there anyway.
Illustrative scenario: 5,000 documents averaging 20 pages (100,000 pages) on the hard-page profile (8,000 input + 800 output tokens per page). List prices at the time of writing: GPT-4.1 Mini $0.40 / $1.60, GPT-4.1 $2 / $8, Claude Sonnet 5 $3 / $15 per million tokens, converted at $1 = €0.92. Local compute at €1.80 per A100-class GPU-hour and 1,200 pages per hour. Excludes engineering, review time and the whole-file extraction pass discussed below.
Cost line
GPT-4.1 Mini
GPT-4.1
Claude Sonnet 5
Local, rented EU GPU
Sticker, 100,000 hard pages
€410
€2,060
€3,310
€150 (≈83 GPU-hours)
With 1.5× second passes and retries
€615
€3,090
€4,965
€225
Reserved GPU, one month
—
—
—
€600 (covers this room and the next)
Illustrative scenario: 5,000 documents averaging 20 pages (100,000 pages) on the hard-page profile (8,000 input + 800 output tokens per page). List prices at the time of writing: GPT-4.1 Mini $0.40 / $1.60, GPT-4.1 $2 / $8, Claude Sonnet 5 $3 / $15 per million tokens, converted at $1 = €0.92. Local compute at €1.80 per A100-class GPU-hour and 1,200 pages per hour. Excludes engineering, review time and the whole-file extraction pass discussed below.
The whole-file extraction pass is not in the table. Locally it is a second batch: 5,000 bundles of roughly 80,000 tokens is 400 million prompt tokens, which at a stated 2,000 prompt tokens per second on one card is about 56 GPU-hours, or €100. Measure that rate on your own hardware. On an API the same tokens are billed at input rates: about €736 on GPT-4.1 and €1,104 on Claude Sonnet 5 at list. Either way the local column stays an order of magnitude below.
€2,060 is nothing to a deal team. The point is that a permanent local capability costs less than one room on a frontier API, so there is no budget reason to accept the disclosure. Hard pages cross a €600 reserved GPU at about 29,000 pages a month against GPT-4.1; a single room is past that line.
How to run a data-room review project
Put the NDA and the data-room terms in front of counsel first. Confirm that processing on your own infrastructure is permitted and that bulk export is allowed. If a third-party API is contemplated, that needs the counterparty’s consent in writing.
Sample the room. Pull 50 documents across folders and count scanned vs digital, languages and average length; that sets the OCR load and the token budget per bundle.
Fix the schema with the deal team. About twelve fields, agreed definitions, and a difficulty tag per field so reviewers know where to spend attention.
Build the gold set. 50–100 agreements reviewed by your own lawyers. It doubles as the acceptance test.
Stand up the stack. One GPU with enough memory for the long-context model and the OCR model; a rented EU A100-class card is enough for a first room.
Run assembly. Have humans confirm the bundles for the agreements at the top of the room by value.
Run extraction with evidence. Score per field against the gold set; tune retrieval and prompts on the misses, not on the hits.
Review with the source visible. Log every correction, and report lawyer minutes per agreement to the deal lead.
Measure three things on your first room: recall on the high-difficulty rows, lawyer minutes per agreement, and how many documents needed manual re-assembly. If the third number is high, fix the room’s structure before you buy more GPU. When you want the stack without the build, our local document models engagement deploys this pipeline behind your firewall; when you want the table without the stack, bulk document processing runs the pages with an EU processor under your NDA.