What it does
NoteVault Hybrid is a notes app whose AI is honest about where it runs. It uses Firebase AI Logic hybrid inference (Gemini Developer API free tier — no Vertex AI): getGenerativeModel with mode prefer_on_device tries Gemini Nano on-device first and falls back to cloud Gemini (gemini-3.5-flash-lite). Every answer carries a chip read from the SDK response's inferenceSource — "On device" or "Cloud" — plus the reason (e.g. "On-device model not ready — fell back to cloud"). A privacy toggle switches to ONLY_ON_DEVICE: in that mode a request that cannot run on-device is refused loudly BEFORE any cloud call is made — your notes are never silently sent anywhere. Deep Dive chat is a separate cloud model (multi-turn chat isn't supported on-device). On machines without Chrome's Prompt API / Gemini Nano, requests fall back to the cloud and the app says so — nothing fakes on-device. Notes are stored locally in the browser; there is no account and no server copy.
How I built it
Vite + vanilla JS frontend; Firebase AI Logic SDK (firebase 12.19.0) with App Check (reCAPTCHA Enterprise) enforcement; hybrid routing with prefer_on_device / only_on_device modes; answers grounded in the user's own notes with citations; a visible cloud-budget meter; 24 automated tests; deployed on Vercel.
A note on honesty
In the demo environment, Chrome's Prompt API / Gemini Nano wasn't available, so the on-device (Gemini Nano) path was not verified answering on a real device there. The demo video truthfully shows the cloud path answering (with a citation) and ONLY_ON_DEVICE refusing loudly instead of silently sending notes to the cloud.
What I learned
Hybrid inference is only trustworthy when the app shows its work: surfacing the SDK's inference source and the fallback reason turns a silent routing decision into something the user can see and control.
Built With
- firebase
- firebase-ai-logic
- gemini-nano
- javascript
- vercel
- vite