[KongchangAI]
· 2 min read· 1,490 words

BillCraft AI: A Privacy-First Invoicing Tool Powered by Local LLMs

BillCraft AI: A Privacy-First Invoicing Tool Powered by Local LLMs

BillCraft AI uses Qwen 2.5 7B + Ollama local inference to provide a privacy-first invoicing tool for freelancers.

BillCraft AI is an invoicing workbench submitted by developer abhinavnayak21 to the Hacktoberfest open-source AI challenge, aimed at freelancers, independent consultants, and small retailers, with privacy-first as its core positioning. It includes a smart invoice generator and an AI receipt reader. Technically, it uses Qwen 2.5 7B with Ollama for local inference, relies on RapidOCR and PyMuPDF for document processing, and adopts a two-layer "AI extraction + Python rule validation" design to verify line-item arithmetic. The demo environment falls back to Cloudflare Workers AI when local Ollama is unreachable, which creates some tension with the privacy promise.

Freelancers and small businesses have long had their bookkeeping pain points ignored: on one hand, SaaS subscriptions costing $30 to $70 per month; on the other, the privacy risk of uploading client bank details and quoted profit margins to cloud APIs. BillCraft AI, submitted by developer abhinavnayak21 to the Hacktoberfest open-source AI challenge, attempts to solve both the cost and privacy problems at once through local inference.

BillCraft AI project screenshot

Product Positioning: Turning an Invoicing Tool into a Local-First "Offline Studio"

BillCraft AI is an invoicing workbench for freelancers, independent consultants, and small retailers, with privacy-first as its core selling point. It includes two workflows: one is a smart invoice generator that supports locally persisted business profiles (company name, email, tax rate, and payment terms automatically saved to localStorage), dynamically calculates subtotals, taxes, and totals in real time, polishes product descriptions with a single call to the local model, and exports high-resolution branded PDFs; the other is an AI invoice and receipt reader that accepts drag-and-drop uploads of PDF, PNG, or JPG files, automatically performs OCR and structured field extraction, and imports the results into the generator with one click.

This feature combination is nothing new; the market is full of invoicing tools. BillCraft's differentiation lies in treating "data never leaves the machine" as a hard constraint rather than a marketing talking point—a rather rare trade-off in financial tools.

Technical Architecture: A Local Inference Pipeline of Qwen 2.5 7B + Ollama

The project's technology choices revolve around open-weight models. Structured extraction uses Alibaba Cloud's Qwen 2.5 7B (qwen2.5:7b); the author chose it for its benchmark performance on structured JSON extraction and financial reasoning. The inference engine is locally running Ollama, listening on localhost:11434, delivering zero-latency inference with zero data leakage.

The document processing layer uses RapidOCR (ONNX Runtime) together with PyMuPDF to extract text from vector PDFs and scanned documents, and reconstructs layout structure through spatial bounding box clustering. After extraction, the server verifies line-item arithmetic using strict Python math validation logic—quantity × unit price = amount, subtotal + tax = total—and only writes to SQLite once validation passes. This two-layer design of "AI extraction + rule validation" is a pragmatic engineering approach that sidesteps the well-known unreliability of large models on numerical calculations.

The frontend stack is React 19 + TypeScript + Vite + Tailwind CSS v4, the backend is FastAPI + SQLAlchemy + SQLite, and PDF generation uses ReportLab.

Qwen 2.5 7B is a dense-parameter large language model released by Alibaba Cloud's Tongyi Qianwen team; 7B refers to the 7-billion-parameter scale, which can be quantized and run on consumer GPUs (such as an RTX 3060/4060 with 8GB VRAM) or Apple Silicon unified-memory devices. Compared with 70B-class models, it has a much lower hardware barrier, while still maintaining usable accuracy on instruction following and structured JSON output, making it a common default choice for localized applications—"good enough and able to run." Ollama, meanwhile, is a runtime that packages model weights, quantization formats, and inference services into a single command. After running ollama pull qwen2.5:7b, users get a local HTTP interface listening on port 11434, and its OpenAI-compatible format makes frontend and backend integration extremely cheap. The combination means both model and data reside on the user's device, and inference produces no network round trips—this is the technical precondition that makes "zero data leakage" possible; once you leave Ollama, privacy promises must rely on additional encryption or anonymization measures.

RapidOCR is a lightweight OCR toolchain converted from PaddleOCR models, running inference through ONNX Runtime, which avoids the heavy dependencies of installing PyTorch or PaddlePaddle, making it suitable for deployment on resource-constrained small-to-medium servers or local machines. It is mainly responsible for "turning images into text," while layout reconstruction requires an extra step: when processing financial receipts, the absolute position of text boxes determines which column is quantity and which is unit price, and reading purely by text order easily leads to misalignment. The "spatial bounding box clustering" mentioned in the article is a common technique for solving this problem—aggregating OCR coordinates by row and column to rebuild the table structure before handing it to the large model for field extraction. PyMuPDF handles another path: directly reading the embedded text layer of native vector PDFs, skipping OCR and achieving higher accuracy; only when the PDF is a scan (pure image) does it fall back to the OCR pipeline. This "vector-first, scan-as-fallback" combination is a common engineering practice in document processing projects.

