Inspiration
Waterproofing, reinforcement, insulation and pipes are covered for good within days of being built, and most of the costly defects in a private house start there. Private homebuilders are rarely construction professionals, and once the work is hidden nobody can check it. I am building a house myself, and Veridom, my house-building control app for Austria, Ukraine and California, exists for exactly this moment. Millions of homes in Ukraine will be rebuilt by people who are not builders; they need a checker in their pocket that respects their privacy and costs nothing per photo.
What it does
The builder picks the stage (basement waterproofing, rebar before the pour, wall insulation, vapour barrier, pipes in walls, roof underlay) and the country. Cover-Up Check shows what must be visible before the work is covered and which standard to open. The builder adds site photos and:
- Gemini Nano checks each photo on the device against the stage checklist with structured JSON output (ok / issue / not visible per item, plus confidence). Each photo gets a hold-point tag: Hold. Do not cover., Clear to cover or Needs another photo.
- "Keep photos on this computer" switches the photo check to
ONLY_ON_DEVICE. Unsure results are flagged, never uploaded silently; the builder can send one specific photo for a second opinion. - Second opinion in the cloud: when Nano's confidence is low, the stage looks wrong, or most items are not visible, the larger Gemini model re-checks the photo (
ONLY_IN_CLOUD) and says where it disagrees. - Approved plan (PDF): the on-device model cannot read PDFs, so the plan goes to the cloud; the requirements it finds are fed back into the next on-device photo check.
- Note to the contractor in English, German or Ukrainian. If Nano cannot write the language, only the text findings go to the cloud, never the photos.
- Offline on site: without signal the on-device checks keep working; cloud steps wait in a queue and run when the connection returns.
- Where each step ran: every model call is logged with its route, the reason, the
inferenceSourceFirebase reports, and the time. - Save hold point: findings and a SHA-256 fingerprint of every photo go to Firestore; the photos themselves do not.
How we built it
- Firebase AI Logic hybrid inference (
firebase/ai, SDK 13.4):getGenerativeModelwithInferenceMode.PREFER_ON_DEVICE/ONLY_ON_DEVICE/ONLY_IN_CLOUD,onDeviceParams(image + text inputs, JSON-schemaresponseConstraint),inCloudParams(Gemini withresponseSchema),initializeDeviceModelfrom a user gesture, andresponse.inferenceSourceto show where each answer came from. - Routing policy as code (
src/policy.ts): plain functions that decide device / cloud / queue / blocked from three inputs — privacy lock, connectivity, device-model availability — plus the confidence of the first answer. Covered by 10 unit tests. - Firebase App Check with reCAPTCHA Enterprise (Fraud Defense), required by AI Logic.
- Remote Config: stage checklists per jurisdiction, cloud model names and the escalation threshold, with bundled defaults so the app works offline.
- Cloud Firestore (EU, eur3) with rules: owner-only create and read, no updates — a hold point is a record.
- Anonymous Authentication so each builder sees only their own hold points.
- React + TypeScript + Vite, deployed on GitHub Pages; photos are downscaled to 768 px on the device before any model sees them.
Challenges
- Making the hybrid choice visible and honest: the UI shows the actual
inferenceSource, not the intended route. - Never leaking a locked photo: with the lock on and Nano not yet downloaded, the check is blocked with an explanation instead of silently falling back.
- Keeping norms safe across three legal systems: Veridom never states a norm value; each checklist names the document to open.
Accomplishments
- A complete flow from photo to saved hold point, on device by default, cloud only where it adds something (second opinion, PDF, languages Nano can't write).
- Most checks cost nothing per use, which removes the unpredictable AI cost that stopped me from adding AI to Veridom before.
What we learned
On-device models are good enough for a first pass when the task is narrow and the output is constrained; the value of the cloud model is in the cases the small model admits it can't judge.
What's next
Bringing the module into the Veridom app on Android (Gemini Nano via ML Kit) and iOS (Apple Foundation Models via Firebase AI Logic), stage-based sign-off with the contractor, and evidence packages for lenders and insurers.
Built during the contest
All code in the repository was written during the submission period (November 2026). It reuses Veridom's stage vocabulary and principles, not its code. Sample photos in the app are AI-generated illustrations and are labelled as such.
Try it
- Open https://khrisdidukh.github.io/veridom-coverup-check/ in Chrome 139+ on desktop. For on-device inference enable
chrome://flags/#prompt-api-for-gemini-nano,#prompt-api-for-gemini-nano-multimodal-inputand#optimization-guide-on-device-model(BypassPerfRequirement), relaunch, then press Download model in the app. - Press Use sample photos, then Check photos. With the lock on, checks run on device only.
- On the North-east corner photo Nano could not judge 2 of 4 items, so it is flagged as unsure and kept local; press Send this photo for a second opinion to send just that photo to Gemini in the cloud.
- Choose German and press Write note to contractor, then Save hold point.
- Without the flags, the app still works: Firebase falls back to Gemini in the cloud (turn off "Keep photos on this computer").
Built With
- chrome-prompt-api
- cloud-firestore
- firebase-ai-logic
- firebase-app-check
- firebase-authentication
- firebase-remote-config
- gemini
- gemini-nano
- react
- typescript
- vite