Use the Left and Right arrow keys, or swipe, to move between sections.

Fund Notices

Fund Notices sorts the capital calls, distribution notices and invoices that fill a fund administrator's inbox, copies out their key numbers and checks that they add up. It runs on a laptop with a local model, so no document ever leaves the machine.

Role
Sole engineer
Built
October 2026
Tools
Python, Ollama, qwen3:4b, scikit-learn, MiniLM, Pydantic, pypdf, Streamlit
Status
Code public

The problem

A fund administrator does the paperwork for investment funds. Its inbox fills with PDFs: capital calls that ask investors for money, distribution notices that pay money out, and invoices from vendors. Each one has to be sorted, its key numbers copied out, and those numbers checked.

Real notices are confidential, so the tool runs on a laptop with a local model and no document leaves the machine. It was built and tested only on synthetic documents with invented names, and every page says so. A document goes to a person only when something looks wrong.

How it works

Inbox PDFText readerType sorterExample finderLocal AI modelSecond opinionPerson reviewMath checks12345678
  1. pypdf pulls the text out of the PDF, and every later step works on that text.
  2. A TF-IDF and logistic regression classifier sorts it as a capital call, a distribution notice or an invoice.
  3. MiniLM embeddings find the closest training document, and its type is a second opinion.
  4. TF-IDF word scores pick the most similar training document of that type, with its true answer, as a worked example.
  5. qwen3:4b, running on the laptop through Ollama, fills in the fields using the worked example, and Pydantic checks its reply, with one retry.
  6. Exact Decimal sums check that the parts add up to each total, and a missing number counts as a problem.
  7. A failed check sends the document to a person, along with the rule that broke.
  8. The document also goes to a person if the type sorter and the second opinion disagree, or if extraction fails twice.

Decisions

  • Chose qwen3:4b as the local model over llama3.2:3b

    I tried both on a few training documents. llama3.2 changed digits inside money amounts, and a changed digit looks like a real number, so a correct notice would fail its checks.

  • Chose copying every number exactly as the page prints it over letting the extractor fix numbers that look wrong

    If extraction fixed a mistake, the math checks would never see it and a wrong notice would pass. So the schema checks types only, and a retry never pushes the model to change a number.

  • Chose a second opinion from a different method over a confidence cutoff on the classifier

    On the training set, the classifier's probabilities were low even when it was right, so any cutoff would have been a guess. A disagreement between two different methods needs no tuning.

By the numbers

Test documents read with every field right
45/45
Planted math errors caught, with no false alarms
6/6
Model time per document on an 8 GB laptop
22 seconds

Where it is now

The pipeline is finished and runs end to end on an 8 GB MacBook Air. A small demo page shows the PDF next to what the tool found. Every number here comes from the evaluate command, which writes the results page itself.

The scores come from synthetic documents made by one generator with three page layouts per type, so they show the method works on this data, not on a real inbox. Next ideas are a larger model where memory allows, more page layouts, and a review queue that says which number looks wrong.

Code on GitHub