Inspiration

Before smartphones were everywhere, a lot of us across Southern Africa talked to friends and strangers on cheap, data-light chat apps. They were instant and social, but they had no real safety layer. Today's chat apps are the opposite: heavy, tied to your phone number, and moderated by sending everything to a server.

I'm building solo from Lusaka, Zambia, where data can be expensive. I wanted live public chat that is free, ad-free and light, with a safety layer that protects people without reading their messages in the cloud.

What Volubly does

Volubly is a mobile-first web app (installable as a PWA) for 24-hour live chat rooms. A room opens, people talk, and it closes after 24 hours. You get a username and an avatar, nothing else. No phone number or email is needed, accounts use anonymous Firebase Authentication.

Device compatibility: Volubly works in mobile and desktop browsers. The on-device AI needs desktop Chrome with built-in AI. On phones and other browsers, plain-code checks still run, and the cloud is used only for your own draft and for catch-up, and only when you approve it.

Ghost-Mode is the safety layer. It has one rule: the AI reads and flags, code enforces the rules, and people decide.

  • Before you send: plain code first hides phone numbers, emails, passwords and keys. Then an AI check looks for insults, threats, hate and similar. If it finds something, you see a review panel: send a redacted version, send anyway, or edit. You choose.
  • When you read: messages that look harmful, or that contain a link, start hidden behind a card that says what the category is ("Possible threat", "Link found") and that the guess may be wrong. One tap shows the message.
  • Catch-up: one tap summarises what you missed, up to the latest 100 messages, and puts real usernames back on your device after the summary returns.
  • Delay Shield: hold back messages for 30 to 90 seconds so a live stream doesn't give away spoilers too soon.

The hybrid part: where each check runs

Plain code picks the route before any AI call, never the model. It uses the job, the device, the connection and your consent. Every AI call goes through Firebase AI Logic with an explicit mode: ONLY_ON_DEVICE (Gemini Nano, Chrome's built-in model) or ONLY_IN_CLOUD (Gemini). There is no automatic fallback, because a silent fallback would send data to the cloud without consent.

Job Model ready on the device No model on the device Offline
Check your draft before sending On-device, after plain code hides numbers, emails, passwords and keys Cloud Gemini only if you ticked the consent box; otherwise plain code only, shown as "not checked" On-device if the model is ready; otherwise plain code only
Check other people's messages On-device Plain code only (links, phone numbers). Never the cloud On-device if the model is ready; otherwise plain code only. Never the cloud
Catch-up, under 40 unseen On-device Cloud Gemini only after you tap Allow Latest 40 on-device if the model is ready
Catch-up, 40 or more unseen Cloud Gemini only after you tap Allow Cloud Gemini only after you tap Allow Latest 40 on-device if the model is ready

In every cloud catch-up, usernames are replaced with P1, P2 and so on before anything is sent, and restored on your device afterwards.

When the model is slow, busy or missing:

  • Cold start: Chrome unloads the model when it's idle. The app warms it up, allows longer for the first call and shows "Waking the on-device check".
  • Busy: one priority queue shares the model: sending first, then catch-up, then reading. A check that can't run is shown as "not checked", and plain-code protection still applies.
  • Timeout: shown as "not checked", never as "safe".
  • Offline: no cloud calls are made. On-device checks and plain-code checks keep working.
  • No model: AI availability is never assumed. A skipped check is never shown as a passed check, and a limitations note inside Ghost-Mode says which checks are running.

Why this design? Other people's messages never leave your device to be read by a cloud model. On-device checks work offline and take about 0.6 seconds once warm. The cloud covers what a phone or a small model can't: phones have no on-device model, and a 100-message summary is too big for it. Every call shows in an Inference activity panel: the route, what it was for, the time, the result and the reason.

How I built it

  • Frontend: React, TypeScript, Vite and Tailwind, installable as a PWA.
  • Backend: Firebase Authentication (anonymous sign-in), Firestore in the Africa-Johannesburg region, App Check with reCAPTCHA Enterprise, and Firebase Hosting. No custom application servers or Cloud Functions. Backend enforcement is handled by Firestore Security Rules.
  • AI: Firebase AI Logic with ONLY_ON_DEVICE and ONLY_IN_CLOUD. I pick the route myself instead of using automatic fallback, because a silent fallback to the cloud would send data without consent.
  • Rules in code: Firestore security rules enforce who can post and the limits on rooms, with tests run against the Firebase emulator. More than 200 automated tests cover the checks, routing and rules, including property-based tests.
  • Queue: one priority queue shares the single on-device model: sending first, then catch-up, then reading.

Challenges

  • Cold starts. Chrome unloads the on-device model when it's idle. The first call took 10 to 15 seconds and looked like a failure. I added a warm-up and a longer allowance for cold calls, and the screen now says "Waking the on-device check".
  • Honest checks. A check that times out must never look like a safe result. A timeout is its own state, "not checked", and the screen says so.
  • Privacy in summaries. Usernames are swapped for P1 and P2 before anything is sent and restored on the device afterwards.
  • No billing. Staying on the free plan meant no Cloud Functions, so everything that must be enforced lives in security rules and everything that must be smart lives on the client.

What I learned

Hybrid inference is mostly a design problem, not a model problem. Deciding where each piece of data is allowed to go, and showing the person that decision, mattered more than any prompt. Keeping the model's job small (pick a category) and letting code write every sentence the user sees made the system predictable, testable and easy to explain.

Limitations, said plainly

  • Ghost-Mode can miss harmful messages and hide harmless ones. People stay in control of what they send and show.
  • On-device checks need desktop Chrome with built-in AI. Phones get plain-code checks on what they read, and the cloud check, only if

Built With

  • chrome-built-in-ai
  • cloud-firestore
  • firebase
  • firebase-ai-logic
  • firebase-app-check
  • firebase-authentication
  • firebase-hosting
  • gemini
  • gemini-nano
  • google-cloud
  • hybrid-inference
  • kiro
  • react
  • recaptcha-enterprise
  • tailwindcss
  • typescript
  • vite
Share this project:

Updates

Submission history