Managing receipts and tracking expenses can be surprisingly time-consuming. Freelancers, independent developers, and small business owners often need to manually enter information from receipts into spreadsheets just to keep their expenses organized.
I wanted to explore a simple solution to this problem using open-source AI.
That's how I built InvoiceSnap AI, a lightweight web application that extracts information from receipt images, organizes it into expense records, and allows users to export their expenses as a CSV file.
The main idea is simple: upload a receipt, let OCR and AI do the initial data entry, review the results, and download an organized expense sheet.
What I Built
InvoiceSnap AI is a locally running receipt-scanning and expense-tracking application designed to reduce repetitive manual work.
Instead of typing every receipt's details into a spreadsheet, users can upload receipt images and let the application extract the relevant information.
The application identifies four main fields:
- Merchant: The name of the shop or business.
- Date: The date associated with the receipt.
- Total amount: The final amount paid.
- Expense category: A category such as Food & Dining, Groceries, Transport, Shopping, Utilities, or Office.
The extracted information appears in an editable expense table. Users can correct inaccurate fields, remove individual entries, view their total expenses, and export the records to CSV for use in spreadsheet applications.
I kept the project focused on a single, practical workflow instead of trying to build a complete accounting platform.
Key features
- Receipt image upload with drag-and-drop support.
- OCR-based text extraction.
- AI-powered structuring and expense categorization.
- Editable expense records.
- Automatic calculation of total expenses.
- CSV export for further analysis.
- Browser-based storage of expense records.
- Local AI processing without a paid hosted AI API.
- A basic rule-based fallback when the local AI model is unavailable.
The goal is to make receipt management simpler while keeping the application lightweight and accessible.
The application is designed to run locally, so a screen recording of the complete workflow is also a useful way to demonstrate it.
Code
GitHub repository:
The project uses a straightforward structure:
- app.py — Flask backend, OCR processing, AI integration, data normalization, and API routes.
- templates/index.html — Main application interface.
- static/style.css — Responsive styling and visual design.
- static/app.js — Receipt uploads, expense table interactions, browser storage, and CSV export.
- requirements.txt — Python dependencies.
- README.md — Installation instructions and configuration details.
I chose a small codebase so that the project is easy to understand, modify, and run locally.
How I Built It
I built InvoiceSnap AI using Python Flask for the backend and HTML, CSS, and JavaScript for the frontend.
The AI workflow combines two components: traditional OCR and an open-weight language model.
- Tesseract OCR
The first step is reading the receipt.
When a user uploads an image, the backend uses Pillow to prepare the image and Tesseract OCR to extract its text.
The image preprocessing includes converting the image to grayscale, improving contrast, correcting its orientation, and enlarging smaller images when appropriate.
OCR produces raw text, which may contain line breaks, imperfect character recognition, and inconsistent formatting.
For example, a receipt might contain information resembling:
- Merchant: City Cafe
- Date: 2026-10-15
- Total: ₹450.00
These are illustrative values rather than results from a particular test receipt.
- Gemma through Ollama
Raw OCR text is not yet a structured expense record. The next step is understanding and organizing that text.
For this, InvoiceSnap AI uses the Gemma open-weight model through Ollama.
The backend sends the extracted text to the local Ollama API with instructions to return structured JSON containing the merchant, date, total amount, and expense category.
The application then normalizes the returned values, validates the category against a predefined list, and standardizes supported date formats before returning the result to the frontend.
This separation of responsibilities is important:
- Tesseract reads text from the image.
- Gemma interprets and organizes the extracted text.
- Flask handles processing, validation, and communication with the frontend.
- JavaScript displays and manages the expense records.
The model can still make mistakes, especially when the receipt is blurry, the OCR output is incomplete, or multiple amounts appear on the same receipt. That's why users can review and correct the results.
- A fallback when AI is unavailable
I also implemented a basic rule-based fallback.
If the local AI request fails, the application attempts to extract expense details using regular expressions and simple keyword-based categorization rules.
These fallback results are marked for review because they may be less reliable than the model-assisted results.
This approach allows the application to handle some failures more gracefully instead of simply stopping whenever the model is unavailable.
- Expense management and CSV export
After processing, the expense record appears in an editable table.
Users can modify fields, delete records, see the combined expense total, and export the current records to CSV.
The expense records are stored in browser localStorage, while receipt images are processed by the backend without being saved as application files.
This keeps the initial implementation simple and avoids the need for a remote database or user account system.
Why Does Open Innovation Matter?
Open innovation is central to the design of InvoiceSnap AI because the application is intended to work without depending on a paid, hosted language-model API.
Privacy and local processing
Receipts can contain sensitive information about a person's purchases, business expenses, and daily activities.
With the local setup, receipt images are processed by the user's own computer, and the AI request goes to the local Ollama service rather than a remote AI provider.
This reduces the need to send receipt contents to an external AI service.
It is important to distinguish this from a security guarantee: users still need to secure their computers, browser data, and local services appropriately.
Lower dependence on API pricing
A paid hosted model can introduce per-request costs, usage limits, and dependence on a third-party service.
Running an open-weight model locally avoids per-request charges from a hosted AI API. However, local inference still has costs, including hardware, electricity, installation, and maintenance.
For a small tool that processes a manageable number of receipts, this trade-off is worth exploring.
Freedom to experiment
Using an open-weight model also gives developers more flexibility.
The model can be changed, prompts can be adjusted, and different local models can be evaluated against the same receipt examples.
That makes it easier to experiment with expense categorization and structured extraction without tying the entire application to a single hosted AI provider.
An accessible starting point for developers
The project also demonstrates how conventional software components and open AI models can work together.
OCR, a local language model, a small backend, and a basic interface are enough to create a useful workflow without building a complicated AI infrastructure.
For me, that is one of the most interesting aspects of open innovation: it gives developers the ability to experiment, learn, and build useful tools with greater control over their technology choices.
Who Could Use It?
InvoiceSnap AI is intended for people who need a simple way to organize receipt information.
Potential users include:
- Freelancers tracking business expenses.
- Independent developers organizing project-related purchases.
- Small business owners managing receipts.
- Students organizing personal spending.
- Consultants who need to prepare expense spreadsheets.
The application is not intended to replace accounting software or provide tax advice. It focuses on one repetitive task: turning receipt information into structured records.
Could It Become a Side Hustle?
The first version is intentionally small, but there are possible ways to build a business around it.
One option would be a free local version with paid installation assistance, customization, or integrations for small businesses.
Another possibility would be offering tailored versions for freelancers or businesses with specific expense categories and export requirements.
The main value proposition would be convenience, local processing, and avoiding dependence on a hosted AI API.
These are potential business models, not validated revenue streams. Actual demand, extraction accuracy, and willingness to pay would need to be tested with real users.
Challenges and Limitations
Building this project also highlights a few practical challenges.
OCR accuracy: Receipt images vary in quality, and poor lighting, unusual layouts, or faded printing can affect extraction.
AI reliability: A language model can misinterpret dates, totals, or categories. Extracted values need human review, particularly when they are used for financial records.
Local hardware requirements: Users need a compatible environment with sufficient resources to run the selected model. Model startup and inference can take time.
Limited scope: This version does not include authentication, cloud synchronization, bank integrations, automatic tax calculations, or multi-user support.
These limitations are reasonable for a first version, and they provide a clear direction for future improvements.
What's Next?
If I continue developing InvoiceSnap AI, I would focus on improving reliability before adding more features.
Some possible next steps include:
- Adding sample receipts for repeatable testing.
- Improving date and currency detection.
- Highlighting uncertain or missing fields.
- Supporting PDF invoices.
- Improving categorization for different business types.
- Adding an option to export more detailed expense reports.
The priority would be to make the extracted records more dependable and reduce the amount of manual correction required.
Conclusion
InvoiceSnap AI started with a simple question: can open-source AI help automate a repetitive task without requiring a paid AI API?
By combining Tesseract OCR, a locally run Gemma model, Flask, and a lightweight frontend, I created a small application focused on receipt scanning and expense organization.
The project is a starting point rather than a finished accounting product, but it demonstrates how open-weight models can be integrated into practical software.
For this challenge, I wanted to keep the idea small, useful, and achievable while exploring the benefits of local AI.
I'd love to hear suggestions for improving receipt extraction, making local AI applications easier to use, or turning small open-source AI tools into sustainable products.
Thanks for reading!
Top comments (0)