Built extraction, local Qwen2.5-7B inference through llama.cpp, structured JSON generation, schema validation, repair, source anchoring, retries, evaluation, and tamper-evident audit logs.
Offline document AI / 139 tests
LLM Local PDF
A local Python pipeline that turns sensitive Argentine legal PDFs into structured, reviewable JSON without uploading documents to a SaaS model.

What I owned
- Period
- 2026
- Role
- Applied AI engineering; end-to-end implementation
- Team
- Independent engineering project
- Users
- People reviewing sensitive Argentine legal documents
- Status
- Working offline pipeline; public source; 139 automated tests
Keep documents and inference local while turning probabilistic model output into a structured proposal that can be measured, repaired, and reviewed.
Public repository, documented local deployment, and 139 automated tests. The case makes no production-adoption or accuracy claim beyond the implemented evaluation workflow.
- Model
- Qwen2.5-7B
- Runtime
- llama.cpp + GGUF
- Evaluation
- Field-level golden set
- Tests
- 139 automated tests
Local inference is a product boundary
The pipeline extracts text and runs Qwen2.5-7B through llama.cpp on the local machine. Documents and inference do not leave the environment for a hosted model.

Model output must become a valid proposal
The LLM produces structured JSON, but the workflow does not trust the first response. JSON repair, schema validation, field-level source anchoring, and bounded retries either produce a reviewable result or an explicit failure.
Evaluation is part of the implementation
A field-level golden set measures extraction behavior. The suite covers expected values, malformed output, missing anchors, retry behavior, audit integrity, and other failure paths across 139 automated tests.
Reviewability over autonomy
The output is a proposal for human review, not a legal decision or automatic external action. Tamper-evident audit logs preserve what ran and how the result changed.