Inspiration

Things at home wear out quietly: the AC filter clogs, inverter batteries swell, a stain spreads on the ceiling after rain. Most people can't tell whether to clean it, repair it, replace it or call a professional, so they wait, and a cheap fix becomes an expensive one. Where we live, hurricanes and long power outages make that worse.

The obvious answer, "take a photo and ask an AI", has a catch: photos of your home show where you live, what you own and how your home is secured. We wanted an assistant that is genuinely useful and private by default. Firebase AI Logic's hybrid inference made that possible: run on the device whenever it can, and use the cloud only when it adds value and the user agrees.

What it does

Scan. Photograph or describe anything in your home. Home Care identifies it, rates its condition and severity, and picks one action (monitor, clean, repair, replace or call a pro), with urgency, up to five DIY steps and a safety note. Photos are processed on the device and never uploaded. Home inventory. Read an appliance's nameplate from a photo or text to record brand, model, year and power, then generate a maintenance plan of recurring tasks for a tropical, hurricane-prone climate. Care graph. Tasks are shown as a graph: your home in the center, items around it and each task colored by status (overdue nodes pulse). Tap a node to see its full history: scheduled, completed and snoozed. A list view has swipe actions and undo. Repair or Replace? For a scan result or any item: a recommendation, repair and replacement cost ranges (clearly labeled as estimates, in your currency), up to three upgrades that save energy, water or money, and safety notes. Season Mode. Hurricane, rainy season and power-outage checklists built from your own inventory, high priority first. Check steps off, or add one to Tasks and it appears under the matching item in the care graph. Privacy Router. Before any text can go to the cloud, an on-device model checks it for addresses, names, ID numbers, valuables, security or health details, and offers a redacted version. Nothing is sent without consent. Nothing is lost. Drafts, AI requests in progress, unsaved results and checklists are saved on the device. Close the app in the middle of anything and it continues where you left off, including a request that was still running. Every AI answer shows which model produced it: On-device or Cloud.

How we built it

Firebase AI Logic hybrid inference on all three platforms, each with its own on-device model:

Android iOS Web On-device model Gemini Nano (AICore) Apple Foundation Models Gemini Nano in Chrome SDK firebase-ai + firebase-ai-ondevice FirebaseAILogic (hybridModel, systemModel, geminiModel) firebase/ai with InferenceMode Structured output @Generable schemas → generateObject() JSON shape in the prompt, validated in shared code JSON Schema as responseJsonSchema / responseConstraint Each feature chooses its inference mode in shared code:

Scan, inventory and maintenance plans: PREFER_ON_DEVICE. A request with a photo is sent ONLY_ON_DEVICE, so the SDK can never fall back to the cloud with it. On iOS, Apple Vision turns the photo into text on the device first. Privacy Router: ONLY_ON_DEVICE. If no on-device model is available, the text is treated as sensitive. Repair or Replace and Season Mode: PREFER_IN_CLOUD, text only, after the Privacy Router and consent. Season Mode sends only item names, categories and ages. If the user keeps the text on the device, the request runs on the on-device model instead. One source of truth. Prompts, limits and JSON shapes live in prompts/prompts.json, and JSON Schemas in prompts/schemas.json. Kotlin code is generated from them at build time and the web app imports the same files, so every platform asks the same questions and validates the same answers. Every response is validated; an invalid one is retried once with "Return valid JSON only."

Apps. Android and iOS share one Kotlin Multiplatform codebase with Compose Multiplatform UI (Material 3 on Android; on iOS, native navigation and tab bars with Liquid Glass through Calf). The platform AI engines are injected behind one interface. The web app is React + Vite + TypeScript + Tailwind on Firebase Hosting. Data stays local: Room and DataStore on mobile, localStorage on the web.

Firebase. App Check protects every AI call (Play Integrity, App Attest and reCAPTCHA Enterprise; debug providers in development). Remote Config holds the cloud model name and a cloud_enabled kill switch that turns every feature on-device only. Hosting serves the web app.

Challenges we ran into

Three on-device models, three sets of rules. Gemini Nano on Android has a per-app quota (we retry BUSY errors with backoff) and runs only in the foreground. Apple Foundation Models has no public hybrid structured output yet, so we describe the JSON shape in the prompt and validate it in shared code. Chrome's Prompt API can hang when asked whether the model is available, so we added a timeout and a cache. Small models, strict schemas. On-device models are single-turn with short contexts. We kept schemas small and flat, capped every array, and made parsers forgiving: snake_case or camelCase, unknown enum values mapped to safe defaults, duplicates removed. Privacy that really holds. A photo must never fall back to the cloud by accident, so the inference mode is decided in shared code, not by each screen. The Privacy Router fails closed: if it can't run, the text is treated as sensitive. Resuming work after the app is closed. Moving every flow out of the screens into app-level sessions that save their state, then resuming a request that was in flight, took several iterations. One race only showed up on iOS, when a request started in the first milliseconds after launch. Simulator quirks. On the iOS simulator, Apple's default guardrail classifier fails, so simulator builds use the permissive guardrail setting. The first on-device request after launch can fail while the model warms up, so the iOS engine retries once.

Accomplishments that we're proud of

One product on three platforms, each running a different on-device model through the same Firebase AI Logic API, with identical prompts, schemas and privacy rules. Real on-device answers in the app: diagnosis, repair-or-replace advice and a 12-step hurricane checklist generated by Apple Foundation Models in about 5 to 7 seconds, with no network. Privacy enforced by the architecture: photos stay ONLY_ON_DEVICE and text is checked before any cloud call. An interface that feels native everywhere: Liquid Glass on iOS, Material 3 on Android, and a care graph that makes maintenance easy to see at a glanc

What we learned

Hybrid inference changes product design, not just the API: each feature needs a deliberate choice between on-device and cloud, and the user should always see which one answered. Smaller models do well with tight structure: a short system instruction, a flat schema and one validation-and-retry loop beat long prompts. Treat privacy as a data-flow problem. Decide what may leave the device in one place, make it fail closed, and show the exact text before sending it.

What's next for Home Care

Shared household: sync items and tasks between family members (text only, never photos). Reminders for due tasks and season alerts before hurricane season. Spanish, our second language, across the app and the prompts. Testing on more devices with Gemini Nano and Apple Intelligence, and tuning prompts per on-device model. Photos that never leave the device for Repair or Replace, using a description generated on the device.

Built With

  • apple-foundation-models
  • calf
  • compose-multiplatform
  • datastore
  • firebase-ai-logic
  • firebase-app-check
  • firebase-hosting
  • firebase-remote-config
  • gemini
  • gemini-nano
  • koin
  • kotlin
  • kotlin-multiplatform
  • react
  • room
  • swift
  • swiftui
  • tailwindcss
  • typescript
  • vite
Share this project:

Updates

Submission history