PrivyDoc helps people understand long or sensitive documents — contracts, policies, reports, email threads — without giving up privacy. You paste a document and choose what you need: (1) Quick summary — a first-pass summary that runs on-device whenever possible. (2) Sensitive-info scan — finds email addresses, phone numbers, ID numbers, API keys and similar content, and runs entirely on-device: the scan that exists to protect your data never exposes it. (3) Deep analysis — structured extraction (parties, dates, amounts, deadlines, obligations) plus a plain-language 'things to watch' section, powered by cloud Gemini and run only when you explicitly click. Every result is labelled with where it was produced.
How we used Firebase AI Logic: Hybrid model inference in PrivyDoc runs through Firebase AI Logic (PREFER_ON_DEVICE for quick summaries and PREFER_IN_CLOUD for deep analysis). For the sensitive-info scan, an optional classification step calls the Chrome Prompt API (LanguageModel.create) directly on masked text, guaranteeing by construction that scanned content has no cloud path. Hybrid inference is a product feature, with a declared inference route per feature: Summary uses PREFER_ON_DEVICE (Gemini Nano first, cloud fallback); the sensitive-info scan uses On-device only by construction — a local regex pattern pass plus an optional Gemini Nano classification (via the Chrome Prompt API directly) that only ever sees masked text; it has no cloud path; deep analysis uses PREFER_IN_CLOUD (cloud Gemini). The app calls initializeDeviceModel() from a user gesture before the first on-device request, and App Check is enabled when a site key is configured.
Built with: Firebase AI Logic (JS SDK), Gemini Nano (Chrome Prompt API), Gemini, vanilla HTML/CSS/JavaScript, Cloudflare Pages.
Live demo: https://privydoc.pages.dev
Source code (MIT): https://gitlab.com/zhangzy3g/privydoc
Demo video: https://www.youtube.com/watch?v=9MlOBVAvUs0