-
-
SpecPulse Hybrid editor with Auto Hybrid routing, FieldOps Copilot preset, and PII redaction toggle.
-
Quick Polish streaming output with Apply to Editor, Markdown export, and automatic cloud fallback badge.
-
Spec editor constraints view demonstrating graceful local-to-cloud fallback and dual inference actions.
-
Structured Markdown spec output generated via hybrid inference with live route badge and latency info.
Inspiration
Developers building AI apps face a constant trade-off between privacy, latency, and cost (on-device models) versus deep reasoning quality (cloud models). For #BuildHybridAI 2026, we wanted to make hybrid AI routing transparent, observable, and reliable—so teams can design and stress-test hybrid project specs in one workspace.
What it does
SpecPulse Hybrid is a developer workspace that routes spec-refinement tasks between on-device and cloud models using Firebase AI Logic (firebase/ai) strategies:
- Routing Modes: Switch live between Auto Hybrid, Local Preferred (
InferenceMode.PREFER_ON_DEVICE), and Cloud Preferred (InferenceMode.ONLY_IN_CLOUD). - Quick Polish (Local-first): Tightens rough project notes into concise engineering sections, prioritizing on-device Chrome Built-in AI (
LanguageModel/ Gemini Nano) when available. - Deep Critique (Cloud): Performs a rigorous hackathon readiness review, hybrid architecture analysis, edge cases, and next steps via cloud reasoning.
- Local Privacy Guard: Scrubs emails, phone numbers, API keys, and bearer tokens locally in the browser before any Cloud or Fallback network call.
- Routing & Fallback Log + Diagnostics: Audits every run with the resolved route badge (
Local,Cloud, orFallback),InferenceMode, PII scrub count, latency, and routing reason, plus a live Diagnostics modal and one-click.mdexport.
How we built it
- Frontend: React, TypeScript, Tailwind CSS, Vite, and the
firebase/aiSDK (getAI,GoogleAIBackend,getGenerativeModel,InferenceMode,InferenceSource). - On-Device Probing: Live capability detection for Chrome's
LanguageModelPrompt API (includingpromptStreamingand download progress monitoring whendownloadable). - Resilient Cloud Fallback & Streaming: Server-side SSE streaming (
/api/infer/stream) on Vercel Serverless Functions & Express using@google/genai(gemini-4-hydrogenwith automatic secondary failover togemini-3.1-flash-lite).
Challenges we ran into
- Ensuring zero broken states across browsers that do not yet expose on-device Gemini Nano by building a multi-layer fallback chain and transparent route logging.
- Handling transient cloud demand spikes (
503) cleanly via streaming failover, and adapting Express routes to Vercel Serverless Functions for production deployment.
What we learned
Hybrid AI works best when fallback behavior, latency, and privacy boundaries are first-class UI elements rather than hidden backend details.
What's next
- Adding team spec collaboration and persisted evaluation benchmarks in Cloud Firestore.
- Expanding offline local queue sync for multi-step spec reviews.
Built With
- firebase
- gemini
- react
- tailwindcss
- typescript
- vercel
- vite