Back to portfolio

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.

Public LLM Local PDF repository for offline Argentine legal-document extraction
realPublic source for the offline extraction pipeline.
At a glance

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
Contribution

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.

Tradeoff

Keep documents and inference local while turning probabilistic model output into a structured proposal that can be measured, repaired, and reviewed.

Evidence

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
01

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.

02

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.

03

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.

04

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.