FinanceCase study 15 / 20
Invoice System
A multi-company invoice generator that saves each invoice to a short, stable link. Create one by hand, or from a chat message through Butler.
Role
Sole designer and engineer
Status
● Running in production
Models
No model in the system of record · Butler drives it from chat
Stack
Python stdlib server · JSON storage · Atomic writes · Single-file front end
The short version
- Four brands, each with its own logo, colours, VAT details and numbering (for example VR-2604-001).
- Each saved invoice gets a short link that never changes, even when the invoice is edited.
- “Invoice Acme £1,200” in chat becomes a drafted invoice through the same API.
01Why I built it
I was paying for invoicing software across four companies. What I actually needed was simple: correct invoices, in the right brand, with a link the client can open, and a way to mark them paid.
02How it works
- CreateA single self-contained HTML generator, by hand, or by Butler posting to the API from a chat message.
- BrandFour companies, each with its own logo, colours, font, address, bank details, VAT handling and per-month numbering.
- SaveA standard-library Python server stores it as JSON with an atomic write and returns a six-character link.
- EditEditing writes back to the same id, so the link the client already has stays correct.
- ManageMark paid or unpaid, soft-delete and restore, export to PDF in the browser.
03Model choices, and why
Turning a chat message into an invoice
Butler's model, upstream of this system
Understanding “invoice Acme £1,200 for the October retainer” is a language task.
Storing, numbering, rendering
No model
The system of record is deterministic. The model drafts; the code decides what's true.
04Where the AI sits
- At the edge, not in the core. Butler parses intent and posts a draft. The invoice server validates and stores it exactly like a hand-made one.
- A draft, then my approval. Butler's invoice is an approval card, not a sent invoice.
05Cost
- Zero for the system itself: standard library only, no framework, no database.
- Replaced a paid invoicing subscription across every company.
06Performance
- About 11 MB of RAM. Starts instantly.
- Atomic writes mean a crash mid-save can't corrupt an invoice. Path-traversal protection on every file access.
07Trade-offs I made
Chose
Python standard library
Over
Flask or Django
Chose
JSON files
Over
A database
Chose
Stable links
Over
A new link per edit
08Guardrails
- Soft-delete with restore.
- Path-traversal protection and atomic writes.
09What I'd do next
- Automatic chasers are already handled by Butler; next is a client-facing paid confirmation on the link itself.
10What this shows
Applied AI engineering
Keeping the model at the edge and the system of record deterministic.
Product
Small scope, done properly, used every month.
Solutions
An API that both a person and an agent can drive the same way.
Across the fleet: every build runs on one self-hosted Linux server, binds to localhost and is reached only over a private Tailscale network. AI inference runs on a Claude subscription through one in-house router (part of Sentry) rather than per-token API keys, with open-weight models on Ollama as the local layer: on the server, and on a 64 GB MacBook Pro shared over Tailscale for heavier local work. Everything is backed up to GitHub and a separate cold disk, and nothing reaches another person without a human tap.
Hiring for applied AI, product or solutions work? I'd like to hear about it.