Inspiration

Freelancers do not get purchase orders. They get an email that says "please invoice us" with the quantities and prices buried in a paragraph. Turning that into an invoice is ten minutes of careful retyping, and one wrong number costs a week of back-and-forth. We wanted the retyping gone without handing money decisions to a model.

What it does

  • New: Start from what you have: snap a handwritten job note or say the job out loud, and the proposed lines point back to the photo or your words. Clients and their usual rates are remembered, and a home screen shows paid, sent and overdue invoices with a one-tap reminder.
  • Reads the request. Paste or open the client's email. Deterministic rules handle structured requests. For free-form writing, a local AI model proposes the bill-to name, line items, quantities, rates and terms.
  • Shows its sources. Every proposed field is marked "needs review" and links back to the client's exact words. If the model cannot find something (for example, who to send the invoice to), Ledgerly asks instead of guessing.
  • Checks the numbers without the model. After the freelancer confirms the fields, a Python rules engine recomputes line totals, terms and the amount due.
  • Keeps PayPal behind explicit decisions. Creating the PayPal invoice draft requires typing CREATE. Sending it requires a separate, invoice-specific SEND confirmation. Reminders have their own confirmation. An uncertain provider response is recorded as unknown and recovered by lookup, never by blind retry.
  • Follows the money. Saved invoices, decisions, collections and client statements live in a private local ledger.

In the demo, a photographer's client writes one paragraph. Fixed rules find no priced lines; the local model proposes three (2 shoot days at $950, 40 retouched images at $18, $120 backdrop hire). The freelancer supplies the missing recipient, confirms, and the check returns USD 2,740.00 due in 14 days.

How we built it

  • Interface: TypeScript and Vite, with the same Python rules running in the browser through Pyodide for the offline simulation and natively for the operator.
  • Native operator: Python 3.12 on loopback with a private state file, a writer lock and a creation journal.
  • AI: a local Qwen 2.5 model served by Ollama or llama.cpp. Its output is schema-validated and source-grounded before a person sees it; amounts are never taken from the model without a matching source clause.
  • PayPal: server-side Sandbox OAuth and the Invoicing v2 API (create draft, send, payment state, reminders). The adapter is locked to the Sandbox and needs an explicit network opt-in.

Challenges we ran into

  • A model that returns plausible but ungrounded line items. We added clause-level grounding, so a line that does not map to exactly one priced clause stays in review.
  • Lost or ambiguous provider responses. Creation and sending are journaled first, so a crash never produces a duplicate invoice.
  • Local-model latency. Rules run first, and the model is an explicit action, not a default.
  • Sandbox permissions: the Sandbox application used for our recording does not have the Invoicing feature enabled, so PayPal refuses invoice creation for it (403 NOT_AUTHORIZED). The recorded demo therefore stops at the checked draft, before the CREATE confirmation.

Accomplishments that we're proud of

  • A free-form client email becomes a fully checked invoice in under a minute, with every number traceable to the source.
  • The AI can propose but cannot create, send or remind. Those are three separate human confirmations.
  • The same rules engine runs offline in the browser and natively against PayPal.

What we learned

The useful division of labour is narrow: the model reads, deterministic code calculates, and a person decides. Showing the source beside each field matters more to users than a higher extraction score.

What's next

  • Complete a recorded Sandbox invoice create, send and payment with an Invoicing-enabled application.
  • Attachments and PDFs as request sources.
  • Multi-currency invoices and deposits.
  • Scheduled, still human-approved, reminders.

Built With

  • llama.cpp
  • ollama
  • paypal-invoicing-api
  • paypal-sandbox
  • pyodide
  • python
  • qwen2.5
  • typescript
  • vite
Share this project:

Updates

Submission history