# Open Source Legal > Open source tools for understanding how law, contracts, and legal systems shape our world. opensource.legal curates and builds community-maintained software for legal document analysis, redlining, annotation, and knowledge sharing. Open Source Legal is a community publishing open tools and a curated directory of open source legal-technology projects. All listed projects are open source; the GitHub organization is https://github.com/Open-Source-Legal. ## Site - [Home](https://opensource.legal/): What Open Source Legal is and its featured projects. - [Directory](https://opensource.legal/directory): Curated directory of 76 open source legal-tech tools across 13 categories. - [Directory data (JSON)](https://opensource.legal/directory.json): Machine-readable directory with stars, language, and license per project. ## DOCX Manipulation & Rendering - [python-docx](https://github.com/python-openxml/python-docx) (Python, MIT): Python library to create, read, and modify Microsoft Word .docx files. The default choice for programmatic Word document manipulation in Python. - [docx (docx.js)](https://github.com/dolanmiu/docx) (TypeScript, MIT): Declarative TypeScript/JavaScript library for generating and modifying .docx files. Works in Node.js and the browser, no required props on the React side. - [docxtemplater](https://github.com/open-xml-templating/docxtemplater) (JavaScript): Template-based generator for docx, pptx, and xlsx files. Authors place {placeholders}, loops, and conditions in a Word template; the library fills it from JSON. Runs in Node.js and the browser. - [Mammoth (Python)](https://github.com/mwilliamson/python-mammoth) (Python, BSD-2-Clause): Converts .docx files to semantic HTML and Markdown. Optimized for extracting meaningful structure rather than reproducing visual fidelity. - [Mammoth.js](https://github.com/mwilliamson/mammoth.js) (JavaScript, BSD-2-Clause): JavaScript port of Mammoth. Renders .docx documents to HTML for display in web UIs. - [Open XML SDK](https://github.com/dotnet/Open-XML-SDK) (C#, MIT): Microsoft's official .NET library for low-level manipulation of OOXML files (Word, Excel, PowerPoint). The reference implementation when you need to work directly with the format. - [docx4j](https://github.com/plutext/docx4j) (Java): Mature Java/JVM library for creating and manipulating Word, PowerPoint, and Excel OOXML files. - [SuperDoc](https://github.com/superdoc-dev/superdoc) (TypeScript, AGPL-3.0): Open-source DOCX editor for the browser, server, and AI agents. Built on ProseMirror and Yjs with real OOXML pagination, tracked changes, and CRDT-based real-time collaboration. AGPL-3.0 with a commercial license available. - [ONLYOFFICE Docs](https://github.com/ONLYOFFICE/DocumentServer) (Shell, AGPL-3.0): Full collaborative office suite with viewers and editors for documents, spreadsheets, and presentations, fully OOXML-compatible. Heavier than a library, but a serious option for in-browser editing. - [ooxml-dev](https://github.com/superdoc-dev/ooxml-dev) (TypeScript): Interactive OOXML (ECMA-376) reference written by people who have actually implemented it. A more navigable companion to the official ECMA-376 spec — useful when you're hand-rolling DOCX/PPTX/XLSX manipulation and need to understand a specific element or attribute. ## Redlining & Document Comparison - [Python-Redlines](https://github.com/JSv4/Python-Redlines) (Python, MIT): Python wrapper around a C# utility (using Open-XML-PowerTools' WmlComparer) to generate tracked-change redlines between two .docx files. Pragmatic stop-gap for Python-based legal tooling. - [Docxodus](https://github.com/JSv4/Docxodus) (C#, MIT): Office XML redline engine forked from OpenXMLTools and upgraded to .NET 8. Compares Word documents, detects moved sections, converts DOCX to HTML, and ships as a NuGet package, npm module (via WebAssembly), and CLI. - [react-docxodus-viewer](https://github.com/JSv4/react-docxodus-viewer) (TypeScript): Drop-in React component for viewing and redlining DOCX files entirely in the browser via Docxodus WASM. Supports tracked changes, comments, pagination, and headers/footers. - [docx-redline-js](https://github.com/AnsonLai/docx-redline-js) (JavaScript, MIT): Zero-dependency JavaScript OOXML engine for text reconciliation and native Microsoft Word redlines (w:ins / w:del). Useful for taking AI-generated edits and producing valid tracked-change DOCX without a .NET dependency. - [Open-XML-PowerTools](https://github.com/OfficeDev/Open-Xml-PowerTools) (C#, MIT): Microsoft's original .NET toolkit including the historic WmlComparer engine. Repository is archived; the maintained community fork lives at github.com/EricWhiteDev/Open-Xml-PowerTools. Still the source-of-truth comparison engine many forks build on. ## Document Assembly & Contract Automation - [Docassemble](https://github.com/jhpyle/docassemble) (JavaScript, MIT): Open-source expert system for guided interviews and document assembly built on Python, YAML, and Markdown. Generates PDF, RTF, and DOCX from interactive question flows. The workhorse of legal aid and court automation. - [CAML](https://github.com/Open-Source-Legal/caml) (TypeScript, MIT): Corpus Article Markup Language — a human-readable markdown superset for authoring beautiful, interactive legal articles and knowledge bases. Includes a zero-dependency parser and a React renderer with themed components, interactive blocks, and customizable design tokens. - [OpenLaw](https://github.com/openlawteam/openlaw-core) (Scala, Apache-2.0): Scala-based protocol and markup language for programmable, blockchain-enabled legal agreements. Supports variables, conditionals, embedded clauses, e-signatures, and Ethereum smart-contract calls inside legal templates. JavaScript client at openlawteam/openlaw-client. Apache-2.0. Note: the core repos haven't seen meaningful activity since 2021-2023, so treat as a reference design rather than an actively maintained dependency. - [Accord Project](https://github.com/accordproject): Linux Foundation project building an open stack for smart legal contracts. Cicero (TemplateMark engine combining markdown, data models, and execution logic), Concerto (data modeling — V4 reached beta in early 2026), and Template Playground/Studio for authoring, now with a TipTap-based visual editor. Runtimes are expanding into Rust and .NET, and the project has applied for associate membership in the LF's Agentic AI Foundation. Apache-2.0; outputs DOCX/PDF/HTML/markdown. ## Context Management System (CMS) - [cite](https://github.com/Open-Source-Legal/cite) (Python, MIT): Self-hosted Context Management System for legal AI — the layer that turns a pile of documents into structured, queryable context for agents. Django + React, with version-controlled corpuses, custom label schemas, human and AI annotation, semantic search, and an MCP server so agents retrieve grounded, citable context instead of raw files. ## Legal AI Platforms - [Mike](https://github.com/willchen96/mike) (TypeScript, AGPL-3.0): Open-source legal AI platform pitched as an alternative to Harvey/Legora. Includes assistant-driven document review, projects (Vault), tabular review, and tracked-changes edits across documents within a project. AGPL-3.0. - [ContraxSuite](https://github.com/LexPredict/lexpredict-contraxsuite) (C#, AGPL-3.0): Open-source contract analytics and document exploration platform built around LexNLP. Handles document ingestion, clause and obligation extraction, search, and review workflows. The user-facing application that LexNLP was originally built to power. Dual-licensed AGPL-3.0 / commercial. ## Legal Research & Court Data - [Juriscraper](https://github.com/freelawproject/juriscraper) (HTML, BSD-2-Clause): Python data-gathering library that scrapes opinions, PACER content, and oral arguments from US courts. Powers much of CourtListener. - [Eyecite](https://github.com/freelawproject/eyecite) (Python, BSD-2-Clause): Python library for extracting and resolving legal citations from text. Tested against tens of millions of citations and used to annotate the Caselaw Access Project corpus. - [CourtListener](https://github.com/freelawproject/courtlistener) (Python): Free open case law search platform with API access covering millions of opinions. Backbone of much of the open legal-data ecosystem. - [X-Ray](https://github.com/freelawproject/x-ray) (Python, BSD-2-Clause): Tool for detecting bad PDF redactions, specifically catching cases where black rectangles or highlights are drawn over text rather than the text being properly removed. Useful for due-diligence sanity checks. - [Doctor](https://github.com/freelawproject/doctor) (Python, BSD-2-Clause): Microservice for document and audio processing tasks (extraction, conversion, OCR) used by CourtListener. - [Inception](https://github.com/freelawproject/inception) (Python, BSD-2-Clause): FastAPI microservice that generates SentenceTransformers embeddings tuned for legal documents and queries. Handles both short queries and long opinions, with optional GPU acceleration. - [Caselaw Access Project (Capstone)](https://github.com/harvard-lil/capstone) (HTML, MIT): Harvard Law Library's digitization of all official US case law — 6.7M+ cases spanning 360 years. Capstone is the Django/Postgres backend; case.law provides the public API and bulk data. As of late 2024 native search was retired in favor of CourtListener, but the API and bulk dataset remain the most authoritative open US caselaw corpus. See also harvard-lil/cap-examples. - [OpenStates](https://github.com/openstates/openstates-scrapers) (Python, GPL-3.0): Aggregates legislative information (bills, votes, sponsorships, legislators) from all 50 states, DC, and Puerto Rico into a standardized API and bulk downloads. Python scraping framework with a per-state architecture; the openstates org also publishes pyopenstates and openstates-core. - [OpenEDGAR](https://github.com/LexPredict/openedgar) (Python, MIT): Python framework for retrieving, parsing, and analyzing filings from the SEC's EDGAR system. Companion to LexNLP; useful when contract or disclosure analysis needs primary EDGAR data. ## Document Conversion & Processing - [Gotenberg](https://github.com/gotenberg/gotenberg) (Go, MIT): Docker-based HTTP API for converting documents to PDF. Wraps headless Chromium (HTML/MD/URL) and LibreOffice (100+ Office formats), with merge/split/watermark/PDF-A support. Stateless and language-agnostic. - [Unstructured](https://github.com/Unstructured-IO/unstructured) (HTML, Apache-2.0): Open-source ETL for transforming complex documents (PDFs, DOCX, HTML, etc.) into clean structured formats for language models. Common preprocessor for RAG over contracts. - [PyMuPDF](https://github.com/pymupdf/PyMuPDF) (Python, AGPL-3.0): High-performance Python bindings for the MuPDF library. PDF text/image extraction, rendering, and basic editing. - [pdfplumber](https://github.com/jsvine/pdfplumber) (Python, MIT): Python library for detailed PDF text and table extraction. Strong at handling tabular data layouts that other PDF tools struggle with. - [pdf2docx](https://github.com/dothinking/pdf2docx) (Python, MIT): Python library for converting PDF files to editable .docx, attempting to preserve layout, tables, and images. - [LibreOffice](https://github.com/LibreOffice/core) (C++, GPL-3.0): Full office suite usable from the CLI as a batch document converter (e.g. soffice --headless --convert-to docx). Underlies Gotenberg's Office conversion path. Note: primary repo is git.libreoffice.org; GitHub is a read-only mirror. - [Microsoft Presidio](https://github.com/microsoft/presidio) (Python, MIT): Open-source framework for detecting, redacting, masking, and anonymizing PII across text, images, and structured data. Pluggable pipeline combining spaCy/transformers/stanza NER, regex, and rule-based recognizers. Standard answer for anonymizing legal documents before sharing or training. MIT. - [Apache Tika](https://github.com/apache/tika) (Java, Apache-2.0): Content extraction toolkit covering 1,000+ file types (PDF, DOCX, PPT, images, audio, archives, etc.). Java core with REST server (tika-server) commonly used as a microservice. The default first step for any pipeline that has to ingest mixed-format legal documents into a uniform text + metadata representation. Apache-2.0. - [Docling](https://github.com/docling-project/docling) (Python, MIT): Document processing library focused on getting unstructured documents (PDF, DOCX, PPTX, XLSX, HTML, images, audio) ready for gen AI. Strong PDF understanding — page layout, reading order, table structure, formulas, code, image classification — typically without OCR. Unified DoclingDocument representation; exports to Markdown, HTML, JSON, DocTags. Started by IBM Research Zurich, now hosted under LF AI & Data Foundation. Companion model Granite-Docling-258M is an ultra-compact VLM for one-shot conversion. Local execution makes it a strong fit for sensitive legal data; sibling repos cover Java bindings, MCP server, knowledge-graph extraction, and SDG. MIT. - [Tesseract](https://github.com/tesseract-ocr/tesseract) (C++, Apache-2.0): Long-standing C++ OCR engine maintained by Google and the open-source community. 100+ language packs, runs CPU-only, mature Python (pytesseract), Node, and .NET bindings. Lower accuracy on complex layouts than newer neural engines, but unbeatable for cross-platform deployment, air-gapped environments, and use cases where you can't ship GPU. Apache-2.0. - [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR) (Python, Apache-2.0): Baidu's production-grade OCR toolkit covering 80+ languages, with strong support for Asian scripts where Tesseract struggles. Includes detection, recognition, layout analysis, table extraction, and document understanding pipelines. Useful when contracts or filings include CJK content. Apache-2.0. - [Marker](https://github.com/datalab-to/marker) (Python, GPL-3.0): Pipeline for converting PDF, DOCX, PPTX, XLSX, HTML, EPUB, and images to clean Markdown/JSON/HTML with strong table, equation, and inline-math handling. Uses Surya for layout/OCR; optional --use_llm flag for LLM-assisted refinement. Benchmarks favorably vs LlamaParse and Mathpix. Note: GPL-3.0 with commercial restrictions — self-hosting in a revenue-generating context (or in a way that competes with the Datalab API) requires a commercial license. Material for biglaw deployments. - [Surya](https://github.com/datalab-to/surya) (Python, Apache-2.0): OCR, layout analysis, reading order, and table recognition in 90+ languages. Beats Tesseract and rivals Google Cloud Vision on accuracy in published benchmarks. Powers Marker's OCR layer but also useful standalone. Same GPL-3.0 + commercial-license caveat as Marker. - [MinerU](https://github.com/opendatalab/MinerU) (Python): High-accuracy document parsing engine from Shanghai AI Laboratory's OpenDataLab — converts PDF, DOCX, PPTX, XLSX, images, and web pages to Markdown/JSON. Dual VLM + OCR engine, 109 languages, MCP server, and native LangChain/Dify/FastGPT integrations. Originally built for InternLM pretraining data prep. Recently relicensed from AGPLv3 to a custom 'MinerU Open Source License' based on Apache-2.0. ## Curated Directories - [awesome-legaltech](https://github.com/Vaquill-AI/awesome-legaltech): Curated list of legal tech resources covering open-source platforms, AI models, MCP servers, datasets, and standards (SALI, LEDES, LegalDocML, Akoma Ntoso). - [Open Source Legal directory](https://opensource.legal/): Directory of open-source tools for legal knowledge work, including document parsing, AI annotation, and the Docxodus redline engine. Maintained alongside the OpenContracts project. - [Free Law Project — Open Source Tools](https://free.law/open-source-tools/): Landing page for the Free Law Project's portfolio of BSD-licensed legal-data libraries (Juriscraper, Eyecite, CourtListener, X-Ray, Doctor, Inception, etc.). ## Legal NLP Libraries & Models - [ALEA Institute](https://github.com/alea-institute): Non-profit research org focused on ethical AI for the legal, financial, and governmental domains. Maintains the KL3M model family, KL3M tokenizers, and the KL3M Data Project — all built on copyright-clean, legally permissible training data. Notable for being the first LLM family to obtain Fairly Trained's L-Certification. - [KL3M](https://github.com/alea-institute/kl3m-data) (Python, MIT): Family of small language models, tokenizers, and embeddings purpose-built for legal, regulatory, and financial text. Trained on copyright-clean data (the KL3M Data Project — 132M+ documents, trillions of tokens). Models are on HuggingFace under alea-institute/*; tokenizers achieve 9-83% better token efficiency than GPT-4o/Llama3 on domain text. Originally developed by 273 Ventures, donated to ALEA. - [LexNLP](https://github.com/LexPredict/lexpredict-lexnlp) (Jupyter Notebook, AGPL-3.0): Mature Python library for NLP and information extraction from legal and regulatory text. Handles legal-aware sentence segmentation (knows about LLC., F.3d, U.S.C.), extraction of dates/amounts/durations/PII/citations/regulatory references, and pre-trained classifiers for document and clause type. Dual-licensed AGPL-3.0 / commercial. - [Blackstone](https://github.com/ICLRandD/Blackstone) (Python, Apache-2.0): spaCy pipeline and model trained for NLP on long-form unstructured legal text (judgments, scholarly articles, pleadings) — the first open-source model targeted at common-law entities and concepts. Built by the research lab of the Incorporated Council of Law Reporting for England and Wales. Apache-2.0. Note: experimental and not actively maintained, but still a strong reference for UK/common-law NER. - [LEGAL-BERT](https://huggingface.co/nlpaueb/legal-bert-base-uncased): Family of BERT models pre-trained on 12GB of English legal text (legislation, court cases, contracts) by the AUEB NLP Group. Includes a base model, a 33%-size light version (~4x faster), and sub-domain variants for contracts, EURLEX, and ECHR. Distributed via HuggingFace under nlpaueb/*. CC-BY-SA-4.0. ## Legal AI Datasets & Benchmarks - [CUAD (Contract Understanding Atticus Dataset)](https://github.com/TheAtticusProject/cuad) (Python): Expert-annotated NLP benchmark for contract review (NeurIPS 2021). 510 commercial contracts with 13,000+ labels across 41 clause categories that lawyers look for in M&A and corporate transactions. Curated by The Atticus Project, a non-profit of legal experts. Standard benchmark for any contract-review model evaluation. - [MAUD (Merger Agreement Understanding Dataset)](https://github.com/TheAtticusProject/maud) (Python): Expert-annotated reading-comprehension dataset for M&A merger agreements (EMNLP 2023). 39,000+ examples and 47,000+ annotations across 92 deal points, drawn from the ABA's 2021 Public Target Deal Points Study. The standard benchmark for M&A document comprehension models. - [ACORD (Atticus Clause Retrieval Dataset)](https://www.atticusprojectai.org/acord): First expert-annotated retrieval benchmark for contract drafting (ACL 2025). 114 lawyer-written queries paired with 126,000+ clause candidates rated 1-5 stars by attorneys. Focuses on heavily negotiated clauses — Limitation of Liability, Indemnification, Change of Control, Most Favored Nation. Dataset on HuggingFace at theatticusproject/acord. CC-BY-4.0. - [LexGLUE](https://github.com/coastalcph/lex-glue) (Python): Benchmark suite for legal language understanding in English (ACL 2022). Aggregates seven existing legal NLP tasks — ECtHR, SCOTUS, EUR-LEX, LEDGAR, UNFAIR-ToS, CaseHOLD — under a common evaluation harness built on HuggingFace Transformers. Standard reference point for evaluating legal foundation models. - [docx-corpus](https://github.com/superdoc-dev/docx-corpus) (TypeScript, MIT): The largest open corpus of classified DOCX documents, mined from Common Crawl and classified by type (legal, etc.) and language. Pipeline: AWS Lambda CDX filter → WARC scraper → Docling text extraction → ModernBERT classifier → HuggingFace export. Browse and download at docxcorp.us with a faceted API. - [LegalLAMA & LeXFiles](https://github.com/coastalcph/lexlms) (Python): Two paired releases (Chalkidis et al., ACL 2023). LeXFiles: 6M-document, 19B-token English legal corpus spanning 6 legal systems (EU, ECHR, Canada, US, UK, India) for pretraining. LegalLAMA: 8-task probing benchmark for assessing how much legal knowledge a PLM acquired in pretraining. Plus the LexLMs models trained on LeXFiles. CC-BY. - [CaseHOLD](https://github.com/reglab/casehold) (Python, Apache-2.0): 53,000+ multiple-choice questions for identifying the correct holding of a cited case (Zheng & Guha et al., ICAIL 2021). Designed to be a high-domain-specificity legal benchmark where pretraining on legal text actually moves the needle — companion to the Custom Legal-BERT models. By Stanford RegLab. - [LegalBench](https://github.com/HazyResearch/legalbench) (Python): Collaboratively built benchmark for legal reasoning in foundation models — 162 tasks structured around the IRAC framework (Issue spotting, Rule recall, Rule Application, Conclusion). Co-authored by Stanford CodeX, RegLab, and dozens of legal academics. The standard LLM-era legal-reasoning benchmark. ## Contracts & Templates - [Bonterms](https://github.com/Bonterms): Free, market-calibrated standard commercial agreements maintained by a standing committee of 120+ lawyers. The model: adopt a neutral Standard (Mutual NDA, Cloud Terms/SaaS, DPA, Professional Services, SLA, AI Addendum) as-is and negotiate only a short Cover Page instead of redlining the whole document. Released under CC BY 4.0 with full text on GitHub; selected as the standard agreement for Google Cloud Marketplace in 2026. A contract-standardization play in the spirit of Common Paper / oneNDA. - [Common Paper](https://github.com/CommonPaper): Free standard contracts for SaaS and tech deals, maintained by a committee of attorneys and released under CC BY 4.0. Covers Cloud Service Agreement, MSA, Order Form, Software License, DPA, Professional Services, Pilot, and Design Partner agreements, with SLA and AI variants. Same adopt-the-standard, edit-only-a-cover-page model as Bonterms; full text versioned on GitHub. 40,000+ downloads. - [oneNDA](https://www.onenda.org/): Crowd-sourced, open-source standard NDA written by the legal community and free to use — adopted by 1,000+ companies (Amex, Google, Novartis, Panasonic) since 2021. The standards library also includes the oneNDA Playbook, oneNDA M&A, and oneDPA (a standard Data Processing Agreement). The project grew into the Claustack community and was acquired by Law Insider in 2024, which keeps the standards free. - [NVCA Model Legal Documents](https://nvca.org/model-legal-documents/): The industry-standard suite of model documents for US venture financings, maintained by the National Venture Capital Association with law-firm working groups. Covers the Term Sheet, Stock Purchase Agreement, Certificate of Incorporation, Investors' Rights Agreement, Voting Agreement, Right of First Refusal & Co-Sale Agreement, Management Rights Letter, and Indemnification Agreement. The October 2, 2025 refresh added tranched/milestone financings, two-way national-security 'persons of concern' reps, and an expanded governance policy suite. Free to use, though not released under a formal open license — distributed as Word files from nvca.org rather than a public repo. ## Legal Standards & Taxonomies - [SALI LMSS (Legal Matter Specification Standard)](https://github.com/sali-legal/LMSS) (MIT): The legal industry's shared taxonomy for describing legal work — 18,000+ tags across services, areas of law, industries, and matter attributes, each with a stable IRI. Maintained as an OWL ontology by the SALI Alliance non-profit. Companion repo sali-legal/api provides the SALI API spec for matter-data exchange between firms, vendors, and clients. MIT (code) / CC-BY-ND (taxonomy). - [python-lmss](https://github.com/273v/python-lmss) (Python, MIT): Python library for loading, querying, and editing the SALI LMSS ontology. Provides an LMSSGraph class with label/definition search and concept-type filtering — the practical way to use SALI tags from Python rather than parsing the OWL file yourself. By 273v (the team behind ALEA Institute / KL3M). ## LLM & RAG Frameworks - [Instructor](https://github.com/567-labs/instructor) (Python, MIT): The standard library for getting structured, validated outputs from LLMs. Define a Pydantic model, get type-safe data back with automatic retries on validation failure. Works with OpenAI, Anthropic, Google, Mistral, Cohere, Ollama, DeepSeek, and 15+ providers. Multi-language: Python, TypeScript, Go, Ruby, Elixir, Rust. The right tool for clause extraction, deal-point structuring, and any 'pull X from a contract' workflow. MIT. - [lambdaprompt](https://github.com/approximatelabs/lambdaprompt) (Python, MIT): Functional-programming interface for building LLM-driven systems — treats prompts as composable Python functions with Jinja templating, callable directly or exposed as a FastAPI service. Lighter and more pre-LangChain-era in style than newer frameworks. Smaller community than Instructor; useful as a reference for the 'prompts as functions' design pattern. - [Haystack](https://github.com/deepset-ai/haystack) (MDX, Apache-2.0): End-to-end framework for building LLM applications, retrieval-augmented generation (RAG), and search systems. Pipeline-based architecture with components for document stores, retrievers (BM25, dense, hybrid), readers, generators, and rankers. Production-grade alternative to LangChain/LlamaIndex; widely used in regulated environments where pipeline introspection matters. Apache-2.0. - [DSPy](https://github.com/stanfordnlp/dspy) (Python, MIT): Stanford NLP's framework for programming — not prompting — language models. Define modules with signatures, then optimize prompts and few-shot examples automatically against a metric. Particularly relevant for legal tasks where prompt engineering is brittle and a benchmark like CUAD/MAUD/LegalBench can drive optimization. MIT. - [Outlines](https://github.com/dottxt-ai/outlines) (Python, Apache-2.0): Constrained-decoding framework that guarantees structured outputs from LLMs at the token level — the model can only emit tokens that match a Pydantic schema, regex, or context-free grammar. More rigorous than Instructor for cases where you absolutely cannot afford a parsing failure (e.g. schema-locked clause extraction, SALI-tag generation). Maintained by .txt company. Apache-2.0. - [PydanticAI](https://github.com/pydantic/pydantic-ai) (Python, MIT): Production-grade agent framework from the Pydantic team — type-safe agents with tools, dependency injection, structured outputs, durable execution, MCP/A2A integration, and built-in evals. Positioned as 'FastAPI for agents' and complements Instructor: Instructor for one-shot extraction, PydanticAI when you need full agent loops with tool use and observability. MIT. - [spaCy](https://github.com/explosion/spaCy) (Python, MIT): Industrial-strength NLP library — tokenization, POS tagging, NER, dependency parsing, lemmatization, custom pipelines. The substrate for Blackstone (legal model), Presidio (PII detection), and many legal-NLP research projects. Production-ready and fast; the default pick for non-LLM NLP. MIT. - [Transformers](https://github.com/huggingface/transformers) (Python, Apache-2.0): HuggingFace's reference library for transformer models — the canonical way to load and run LEGAL-BERT, KL3M, LegalLAMA models, custom Legal-BERT, and essentially every other legal foundation model in this catalog. PyTorch, TensorFlow, and JAX backends. Apache-2.0. - [vLLM](https://github.com/vllm-project/vllm) (Python, Apache-2.0): High-throughput, memory-efficient inference engine for LLMs. PagedAttention, continuous batching, OpenAI-compatible API. The default open-source choice when self-hosting models like KL3M, Llama, Qwen, or DeepSeek for legal workloads where keeping data on-premises matters. Apache-2.0.