-
-
keeps the facts, drops the volume: a co-parenting messenger built on Firebase AI Logic hybrid inference
-
Gemini Nano checks the tone on this device at every pause; the calmer version kept 4 of 4 facts and nothing left the laptop
-
Nano flagged a friendly message; on Send the cloud model gives a second opinion on that one message
-
The cloud cleared it: the message went as typed, tagged on device → cloud
-
Dan's message arrives facts first, read on the device; the original is one tap away
-
Threats are never rewritten: the composer pauses and offers a cool-down call (Gemini Live API)
-
Two parents, two devices: Dan's Android has no on-device model, so the same SDK checks his message in the cloud
-
Under the hood: every AI call with where it ran, and the inference mode of each feature from Remote Config
-
A SHA-256 hash chain both parents can verify on their own device
Inspiration
It's 11:40 pm. Maya's co-parent has just texted that Friday pickup moved to 5, that she still owes $51.60 for Leo's cleats, and that she "always" does this. Her thumb is over Send. In a custody case that reply may be read out in court a year from now. A family-law attorney put it plainly: "One parent may send fifteen hostile messages. The other parent finally snaps and sends one angry response. In court, the angry response may become the focus." Courts in all 50 states order high-conflict parents to talk only through co-parenting apps, and the apps that check tone today do it in the cloud and charge for it per parent (OurFamilyWizard's top plan is $299.88 a year for each parent). A check on every pause while someone types is exactly the workload that is expensive in the cloud and free on the device, which is why we built it on Firebase AI Logic's hybrid inference.
What it does
- Write: Gemini Nano checks the tone on your own device at every typing pause, underlines what will read as hostile with a reason, and offers a calmer version in your voice. You stay the author.
- Keep the facts: code extracts every day, date, time, amount, place and child's name; a suggestion that drops or changes one is never shown.
- Second opinion: when Nano flags a message and you send it as typed anyway, the larger cloud model reads that one message first. It clears Nano's false alarms, or shows its own calmer version once. Drafts you never send are never uploaded.
- Never soften a threat: threats are caught by code before any model call and are never rewritten; the composer pauses and offers a short voice cool-down call (Gemini Live API) and safety resources.
- Read the facts first: hostile incoming messages open as asks, deadlines and amounts, read on the device; the original is one tap away.
- Coordinate: a shared custody calendar; ask it in plain language and Gemini uses function calling to read the schedule and propose the swap, which only the other parent can accept.
- Split costs: a receipt photo is read on the device; the other parent's share is requested at your agreed split.
- Keep an honest record: messages can't be edited or deleted; each is stamped into a SHA-256 hash chain that either parent can re-verify on their device and export as a PDF for a lawyer.
How we used Firebase AI Logic
- Every AI feature has its own inference mode, set in Remote Config, with a stated reason: the live tone check is ONLY_ON_DEVICE (behind our own availability check), because a check on every pause is only free and fast on the device and unsent drafts never leave it; the send check, facts view and receipts are PREFER_ON_DEVICE; the second opinion and the calendar are ONLY_IN_CLOUD; reply help is PREFER_IN_CLOUD with an on-device answer offline; the cool-down call is the Gemini Live API.
- The same code runs on a device without an on-device model: Maya's Chrome has Gemini Nano, Dan's Android emulator does not, and his message is checked once in the cloud when he presses Send.
- Every answer carries a chip with where it actually ran (
inferenceSource) and how long it took; "Under the hood" lists every AI call with what, if anything, left the device, and lets you force cloud, force on-device or simulate offline. - On-device structured output (JSON schema in Chrome,
@Generableon Android) feeds a deterministic facts lock: AI suggests, code enforces. - Cloud calls use the Gemini API in Vertex AI (global) with a LOW thinking level and a 20 s timeout from Remote Config; App Check (reCAPTCHA Enterprise on the web, limited-use tokens) is enforced on AI Logic, Firestore and Functions; service spend caps plus a budget guard that turns cloud features off while everything on the device keeps working.
How we built it
A shared deterministic core (facts lock, threat stop, rules-only tone, custody schedule, expense split, hash chain) lives once in TypeScript with JSON fixtures; the Kotlin Android app runs the same fixtures. Web: React + Vite + Firebase JS SDK 13.4. Android: Jetpack Compose + firebase-ai + firebase-ai-ondevice. Backend: Firestore (create-only messages, seat-scoped rules), Cloud Functions (integrity chain, demo families, seat claim, retention cleanup, budget guard), Remote Config, Auth, Hosting. Tests: 1,068 automated tests (shared core 206, Firestore rules 76, Cloud Functions 308, web 89 plus an end-to-end demo run, eval 74, Android 315).
Measured
On 60 synthetic drafts (40 hostile in five kinds, 8 threats, 12 friendly controls) in Chrome 157: Gemini Nano alone flagged 100% of the hostile drafts, kept every fact in 38 of 38 suggestions, rewrote 0 of 8 threats, sent 0 characters to the cloud and cost $0, but it also flagged 16.7% of the friendly messages. With the cloud second opinion on Send, friendly false flags drop to 0% (facts intact 40 of 40, threats rewritten 0) for about $0.74 per 1,000 checks, reading only messages that were being sent. Cloud only reaches the same accuracy at $0.85 per 1,000 but reads every draft it checks and could never run on every typing pause; rules alone catch 57.5% with 25% false flags. Every number is rendered from eval/results/*.json, and the eval README keeps the runs that failed.
Challenges
The first on-device call after Chrome starts takes ~30 s, so the app warms the model in the background and shows it. Nano sometimes added placeholders or dropped an amount, so the facts lock rejects those and retries once with the missing facts named. Our first eval run caught Nano softening a veiled threat ("You'll see what happens"), so veiled-threat phrasings moved into the Remote Config lexicon that runs before any model, and warning words can never appear in a suggestion; run 2 rewrote zero threats. Our first cloud run spent up to 138 s thinking about a one-line tone check; thinking is now set to LOW from Remote Config. And without Nano, Send originally waited only 2 s for the cloud check, which answers in about 3 s, so the hold is now 8 s.
What we learned and honest limits
Gemini Nano is a strong first reader and a jumpy one: on our 60 drafts it flagged 16.7% of friendly messages; the cloud second opinion brought that to 0% while unsent drafts stayed on the device. On-device answers take seconds, not milliseconds. The Android build was tested on an emulator with no on-device model, so there every check takes the cloud path. The eval set is synthetic, English-only and US-framed. Tone tools can't read context or coded abuse; lowercase never hides incoming messages.
What's next
A pilot with a family-law mediator; Spanish; an on-device check of the facts view on Android phones with Gemini Nano 4.
Try it
- Live demo (no sign-up): https://lowercase-wonm2n.web.app → Try it as Maya
- Android test build: https://lowercase-wonm2n.web.app/android/lowercase-0.1.0-judge.apk
- Code (Apache-2.0): https://github.com/RaYYeR220/lowercase · 5-minute review path: docs/JUDGES.md
Built With
- android
- chrome-built-in-ai
- cloud-firestore
- cloud-functions-for-firebase
- firebase
- firebase-ai-logic
- firebase-app-check
- firebase-authentication
- firebase-hosting
- firebase-remote-config
- gemini
- gemini-live-api
- gemini-nano
- jetpack-compose
- kotlin
- react
- recaptcha-enterprise
- typescript
- vertex-ai
- vite