firebase-ai-logic

Call Gemini models directly from web and mobile client code.

2|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/involvex/happy-vibecode --skill firebase-ai-logic-involvex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: firebase-ai-logic
Source: https://github.com/involvex/happy-vibecode/tree/main/.agents/skills/firebase-ai-logic
Command: npx skills add https://github.com/involvex/happy-vibecode --skill firebase-ai-logic-involvex

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Firebase AI Logic removes the need to run and maintain a dedicated backend for generative AI by enabling web and mobile apps to call Gemini models directly from client code, simplifying integration of text, image, audio, and document inference into user-facing experiences.

Core Features & Use Cases

  • Client-side Gemini access: Initialize and call Gemini Developer or Vertex Gemini APIs from JavaScript without managing server infrastructure.
  • Multimodal inference: Send images, audio, video, and PDFs as inline data or Cloud Storage references for captioning, Q&A, and object detection.
  • Streaming & chat: Support for streaming partial responses, multi-turn chat sessions, and hybrid on-device/cloud inference with Gemini Nano fallbacks.
  • Structured outputs & image generation: Enforce JSON schemas for reliable structured responses and generate images using image-capable Gemini models.
  • Production guidance: Recommendations for App Check, Remote Config for dynamic model switching, and billing considerations for Developer vs Vertex APIs.
  • Use Case: Build an in-app assistant that answers questions about uploaded photos, generates descriptive captions, and streams responses to improve UX.

Quick Start

Initialize the Firebase AI Logic SDK in your web app, configure the GoogleAIBackend, create a GenerativeModel with your chosen Gemini variant, and call generateContent or generateContentStream with your prompt.

Frequently Asked Questions about firebase-ai-logic

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I call Gemini models directly from my web app without a backend?

Firebase AI Logic lets you call Gemini models directly from client code in JavaScript web apps without managing server infrastructure. You initialize the SDK, configure the GoogleAIBackend, and call generateContent with your prompt.

Can I send images and PDFs to Gemini for inference in a React Native app?

Yes, Firebase AI Logic supports multimodal inference in Expo and React Native apps. You can send images, audio, video, and PDFs as inline data or Cloud Storage references for captioning, Q&A, and object detection.

Does Firebase AI Logic support streaming responses and multi-turn chat?

Firebase AI Logic supports streaming partial responses via generateContentStream and manages multi-turn chat sessions. It also enables hybrid on-device and cloud inference with Gemini Nano fallbacks for reliable delivery.

How do I get structured JSON outputs from Gemini in my mobile app?

You can enforce JSON schemas in Firebase AI Logic to receive reliable structured responses from Gemini models. This ensures your mobile app can parse generated content predictably for downstream processing.

What is the best way to secure Gemini API calls in a production web app?

Firebase AI Logic recommends using App Check to secure production deployments and Remote Config for dynamic model switching. This protects your app from unauthorized usage while allowing flexible Backend management.