DEV Community

taha
taha

Posted on

VaultLedger: Freelance essential.

Here is your complete, ready-to-publish Dev.to submission post for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle, tailored directly around VaultLedger!
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle
What I Built

As a computer science student juggling freelance development, keeping track of messy PDF invoices, parsing tax rates, and formatting general ledger journal entries is a major distraction.

I built VaultLedger: a 100% offline, air-gapped desktop utility for freelancers and independent contractors that ingests messy invoices and receipts (PDFs and images), extracts structured financial line items, forces deterministic schema extraction via an embedded local Google Gemma 2B (Q4_K_M GGUF) model, persists records in a WAL SQLite database anchored by a SHA-256 tamper-evident hash chain, and exports audit-ready Double-Entry General Ledger CSVs.

Freelancers and small business owners pay for this with absolute privacy: zero cloud dependencies, zero data leaks, and zero risk of proprietary tax data hitting third-party LLM APIs.
Demo

GitHub Repository: tahaenasraoui-debug/vault-ledger

Add a screen recording GIF here showing a PDF being dragged in, real-time JSON tokens streaming in the neural terminal, the KPI cards updating, and the CSV export.
Enter fullscreen mode Exit fullscreen mode

Code

You can embed your repository directly using Dev.to's GitHub tag:

🛡️ VaultLedger

Air-Gapped Local AI Financial Extraction & Cryptographic Double-Entry Ledger

Zero Cloud. Zero Telemetry. 100% On-Device Rust + Quantized Gemma 2B Inference.


⚡ Overview

Freelancers, auditors, and privacy-critical businesses shouldn't have to upload sensitive invoices, tax IDs, and banking records to third-party cloud APIs just to automate bookkeeping.

VaultLedger is a strictly air-gapped, local-first desktop application engineered in Rust and Tauri v2. It ingests messy PDF invoices or receipt photos, extracts structured accounting line items using an embedded Google Gemma 2B (Q4_K_M GGUF) model running via pure-Rust Candle tensors, anchors every record into a SHA-256 tamper-evident SQLite database, and exports balanced Double-Entry General Ledger CSVs.

đź”’ The Air-Gap Guarantee

  • Compile-Time Network Ban: build.rs inspects the resolved Cargo dependency graph at compile time and panics if any HTTP/network crate (reqwest, curl, hyper, ureq) is present.
  • Memory Safety: Compiled with #![forbid(unsafe_code)] across the…

Core architectural highlights from the codebase:

The Air-Gap Enforcer (src-tauri/build.rs): A compile-time guardrail that scans resolved Cargo dependencies and panics the build if any network/HTTP client (reqwest, curl, hyper) is introduced.

Local AI Engine (src-tauri/src/inference.rs): Loads quantized Gemma 2B Instruct via pure-Rust candle-core and candle-transformers, streaming token pieces over Tauri v2 events.

Tamper-Evident Vault (src-tauri/src/storage.rs): Implements active and audit hash chains (prev_chain_hash -> chain_hash) in SQLite WAL mode.
Enter fullscreen mode Exit fullscreen mode

How I Built It

VaultLedger is built around open-weight local inference and strict systems-level Rust:

Framework: Tauri v2 (core = "2") with multi-threaded async IPC commands routing CPU-heavy tasks to background Tokio blocking threads.

Local LLM Inference Engine: HuggingFace's pure-Rust candle framework running Google Gemma 2B Instruct quantized to Q4_K_M, paired with local HuggingFace tokenizers.

Hybrid Ingestion Pipeline: Direct PDF text extraction via lopdf, coupled with an automatic fallback for scanned receipts/photos using contrast enhancement and pure-Rust neural OCR (ocrs + rten weights).

Deterministic Accounting Reconciler: Uses schemars to enforce schema validation, fixed-point integer cent representation (i64) to eliminate IEEE-754 floating-point drift, and trial-balance invariants (net + tax == total).

UI: A sleek, glassmorphic Obsidian Fintech dashboard built with Vite, TypeScript, and custom CSS variables.
Enter fullscreen mode Exit fullscreen mode

Why Does Open Innovation Matter?

Open-source AI and open-weight models made VaultLedger possible. A closed API (like OpenAI or Anthropic) would require sending raw invoices, vendor names, exact amounts, and tax IDs to a corporate server over an active HTTPS connection—violating data privacy laws (like GDPR) and failing strict air-gapped security mandates.

Because of open-weight models like Gemma 2B and pure-Rust tensor libraries like Candle, we can bundle state-of-the-art intelligence directly inside a local desktop binary. It proves that powerful AI automation does not require sacrificing data sovereignty or trusting third-party cloud infrastructure.
My Agent Session

Built iteratively using local developer agent workflows, enforcing #![forbid(unsafe_code)] and strict control-flow error handling via thiserror.
Enter fullscreen mode Exit fullscreen mode

My First User

Tested locally on personal freelance invoices and university project expense receipts in Rabat, Morocco, successfully generating balanced double-entry accounting CSV journals ready for tax audit.
Enter fullscreen mode Exit fullscreen mode

Prize Categories

Open-Source AI / Local Inference

Side Hustle / Developer Productivityapplies, or remove this section. -->
Enter fullscreen mode Exit fullscreen mode

Top comments (0)