DEV Community

Cover image for LOCALRECEIPT.AI
Ankit Sharma
Ankit Sharma

Posted on

LOCALRECEIPT.AI

Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle Submission đź’¸

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle

What I Built

I built LocalReceiptAI, an offline-first invoice and receipt parser tailored specifically for freelance web developers and independent consultants. It scans messy PDF invoices or receipt images, extracts line items, tags expenses for tax categories, and outputs clean structured CSVs or JSON summaries.

Freelancers waste hours every month manually organizing receipts for tax season, but commercial accounting SaaS options are expensive monthly subscriptions or risk leaking sensitive client billing names to third-party cloud APIs. LocalReceiptAI solves this by running entirely on a local machine, processing documents securely with zero data leakage.

Code

The entire project is open-source and structured for easy local deployment:# Core snippet from processor.py using Ollama and Llama 3 local inference
import ollama
import json

def parse_receipt(image_path: str) -> dict:
prompt = "Extract the vendor name, date, total amount, and line items into valid JSON."
response = ollama.chat(
model='llama3',
messages=[{'role': 'user', 'content': prompt, 'images': [image_path]}],
format='json'
)
return json.loads(response['message']['content'])

How I Built It

LocalReceiptAI is built as a lightweight Python desktop app using Streamlit for the user interface and Ollama running Llama 3 (8B) locally for vision and text extraction.

Frontend & Interface: Built with Streamlit so users can simply drag and drop PDFs or photos of receipts into a browser window running locally at localhost:8501.

Local Inference Engine: Powered by Ollama and Llama 3, handling OCR-to-structured-data translation completely offline on standard consumer hardware without requiring an internet connection or external API keys.

Data Export: Automatically aggregates parsed data into a monthly ledger spreadsheet ready for accounting software.

Why Does Open Innovation Matter?

Open innovation is the absolute core of what makes LocalReceiptAI viable as a micro-business:

Zero API Costs: Closed-source vision APIs charge per request, which quickly eats into margins for a tool targeted at freelancers trying to save money. Running open-weight models locally means marginal inference cost is zero.

Absolute Data Privacy: Freelancers handle invoices containing confidential client names, project scopes, and billing addresses. Sending these to third-party cloud endpoints violates privacy expectations. Local execution ensures sensitive financial data never leaves the laptop.

Model Flexibility: I can easily swap out or fine-tune models depending on hardware performance constraints—moving from Llama 3 to smaller specialized models without changing proprietary vendor integrations or facing sudden pricing tier shifts.

My First User

I tested LocalReceiptAI with a freelance UI/UX designer friend who had a shoebox full of travel and software receipts for quarterly taxes.

What they said: "This saved me at least three hours of manual data entry, and I love that my clients' names aren't being uploaded to some random tech company's server."

Did they pay? They didn't pay cash yet since it's an open-source alpha, but they enthusiastically offered to buy me lunch and said they would gladly pay a one-time $29 lifetime license fee for a packaged desktop binary with auto-categorization rules.

What they asked for next: Native integration with local CSV export formats compatible with popular regional tax software.

Top comments (0)