Inspiration

What it does

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for Quiet Ledger

Inspiration

A bank statement is the most personal file most people have. It shows where they live, who they love, what they're ashamed of buying. Yet every budgeting app starts by asking you to upload it or to hand over your bank login. Gemini Nano running inside Chrome changes that: the language work can happen on the device, and the cloud only needs to see what you'd be comfortable printing on a postcard.

What it does

Drop the CSV your bank lets you export (or try the invented sample). Quiet Ledger:

  • Reads it in the tab. Parses US and European formats, separate debit/credit columns, 1,234.56 and 1.234,56.
  • Masks what identifies you. A deterministic privacy shield masks card numbers, IBANs, references, emails, phone numbers and the names of people you send money to before any model sees a description.
  • Categorizes on device. Rules handle obvious merchants. Gemini Nano categorizes the rest through Firebase AI Logic (PREFER_ON_DEVICE) with a JSON-schema constraint. Without Gemini Nano, the same call falls back to Gemini in the cloud, still with masked text only.
  • Finds the money leaks with plain code. It flags recurring charges, the subscriptions whose price went up (Netflix $22.99 → $24.99 in the sample), and bank fees.
  • Answers questions exactly. "How much did I spend on eating out in September?" Gemini Nano turns the question into a structured query ({intent, category, merchant, month}) and code computes the answer from your transactions: $298.87 across 9 transactions, with the rows to prove it. In cloud fallback, only the question is sent.
  • Builds a savings plan. This is the one feature that prefers a larger cloud model (PREFER_IN_CLOUD). The complete payload (monthly totals per category, no merchants, dates or names) is shown before you press send. Offline, the same call falls back to Gemini Nano automatically.
  • Shows what left the device. A floating panel lists every model call with its inferenceSource. Cloud calls include the exact text sent and a running character count. Analyzing the sample and asking questions with Gemini Nano: 0 characters.

How we built it

  • Firebase AI Logic hybrid inference (firebase/ai, Gemini Developer API backend). Each task has three model instances, with the mode chosen per task:
    • categorize: PREFER_ON_DEVICE, responseConstraint on device, responseSchema in the cloud
    • understand a question: PREFER_ON_DEVICE, same dual schema
    • savings plan: PREFER_IN_CLOUD with on-device fallback

response.inferenceSource feeds the transparency panel, so it's never a guess. Code: src/ai.js.

  • App Check with Fraud Defense (reCAPTCHA Enterprise), enforced for AI Logic.
  • Remote Config selects the cloud model, the categorization batch size and the coach's tone without a redeploy (template in the repo).
  • Firebase Hosting serves the Vite build.
  • Deterministic core (src/ledger.js): CSV parsing, the privacy shield, recurring-charge and price-increase detection, the exact query engine and the cloud summary builder. Unit tests (npm test) cover formats, masking, detection, query answers, and a check that the cloud summary contains no merchant, name, card digit or date.

Challenges we ran into

  • Small models can't add. Our first "ask your statement" gave Gemini Nano the transaction list and asked for the answer. It confidently summed September's restaurants to $1,209.31 (true figure: $298.87) and slipped a cinema ticket in. We redesigned: the model only translates language into a query, and code does every number. It's faster, it's exact, and it has a privacy bonus: the cloud fallback now needs nothing but the question.
  • Different structured-output mechanisms. Gemini Nano takes a JSON Schema responseConstraint; the cloud model takes a responseSchema. Both are configured per model instance so the parsing code doesn't care where inference ran.
  • Privacy in the fallback path. Hybrid means some users' calls will go to the cloud. We designed for that case first: a code-level shield and aggregate-only payloads, so a missing local model degrades privacy as little as possible.

Accomplishments that we're proud of

With Gemini Nano available, a full analysis of a three-month statement and any number of questions send zero characters off the device. And every number on screen is computed, not generated.

What we learned

Hybrid inference is most useful when every task gets its own mode, not when one mode is applied globally. We used on-device for private, high-volume, latency-sensitive steps and cloud for the one task that benefits from a bigger model and handles only anonymous data. Pairing a small model with deterministic code beats asking it to do everything.

What's next

  • A Chrome extension that reads a statement straight from the bank's download page.
  • PDF statements (on-device extraction).
  • Month-over-month alerts ("your groceries are 30% above your usual") without any server.
  • An Android version with the same per-task hybrid design.

Try it

Built With

  • chrome-built-in-ai
  • firebase-ai-logic
  • firebase-app-check
  • firebase-hosting
  • firebase-remote-config
  • gemini-api
  • gemini-nano
  • javascript
  • recaptcha-enterprise
  • vite
Share this project:

Updates

Submission history