What You’ll Build
In about three hours, you will have a legal document review pipeline that ingests thousands of discovery documents, classifies them by relevance and privilege status, extracts key facts and dates, identifies responsive passages, and generates review summaries with citation links. Processing 10,000 pages of discovery takes under two hours on a single dedicated GPU server with attorney-client privileged material never leaving your network.
E-discovery review is one of the most expensive phases of litigation, costing $1-3 per document when outsourced to contract review teams. A single case can involve millions of documents. GPU-accelerated AI review on open-source models performs first-pass review at machine speed, reducing the volume that human reviewers must examine by 70-80% while maintaining defensible review protocols.
Architecture Overview
The system processes documents through four stages: format conversion and OCR extraction for scanned materials, relevance classification and privilege detection using an LLM via vLLM, key fact and entity extraction with timeline construction, and a RAG-powered query interface for review attorneys. LangChain handles the multi-pass document analysis workflow.
The relevance classifier evaluates each document against case-specific search terms and issues. The privilege detector identifies attorney-client communications, work product, and other protected categories. Both classifiers output confidence scores that determine routing: high-confidence relevant documents go to the responsive set, high-confidence privileged documents get logged and withheld, and borderline documents queue for human review. The RAG index enables attorneys to query the document set conversationally.
GPU Requirements
| Case Size | Recommended GPU | VRAM | Documents Per Hour |
|---|---|---|---|
| Small case (< 50K docs) | RTX 5090 | 24 GB | ~3,000 docs/hr |
| Mid case (50K-500K docs) | RTX 6000 Pro | 40 GB | ~8,000 docs/hr |
| Large case (500K+ docs) | RTX 6000 Pro 96 GB | 80 GB | ~15,000 docs/hr |
Document review requires strong reasoning for privilege detection and relevance assessment, making larger models significantly more accurate. A 70B model reduces false negatives (missed responsive documents) by 15-20% compared to an 8B model on legal benchmark sets. Consult our self-hosted LLM guide for model sizing in accuracy-critical workflows.
Step-by-Step Build
Provision your GPU server with encrypted storage and network isolation appropriate for privileged legal materials. Deploy vLLM with a large reasoning model and configure the document processing pipeline. Define case-specific relevance criteria and privilege indicators in structured templates.
# Document review prompt
REVIEW_PROMPT = """Review this document for litigation relevance.
Case: {case_description}
Key issues: {issue_list}
Search terms: {search_terms}
Privilege indicators: {privilege_markers}
Document metadata: {doc_metadata}
Document text: {doc_text}
Return:
{relevance: {score: 0.0-1.0, classification: "responsive|non-responsive|uncertain",
responsive_issues: ["which case issues this relates to"],
key_passages: [{text: "relevant excerpt", page: int, issue: "related issue"}]},
privilege: {score: 0.0-1.0, classification: "privileged|not_privileged|uncertain",
type: "attorney-client|work_product|joint_defense|none",
indicators: ["what suggests privilege"]},
entities: [{name, type, role_in_case}],
key_dates: [{date, event_description}],
summary: "2-3 sentence document summary"}"""
Build the review platform with document viewer, annotation tools, and batch approval workflows. The timeline extraction module assembles a chronological narrative from key dates across the entire document set. Add a conversational search interface where attorneys ask questions like “Show me all documents where the defendant discussed the pricing change.” See vLLM production setup for batch processing configuration.
Performance and Defensibility
On an RTX 6000 Pro 96 GB running Llama 3 70B in 4-bit quantisation, the pipeline processes a document (average 5 pages) in 3.2 seconds including all classification and extraction steps. Relevance classification achieves 91% recall (catching 91% of actually responsive documents) with 84% precision. Privilege detection reaches 95% recall, critical for avoiding inadvertent disclosure, with an 80% precision rate that slightly over-flags for human review.
The system maintains a complete audit trail for every classification decision, supporting defensibility challenges. Confidence-based sampling for quality control validates the AI’s accuracy throughout the review. These metrics satisfy the proportionality requirements courts apply to technology-assisted review.
Deploy Your Review Pipeline
AI-powered document review cuts discovery costs by 60-80% while maintaining defensible review quality. All privileged and confidential documents stay on your infrastructure with no third-party data exposure. Launch on GigaGPU dedicated GPU hosting and accelerate your next case review. Browse more automation patterns in our use case library.