跳到正文
DEV Community· Abhinav Nayak·· 3 小時前AI 評分37

BillCraft AI:發票生成器與 AI 驅動的發票讀取器

BillCraft AI: Invoice Generator + AI-Powered Invoice Reader

AI 導讀

BillCraft AI 為自由工作者、承辦商及小型商戶打造發票生成與 AI 發票/收據讀取工具,可生成品牌 PDF 發票並擷取文件明細。系統結合 RapidOCR、PyMuPDF 與本機 Ollama 上的 Qwen 2.5 7B,並在伺服器端以 Python 驗算明細。示範環境另可使用 Cloudflare Workers AI 作雲端備援。

正文

Cover image for BillCraft AI: Invoice Generator + AI-Powered Invoice Reader

Abhinav Nayak

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

BillCraft AI is a privacy-first, intelligent invoice studio built for freelancers, contractors, and small business owners. It automates the tedious work of creating invoices and digitizing messy receipts without sending private financial data to third-party cloud servers.

The Problem It Solves

Freelancers and solopreneurs spend hours every month manually deciphering paper receipts, supplier invoices, and re-typing numbers into spreadsheets. Mainstream SaaS accounting tools charge costly monthly subscriptions ($30–$70/mo) and upload sensitive financial documents, client names, and banking details to proprietary cloud APIs.

The Solution

BillCraft AI solves this through two streamlined workflows:

  1. Smart Invoice Generator: A fast workspace with persistent business profiles saved in local storage, dynamic real-time totals, one-click AI item description enhancement, and pixel-perfect branded PDF generation.
  2. AI Invoice & Receipt Reader: A drag-and-drop document scanner that reads any PDF or image receipt using local OCR (RapidOCR + PyMuPDF), extracts structured line items via open-weight Qwen 2.5 7B, validates math integrity on the server, and transfers extracted data into the generator in a single click.

Freelancers, independent consultants, and micro-retailers who value financial confidentiality and want to save hours on bookkeeping would readily use and pay for this solution.

Demo

Code

🧾 BillCraft AI

AI-powered invoice generator & reader built for freelancers and small businesses.
Powered by local Ollama (Qwen) for automated invoice data extraction and line-item enhancement, with strict server-side Python math validation and branded PDF export.


🚀 Key Features

  1. Invoice Generator:

    • Persistent inline business profile (Company Name, Email, Tax Rate %, Payment Terms) saved automatically in your browser's localStorage.
    • Dynamic line items with auto-calculated subtotals, tax, and grand totals.
    • ✨ AI Item Description: One-click enhancement of product/service descriptions using local Ollama.
    • High-Resolution PDF Generation: Download professional branded PDF invoices matching the theme.
  2. Invoice Reader (OCR + Local AI):

    • Quick Drag & Drop: Drop any PDF document, scanned receipt, PNG, or JPG invoice.
    • Document OCR: Uses RapidOCR and PyMuPDF for fast vector and scanned document text extraction.
    • Local Ollama Extraction: Sends text to your local Qwen model (qwen2.5:7b) to extract vendor, client…

How I Built It

BillCraft AI is designed around open-weight models and local inference:

  • Open-Weight Model: Qwen 2.5 7B (qwen2.5:7b) by Alibaba Cloud — selected for its high benchmark performance in structured JSON extraction and financial reasoning.
  • Local Inference Engine: Ollama running locally on localhost:11434, ensuring 100% private, zero-latency inference.
  • Cloud Fallback: For live demonstrations, the backend connects to Cloudflare Workers AI (@cf/qwen/qwen2.5-7b-instruct) for serverless, zero-cold-start inference on global GPUs.
  • OCR & Document Extraction: RapidOCR (ONNX runtime) combined with PyMuPDF (fitz) for spatial bounding-box layout clustering.
  • Math Verification Service: Strict server-side Python calculations reconcile line-item arithmetic (Quantity × Rate = Amount, Subtotal + Tax = Grand Total) before auto-saving into SQLite.
  • Tech Stack: React 19, TypeScript, Vite, Tailwind CSS v4, FastAPI, SQLAlchemy, SQLite, and ReportLab.

Why Does Open Innovation Matter?

  1. Absolute Data Privacy: Invoices contain sensitive client information, bank details, and pricing margins. Closed APIs process and retain this data on their servers; running open-weight Qwen 2.5 on Ollama guarantees financial data never leaves the user's device.
  2. Zero Marginal Cost: Closed AI APIs charge per token, making bulk invoice parsing cost-prohibitive. Open weights eliminate per-token charges entirely.
  3. Offline Reliability: Small businesses and contractors often work in spots with spotty internet connectivity. BillCraft AI operates fully offline.
  4. No Vendor Lock-In: Independent developers and businesses retain complete ownership over their infrastructure without fearing API price increases or unexpected deprecations.

My Agent Session

Throughout the development of BillCraft AI, I collaborated with Antigravity AI (Google DeepMind's agentic coding assistant) as an autonomous pair-programmer to:

  • Architect the multi-stage OCR and Qwen 2.5 JSON parser with server-side validation.
  • Build the full-stack UI using React 19 and Tailwind CSS v4.
  • Streamline deployment to Render with static file integration and Cloudflare Workers AI edge fallback.

Prize Categories

  • Open Source AI Champion
  • Qwen 2.5 7B locally via Ollama
  • Best Productivity / Developer Tool

來源:DEV Community · dev.to