DEV Community

Cover image for Local Invoice & Receipt Sorter for Freelancers — Open-Source AI Side Hustle
Viraj Radadiya
Viraj Radadiya

Posted on

Local Invoice & Receipt Sorter for Freelancers — Open-Source AI Side Hustle

What I Built
I built LocalFolio, an offline-first invoice and receipt organizer specifically designed for freelancers, independent contractors, and sole proprietors.

Handling client receipts and expense invoices is tedious, manual, and privacy-sensitive. Freelancers often hesitate to upload sensitive financial documents containing client names, tax IDs, and bank details to cloud-based proprietary APIs. LocalFolio solves this by running entirely on the user's local machine. It ingests messy folders of PDFs, screenshots, and scans, uses a local vision-language model to extract structured metadata (vendor, date, total amount, category, and tax status), and automatically sorts them into clean, structured folder hierarchies with a fully searchable SQLite ledger.

Demo

(Link to video demo showing drag-and-drop receipt ingestion, local extraction, and auto-sorting in action)

Code
You can check out the complete project repository on GitHub:
LocalFolio GitHub Repository

Python

Core local inference pipeline snippet using Ollama and Llama 3 Vision

import json
from pathlib import Path
from ollama import chat

def process_receipt(image_path: Path) -> dict:
prompt = """
Extract the following invoice details in strict JSON format:
- vendor_name
- date (YYYY-MM-DD)
- total_amount
- currency
- category
"""
response = chat(
model='llama3.2-vision',
messages=[{
'role': 'user',
'content': prompt,
'images': [str(image_path)]
}],
format='json'
)
return json.loads(response['message']['content'])
How I Built It
LocalFolio is built around modern open-source AI tools and frameworks:

Open-Weight Models: Powered by Llama 3.2 (3B Vision) running locally via Ollama, allowing high-accuracy multi-modal OCR and structured information extraction without relying on external cloud endpoints.

Agent Harness & Framework: Built using Python, LangChain for structuring extraction prompts, and Pydantic for rigorous data validation.

Local Storage & UI: A lightweight desktop GUI built with Streamlit backed by a local SQLite database and local file system operations to organize documents directly in the user's chosen directory.

Why Does Open Innovation Matter?
Open innovation was non-negotiable for LocalFolio due to three core pillars:

Absolute Data Privacy: Financial invoices contain sensitive PII, proprietary client names, and banking details. Running open-weight models locally ensures that confidential client data never leaves the freelancer's laptop, satisfying strict client confidentiality agreements.

Zero Recurring Infrastructure Costs: Cloud-based OCR and proprietary vision APIs charge per request, which would quickly eat into thin freelancer margins or require a burdensome subscription model. Local inference costs $0.00 per scan, making the side hustle sustainably profitable.

Customizability & Fine-Tuning: Generic invoice parsers often fail on regional tax formats (like GST/VAT structures or niche local currencies). Open models allowed custom prompt engineering and local few-shot tuning specifically tailored to freelance expense categories.

My Agent Session
During the development of LocalFolio, I used DevRelay to record and track my agentic debugging and coding sessions:
View my DevRelay Agent Session

My First User
I tested LocalFolio with my friend Sarah, a freelance graphic designer who spends hours every month sorting through messy PDF invoices and mobile snapshots of tax receipts.

Her Feedback: She loved that she didn't have to create an account, configure API keys, or worry about uploading confidential client retainer agreements to a third-party server.

What she asked for next: She requested an automated export feature to generate a CSV summary sheet formatted specifically for her annual tax filing software.

Would she pay? She stated she would gladly pay a one-time fee of $29 for a polished desktop installer so she never has to manually categorize receipts again.

Prize Categories
Open-Source AI / Local Inference

Developer Productivity & Tools

Top comments (0)