Cloud Fallback: The Trade-offs Between a Demo Environment and Local Deployment

For the availability of the online demo, the backend switches to Cloudflare Workers AI (@cf/qwen/qwen2.5-7b-instruct) when it cannot reach local Ollama, leveraging its serverless GPU to achieve zero cold-start inference.

There is a noteworthy tension here: the product's core promise is privacy-first, but the demo environment actually relies on cloud inference. The author does not detail the trigger conditions for the switch or the user notification mechanism. If users end up on the cloud path without knowing it, the privacy promise is compromised. This is not a fatal issue, but it is a boundary in product design that needs clearer definition.

Cloudflare Workers AI is Cloudflare's serverless inference service provided on its global edge nodes. Developers can invoke hosted models via REST API or Workers bindings, billed by Neurons (a compute-based billing unit). The @cf/qwen/qwen2.5-7b-instruct mentioned in the article is Cloudflare's hosted instruction-tuned version of Qwen 2.5 7B, sharing the same origin as the locally used weights, so output formats remain largely consistent after switching, and there is no need to write a separate parsing logic for each path. Its value lies in "availability fallback": when the demo site is deployed in a GPU-less environment like Render, with no local Ollama to connect to, edge inference lets visitors immediately experience the functionality in the browser without having to install models themselves first. Note that this convenience inherently conflicts with the privacy-first positioning—once a request leaves the user's device, the data enters third-party infrastructure. A rigorous implementation should therefore clearly notify users before sending requests, or provide a "refuse cloud fallback" toggle.

Four Real-World Values of Open Weights for Financial Tools

In the Why Open Innovation section, the author lays out his argument:

  • Absolute data privacy: invoices contain client information, banking details, and pricing margins; closed-source APIs process and retain this data, while running Qwen locally ensures financial data never leaves the device.
  • Zero marginal cost: closed-source APIs charge by token, and batch invoice parsing costs accumulate quickly, whereas open weights eliminate this expense entirely.
  • Offline reliability: small businesses and contractors often work in environments with unstable networks, and BillCraft can run completely offline.
  • No vendor lock-in: no worries about API price hikes or sudden shutdowns.

Among these four points, the first two are the most convincing to the target users. People who actually do monthly bookkeeping are far more sensitive to "paying every time a receipt is uploaded" than to the abstract worry of "vendor lock-in."

Development Process and Ecosystem Positioning

The project was completed by the author in collaboration with Google DeepMind's intelligent coding assistant Antigravity AI, which was mainly responsible for the architecture of the multi-stage OCR and Qwen parser, the full-stack UI with React 19 + Tailwind CSS v4, and the Render deployment and Cloudflare edge fallback. The project was entered in three award categories: Open Source AI Champion, Qwen 2.5 7B Local Deployment, and Best Productivity Tool.

From an ecosystem perspective, BillCraft AI represents a tool form that is gradually taking shape: open-source small models as the inference core, local execution as the privacy boundary, and edge cloud as the availability fallback. Such projects may not replace mature subscription-based financial SaaS in the short term, but for user groups that value data sovereignty more than convenience, it offers a concrete, usable option.

The code is open-sourced on GitHub, and the online version can be tried at billcraft-wzr8.onrender.com, or run locally with the frontend at localhost:5173 and the backend at localhost:8000.

One-line Summary

BillCraft AI uses Qwen 2.5 7B + Ollama local inference to provide a privacy-first invoicing tool for freelancers.

Paragraph Summary

BillCraft AI is an invoicing workbench submitted by developer abhinavnayak21 to the Hacktoberfest open-source AI challenge, aimed at freelancers, independent consultants, and small retailers, with privacy-first as its core positioning. It includes two workflows: a smart invoice generator, which supports locally persisted business profiles, real-time tax calculation, and branded PDF export; and an AI receipt reader, which performs OCR and structured field extraction from drag-and-drop PDFs/images. Technically, it uses Qwen 2.5 7B with Ollama for local inference, relies on RapidOCR and PyMuPDF for document processing, and adopts a two-layer "AI extraction + Python rule validation" design to verify line-item arithmetic. The demo environment falls back to Cloudflare Workers AI when local Ollama is unreachable, which creates some tension with the privacy promise, and the transparency of the switching logic deserves attention.

#BillCraft AI#privacy-first invoicing#Qwen 2.5 7B#Ollama#local LLM#invoice OCR#structured extraction#open-source tool#freelancer software#Cloudflare Workers AI
Share:

Related articles