Inspiration: Cosplay photo shoots happen in studios, rooftops and event halls — exactly the places where connectivity is weak or gone. But the moment right after a shoot, while the mood is still fresh, is when you want to post. CosCaption was built for that moment.

What it does: CosCaption turns a short shooting memo (character, location, mood, costume, lens) into a post-ready social media caption with hashtags, in two steps. (1) Draft on-device — Gemini Nano (via Firebase AI Logic, InferenceMode.PREFER_ON_DEVICE) generates a caption + hashtag draft locally in Chrome. It works fully offline; nothing leaves the device. (2) Polish in the cloud — back online, Gemini (InferenceMode.ONLY_CLOUD) rewrites the on-device draft into a more vivid, post-ready version. Both results are shown side by side so you can compare and copy the one you like. A live environment panel shows whether Gemini Nano is available on the current device and whether the browser is online or offline, updating as connectivity changes.

How we built it: A single-page web app (HTML + vanilla JavaScript) using the Firebase AI Logic web SDK with a Google AI (Gemini Developer API) backend. The draft call requests on-device inference; the polish call requests cloud-only inference and takes the on-device draft as its input, so the two models genuinely hand off to each other. Hosted on GitHub Pages; source code is MIT-licensed.

Challenges we ran into: Firebase App Check enforcement blocked AI Logic calls by default (HTTP 401), so the AI Logic API was set to monitoring-only for this public demo. The originally chosen cloud model had been retired for new users (HTTP 404), so we moved to the current Gemini Flash model suggested by the API error message. Long cloud generations timed out with non-streaming calls (HTTP 503), so generation now uses streaming with incremental rendering. Finally, the demo video had to prove 'offline' honestly: the app's Network indicator flips to offline on camera and the draft is generated in that state.

Accomplishments that we're proud of: The full hybrid loop works end to end on a real device — offline on-device draft, then back online for the cloud polish — shown in one unbroken flow in the demo video.

What we learned: Hybrid routing is a UX feature, not just an architecture: showing users where their text was generated, and that it keeps working offline, builds trust.

What's next: Photo attachment so the model can see the shot itself, saved caption history, and one-tap posting.

Share this project:

Updates

Submission history