Cuadre: turning Panama's paper receipts into a tax-ready spreadsheet, with Gemma on my laptop
Description and use
Cuadre turns Panamanian paper receipts into a tax‑ready spreadsheet using a local Gemma 4 E2B model, automating manual transcription while preserving privacy.
Problem
Freelancers and small businesses in Panama must manually transcribe paper receipts into spreadsheets to calculate ITBMS tax credits, a tedious process that often involves blurry photos and privacy concerns.
Outcome
Cuadre processes 6 demo receipts in 6–27 s per image on a 16 GB RAM laptop, correctly calculates ITBMS totals, detects duplicates, flags anomalous RUCs and exempt items, and outputs a ready‑to‑use CSV for accountants.
Workflow
- Place receipt photos in a folder
- Run the Cuadre command
- Gemma 4 E2B reads each photo and returns a JSON with merchant, RUC, date, subtotal, ITBMS, total
- Python code validates fields, detects duplicates and anomalies
- Totals are calculated with Decimal math
- Output files: recibos.csv, resumen.md, review list
Evidence
Cuadre does the typing. You put the receipt photos in a folder and run one command. You get: recibos.csv, resumen.md, a short list of the receipts a human should double-check
The photos are read by Gemma, an open-weight model, running on my own laptop. They never leave the machine.
Python standard library only at runtime, 42 tests, and a cache keyed by the photo's hash, so when you add next week's receipts and run it again, only the new photos are read.
Gemma runs with temperature: 0 and thinking turned off: transcription doesn't need reasoning, and the same photo always gets the same reading.
- Record date: 2026-10-19T17:41:03.349Z