Inspiration

Small creators who plan dozens of Shorts a week and need titles/hooks fast without waiting on a server or paying per call — and who want their drafts to stay on their own machine. Inspired by KreekCraft / GTA 6 clipping work: cutting clips is fast, naming them well is the slow part.

What it does

ClipCraft is a creator tool for short-form video makers. Paste a video transcript and it generates 5 titles, 3 hooks (first 3 seconds) and 10 hashtags, plus a cloud-generated thumbnail image and a trend & SEO analysis — every result badged with the engine that produced it: "On-device · Gemini Nano" or "Cloud · Gemini".

How we built it

On-device first: getAI(app, { backend: new GoogleAIBackend() }) with getGenerativeModel(ai, { mode: InferenceMode.PREFER_ON_DEVICE }). Titles, hooks and hashtags are generated on-device with Gemini Nano 4 (Chrome Prompt API) — instant, offline, private, free. The model is initialised on the Generate click (model.initializeDeviceModel()); the badge is read from response.inferenceSource (verified live: on-device results badge "On-device · Gemini Nano"). Cloud fallback: the same hybrid call falls back to gemini-3.5-flash-lite when on-device is unavailable; the thumbnail uses gemini-3.1-flash-image (Nano Banana) and the trend & SEO analysis uses cloud text generation. App Check (reCAPTCHA Enterprise) protects the cloud calls; the app degrades honestly to labelled demo output when the AI Logic API is not enabled. Built with Vite + React 19 + TypeScript, Firebase AI Logic (firebase 12.19.0 / @firebase/ai 2.16.0), GitHub Pages hosting. Built 20 Nov 2026 during the hackathon.

What we learned

The Firebase AI Logic SDK's inferenceSource returns lowercase runtime strings (on_device / in_cloud), not the uppercase enum keys — compare against the real value, not the docs' key names. Enabling the Gemini/Vertex APIs directly is not enough: the genai config is only created by the Firebase console AI Logic setup flow (otherwise 400 "genai config not found"). With App Check enforcement on, cloud calls fail 401 until the app is registered with a reCAPTCHA Enterprise key AND the site key is wired into the client. PREFER_ON_DEVICE silently returns cloud results when the device model is not usable — badge from inferenceSource, never assume.

Challenges we ran into

The on-device badge showed "Cloud" for every result for hours: the SDK, adapter, availability and generation were all healthy — only the badge comparison was wrong (case). Found by reading the SDK source. App Check 401 blocked the cloud fallback intermittently; fixed by creating and registering a reCAPTCHA Enterprise key (free, no billing) and wiring the site key into the app, verified end to end.

Built With

Share this project:

Updates

Submission history