Inspiration

A small model can't write music, so in Jamigo it picks the direction, and the app's own code writes every note.

Lots of people make music for fun with no band to play with, and many get stuck on the same thing: a loop that sounds fine and goes nowhere. They can say what they want ("the drums should be bouncier", "make it feel like a rainy walk to school"). Turning that into notes is the hard part. So we made the band a group chat you can text.

What it does

Text a cartoon band what to play in plain words, and they play the change from the next bar, even offline in Chrome on a computer. Gus (drums), Nell (bass), Otis (keys) and Wren (melody) loop a two-bar groove. Send "@gus bouncier" or "@otis like a rainy walk to school". Firebase AI Logic reads the message on your device first: who it's for, which way four settings move (how busy, how high, how bouncy, how loud) and a mood. The app's own code writes the new part. Online, the Producer turns your loop into a whole song, and you keep it as a MIDI file.

43 of 50 messages read right, on this computer. A separate AI agent (claude-opus-5-5) that never saw the app's prompt wrote 50 everyday band messages. Chrome's built-in model, through Firebase AI Logic, picked the right band member and moved every setting the right way in 43. All 50 were answered on the computer, median 1.5 s. A word list written before the messages got 14. The raw answers are in the repo (eval/edit-requests/), and its tests recompute every number (FACTS.md).

  • See what it heard: each reply shows chips ("Busier", "Bouncier", "Mood: happy"). Tap one to undo it. Code writes the reply line from the chips, so it never claims a change the notes don't make.
  • See where it ran: "On this computer, Gemini Nano in Chrome, 1.5 s" or "In the cloud, gemini-3.5-flash-lite", read from the SDK's inferenceSource.
  • No signal: in Chrome on a computer, turn Wi-Fi off and the band keeps answering. Only the song waits for a connection.
  • First run: pressing Play starts Chrome's model download (initializeDeviceModel) and shows its progress. Until it's ready, the cloud answers, and each reply says so.
  • On phones: the same band in an Android app and an iPhone app, each calling Firebase AI Logic's own SDK.
  • Change the band's key or make the loop 1, 2 or 4 bars while it plays, and download the loop or the song as a WAV file made on your device from the same samples, even offline.

No login, no account and no database. With "This computer only", nothing is sent.

Try it: the web app https://bandchat-hybrid-2026.web.app/app/ (Chrome on a desktop computer), the About page https://bandchat-hybrid-2026.web.app/, the iPhone beta on TestFlight, the Android APK (a real phone) and the code.

How we built it

Where each job runs

Platform Read a message Arrange a song Every reply says
Web (Chrome on a computer) On the computer first (PREFER_ON_DEVICE), the cloud if Chrome's model is missing or fails In the cloud first, Chrome's built-in model (ONLY_ON_DEVICE) if the cloud fails "On this computer" or "In the cloud"
Android On the phone first (PREFER_ON_DEVICE) where it has Gemini Nano. Our Pixel 8a has none, so the cloud In the cloud Where it ran
iPhone Apple's on-device model picks who and the mood. The cloud reads how the settings move In the cloud Which part ran where

How Jamigo works: Chrome's built-in model reads each message on this computer through Firebase AI Logic, code writes the notes, and gemini-3.5-flash-lite arranges the song in the cloud

  1. Read. Firebase AI Logic hybrid inference. Chrome's built-in model answers under a JSON schema (responseConstraint), so only legal values come back: the member, four settings from -2 to 2, and a mood.
  2. Write the notes. Code moves each setting's own measure the asked way (notes per bar, average pitch, notes off the beat, how hard they're played), and a checker confirms key, range and clashes. Tone.js plays it. No AI makes audio.
  3. Arrange. The Producer asks gemini-3.5-flash-lite in the cloud for 3 to 6 sections, and code keeps the key, the tempo and a length of 45 to 120 seconds. On a rate limit, a server error, no connection or a 25-second timeout, the app's own code asks Chrome's model instead (ONLY_ON_DEVICE). An App Check refusal never falls back.
  4. Keep. A standard MIDI file of the song or the loop.
Firebase product Its job in Jamigo
Firebase AI Logic (web, Android and iOS SDKs) Reads messages on the device first where it can, and arranges songs in the cloud
App Check, enforced on AI Logic Only Jamigo can call the cloud model: reCAPTCHA Enterprise on the web, Play Integrity on Android, App Attest on iPhone. Every web build fails if it carries a debug token
Remote Config The cloud model names and feature switches, changeable without a release
Performance Monitoring One trace per reply and song plan on the web, tagged with where it ran, so the on-device half shows too
Hosting Serves the app, with a service worker so it reopens offline in Chrome

Not used, on purpose: Authentication and Firestore (no accounts, no database), and gemini-4-hydrogen (its free tier allows about 20 requests a day, too few for a chat).

Challenges we ran into

  • A small model can't write the music. Asked to write notes, an on-device model mostly copied the old part, repeated it or wrote a plain scale. So it picks who and which way, and code writes every note.
  • The on-device model is eager. It moved 16 of the 47 settings that should have been left alone, usually making a part busier. A one-line prompt fix made it worse, so we kept the original prompt and made every change a chip you can undo.
  • Apple's on-device model couldn't do the whole job. On the same 50 messages it read the full request right only 30 times. But on the 43 that don't start with "@name", it picked the bandmate right 41 times (43 with a second prompt). So on iPhone it picks who and the mood, and the cloud reads the settings.
  • The free cloud tier allows 15 requests a minute. Our first cloud run hit the limit partway through. A queue keeps calls under 12 a minute and honours "retry in N seconds", each song's plan is kept, and Chrome's model plans the song when the cloud still fails.

Accomplishments that we're proud of

  • 43 of 50 messages read right on the computer, 29 more than a word list, including 11 of 15 everyday scenes where the word list got 0.
  • Chrome's model as the Producer's fallback: 10 of 10 test song plans needed no fix from the checker, median 6.6 s.
  • The model's reading is visible and undoable, and every reply says where it ran.
  • A finished web app, live with no login, plus the same band in an Android app and an iPhone app on a public TestFlight beta.

What we learned

  • An on-device model is good at turning plain words into a direction. Code is better at writing the notes. Splitting the work that way got 43 of 50 right.
  • Showing what the model understood, with one-tap undo, turns its mistakes into a tap instead of a wrong song.
  • Hybrid means each job runs where it fits: every message on the device, the bigger plan in the cloud, with the device as the song's fallback.

What's next for Jamigo

  • Fewer unasked changes on the device, measured on the same 50 messages before anything ships.
  • On-device reading on an Android phone with Gemini Nano, measured the same way.

Built With

  • app-attest
  • apple-foundation-models
  • chrome-built-in-ai
  • firebase-ai-logic
  • firebase-app-check
  • firebase-hosting
  • firebase-performance-monitoring
  • firebase-remote-config
  • gemini-3.5-flash-lite
  • gemini-developer-api
  • gemini-nano
  • play-integrity
  • prompt-api
  • recaptcha-enterprise
  • tone.js
Share this project:

Updates

Submission history