Cuadre
An open-source tool for converting local receipts into tax forms. It uses the Gemma vision model to transcribe Panamanian paper receipts locally, while code performs amount calculation, RUC validation, deduplication and aggregation, so data never leaves the device.
Timeline (last 90 days)
Cuadre is an open-source project that uses a locally running Gemma model to automatically extract information from photos of Panamanian receipts and generate tax tables (CSV, summary Markdown, and a to-review checklist).
Cuadre's core design principle is "the model transcribes, the code calculates": Gemma is only responsible for copying the printed content on the receipt, and all arithmetic, validation, and summarization are done by ordinary Python code.
Cuadre uses Ollama's format field to pass in a JSON Schema, restricting Gemma's output to valid JSON at the sampling stage through constrained decoding, preventing the model from returning extra fields or fabricating categories.
Cuadre uses decimal.Decimal in informe.py for summation, avoiding the IEEE 754 floating-point rounding drift of Python floats and ensuring tax summaries match manual calculations.
On a laptop with 16GB of RAM and no GPU, Cuadre takes 6 to 27 seconds to process one receipt.
Cuadre runs Gemma with temperature: 0 and thinking mode disabled to ensure consistent reading results for the same photo.
In the demo, the total paid ITBMS computed by Cuadre across six fictional receipts was B/. 10.98, exactly matching the manual calculation; the system recognized duplicate photos without double-counting, and flagged issues such as truncated RUC and missing tax-amount lines for review.
Cuadre only checks the format shape of Panama's RUC and does not validate the check digit, because the author has not yet verified the tax authority's algorithm.
Cuadre's entire system depends only on the Python standard library at runtime, ships with 42 tests, and uses photo hashing for caching so that repeated runs only process new photos.
When running Gemma with Ollama, Cuadre's only network connection is localhost:11434, and the code does not accept any other address, ensuring receipt data does not leave the local machine.
3 more timeline events
All Facts (13)
Cuadre is an open-source project that uses a locally running Gemma model to automatically extract information from photos of Panamanian receipts and generate tax tables (CSV, summary Markdown, and a to-review checklist).
50%UnverifiedCuadre's core design principle is "the model transcribes, the code calculates": Gemma is only responsible for copying the printed content on the receipt, and all arithmetic, validation, and summarization are done by ordinary Python code.
50%UnverifiedCuadre uses Ollama's format field to pass in a JSON Schema, restricting Gemma's output to valid JSON at the sampling stage through constrained decoding, preventing the model from returning extra fields or fabricating categories.
50%UnverifiedCuadre uses decimal.Decimal in informe.py for summation, avoiding the IEEE 754 floating-point rounding drift of Python floats and ensuring tax summaries match manual calculations.
50%UnverifiedOn a laptop with 16GB of RAM and no GPU, Cuadre takes 6 to 27 seconds to process one receipt.
50%UnverifiedCuadre runs Gemma with temperature: 0 and thinking mode disabled to ensure consistent reading results for the same photo.
50%UnverifiedAn accountant serving 30 clients with about 100 receipts per client needs to read about 3000 receipts per month; using a local model costs only electricity, with no per-receipt billing or quota limits.
50%UnverifiedCuadre has currently only been tested on six fictional receipts and has not yet been run on real receipts; next steps are to test on real receipts, seek accountants' willingness to pay, and open-source the codebase.
50%UnverifiedCuadre only checks the format shape of Panama's RUC and does not validate the check digit, because the author has not yet verified the tax authority's algorithm.
50%UnverifiedCuadre's entire system depends only on the Python standard library at runtime, ships with 42 tests, and uses photo hashing for caching so that repeated runs only process new photos.
50%UnverifiedWhen running Gemma with Ollama, Cuadre's only network connection is localhost:11434, and the code does not accept any other address, ensuring receipt data does not leave the local machine.
50%UnverifiedIn the demo, the total paid ITBMS computed by Cuadre across six fictional receipts was B/. 10.98, exactly matching the manual calculation; the system recognized duplicate photos without double-counting, and flagged issues such as truncated RUC and missing tax-amount lines for review.
50%UnverifiedIn testing, Gemma copied the label "ITBMS 7%" into the itbms field instead of the amount on all six receipts; the fix was to have Gemma return the full printed line and let the code extract the last amount.
50%