跳到正文
DEV Community· Anirban Acharya·· 3 小時前AI 評分38

LocalInvoiceAI:在本機運行、注重私隱的 AI 發票擷取工具

LocalInvoiceAI: Private, AI-Powered Invoice Extraction on Your Own Machine

AI 導讀

LocalInvoiceAI 是本機運行的 AI 發票擷取及管理應用程式,透過 Ollama 使用 Qwen2.5 3B 提取結構化資料。它支援 PDF、圖片及 OCR,並可核對、修改擷取結果和檢查基本金額一致性;確認後的記錄可存入 SQLite、搜尋及匯出 CSV。本機推理有助減少發票資料傳往外部 AI 服務,但不保證完整私隱。

正文

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

What I Built

LocalInvoiceAI is a locally running AI-powered invoice extraction and management app designed to help freelancers, independent professionals, and small businesses reduce the manual work involved in processing invoices.
Invoices contain important information—invoice numbers, dates, vendor details, subtotals, taxes, and totals. Manually entering this information into spreadsheets or accounting systems can be repetitive and time-consuming.
LocalInvoiceAI lets users upload invoice documents and extract structured information using a local AI model. Users can review and correct the extracted fields before saving the invoice.
Key features:
📄 Invoice extraction: Extract invoice details using a locally running AI model.
🔎 PDF and image support: Read text from PDFs and use OCR to process scanned documents and invoice images.
✏️ Human-in-the-loop review: Review and edit extracted information before saving.
✅ Financial validation: Check basic consistency between invoice amounts and totals.
🗄️ Local database: Store invoice records in SQLite.
📊 Dashboard: View invoice records and useful summary information.
🔍 Search and export: Find saved invoices and export records to CSV.
The goal is simple: make invoice processing more convenient without making a cloud AI service a mandatory part of the extraction workflow.
Who could benefit? Freelancers, small business owners, independent contractors, and anyone who regularly handles invoices.

Code

GitHub repository: https://github.com/Anirban846/LocalInvoiceAI

How I Built It

LocalInvoiceAI combines traditional document processing with local AI inference.
Tech stack
Python — application logic and data processing.
Streamlit — interactive web interface.
Ollama — local model runtime.
Qwen2.5 3B — open-weight language model used for structured information extraction.
Tesseract OCR — text recognition for scanned invoice images.
pypdf — text extraction from PDF documents.
Pillow — image processing.
SQLite — persistent local invoice storage.

How the workflow works
The user uploads an invoice.
The application extracts text directly from PDFs or uses OCR when processing images.
The extracted text is passed to the locally running Qwen2.5 3B model to identify relevant invoice fields.
The application checks basic financial consistency.
The user reviews and corrects the extracted values.
The verified invoice can be saved to SQLite and included in searchable records and CSV exports.

One important design decision was to keep the user involved in the process. AI extraction is not guaranteed to be correct, especially when documents have poor image quality, unusual layouts, or ambiguous financial fields. Reviewing the original document before saving remains important.

Why Does Open Innovation Matter?

Open innovation made it possible to experiment with a useful AI workflow without making a paid, hosted language-model API a core dependency.

Using an open-weight model through Ollama gives me control over where inference runs and makes it possible to develop and test the application on my own computer.

It also makes experimentation more accessible. I can inspect the extracted results, adjust the extraction logic, improve validation, and try different models without redesigning the entire application around a single hosted AI provider.

Running inference locally can help reduce the amount of invoice data sent to external AI services. However, local inference alone does not guarantee complete privacy: document storage, logs, backups, and other application components must also be handled carefully.

For me, this project demonstrates how open AI tools can turn a practical, repetitive business task into an application that people can run and adapt themselves.

來源:DEV Community · dev.to