DEV Community

Sujal Amati
Sujal Amati

Posted on

SoloOps AI: An Open-Weight AI Expense Agent for Freelancers

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

SoloOps AI: An Open-Weight AI Expense Agent for Freelancers

Freelancers and solo founders shouldn't have to spend hours manually organizing invoices and receipts.

I built SoloOps AI, an expense-management assistant that turns receipt images and invoice PDFs into structured expense records that users can review, correct, approve, and export to CSV.

The goal is simple: automate repetitive bookkeeping tasks while keeping people in control of their financial data.

What I Built

SoloOps AI is a local-first expense management application designed for freelancers, independent consultants, and small business owners.

The typical workflow involves collecting receipts from different sources, extracting the relevant information, entering it into a spreadsheet, and checking that the amounts are correct. This is repetitive work, and mistakes can easily slip through.

SoloOps AI automates much of this workflow.

What it can do:

  • Upload receipt images and invoice PDFs.

  • Extract document text using OCR.

  • Use an open-weight language model to identify merchants, dates, currencies, subtotals, taxes, totals, and expense categories.

  • Flag missing fields, suspicious totals, and possible duplicate expenses.

  • Let users edit extracted information and approve records.

  • Display expense summaries in a dashboard.

  • Export approved expenses to CSV.

The intended user is someone who wants to spend less time entering financial data and more time running their business.

I designed the application around an important principle: AI should assist with data entry, not silently make financial decisions. Every extracted record can be reviewed and corrected before approval.

Demo

Demo video: https://youtu.be/nOJrkddMuHQ
The demo walks through the complete workflow:

  1. Uploading a receipt or invoice.
    Upload documents

  2. Extracting structured expense information.

  3. Reviewing fields that need attention.
    Review expenses

  4. Correcting and approving an expense.

  5. Exporting the approved expense ledger to CSV.
    CSV export

Code

GitHub repository: https://github.com/sujalamati/soloops-ai

The project is built around a React frontend and a Python backend, with the AI extraction pipeline separated from the validation and approval logic.

The repository includes the application source code, setup instructions, configuration templates, and testing code.

I'd love feedback on the architecture, extraction reliability, and ways to make the workflow more useful for freelancers.

How I Built It

I used a combination of familiar web technologies and open-weight AI tools.

Frontend — React, Vite, and CSS

The frontend provides the dashboard, receipt upload interface, expense table, editing controls, approval actions, and CSV export.

I wanted to build a usable business application rather than just a chat interface wrapped around a language model.

Backend — Python and FastAPI

FastAPI handles document uploads, extraction requests, expense records, review actions, and exports. SQLite stores the structured expense data.

The backend exposes individual endpoints for uploading documents, listing expenses, editing records, approving expenses, deleting records, and exporting approved expenses.

OCR — Tesseract and PyMuPDF

Digital PDFs can contain extractable text, while scanned documents and images require OCR.

I use PyMuPDF to extract text from digital PDFs and Tesseract to recognize text in scanned documents and receipt images.

OCR is imperfect. It can reorder lines, confuse characters, and separate amounts from their labels. This makes reliable downstream extraction and validation particularly important.

Open-weight AI — Ollama

Ollama runs the language model used to extract structured expense information from OCR text.

The model receives the document text and a schema describing the expected output. The goal is to return predictable fields rather than an unstructured response.

I started with Qwen2.5 3B and experimented with structured output, prompting, and schema validation. Smaller models can struggle with noisy documents or omit fields, so model selection is an empirical decision rather than simply choosing the largest available model.

Validation — Python and Pydantic

The model's output is validated against a Pydantic schema. Additional Python checks flag missing values, suspicious totals, and possible duplicate records.

For example, an invoice might contain line-item amounts that don't agree with its stated subtotal. Valid JSON alone cannot catch that discrepancy.

This is why I separated the workflow into distinct stages:

OCR → AI extraction → deterministic validation → human review → approval → export.

The model extracts information, but the application controls what gets approved.

Why Does Open Innovation Matter?

For an application that handles invoices and receipts, open-weight AI offers practical benefits beyond experimentation.

1. More control over financial data
When SoloOps AI runs locally, documents can remain on the user's machine instead of being sent to a third-party model API.
This matters because invoices and receipts can contain business details, addresses, transaction amounts, and other sensitive information.
A hosted deployment has different privacy implications, so local processing and hosted processing need to be treated separately.

2. Freedom to change models
The extraction model is not hardwired to a proprietary AI provider. I can compare different open-weight models, experiment with quantization, and choose a model based on accuracy, latency, and hardware requirements.
This makes it possible to optimize for the actual workload instead of accepting a single provider's trade-offs.

3. Control over inference costs
Local inference can eliminate per-request API charges, although it still consumes computing resources, electricity, and storage.
For a product processing many small documents, understanding the actual cost per document is important to determining whether the business model makes sense.

4. Inspectable and replaceable components
The extraction pipeline, validation rules, storage, and approval process are separate components. I can improve one part without redesigning the entire application.
Open innovation does not automatically make a model more accurate or secure. It gives developers more flexibility to test, inspect, adapt, and improve the system.

Top comments (0)