Skip to content
pubscout

firebase_ai

5.2.0, released 5 days ago by firebase.google.com

Flutter plugin for Firebase AI Logic SDK to access Gemini, Imagen and other generative models.

WASM-ready
$ flutter pub add firebase_ai

What it does

Provides Dart APIs to call Firebase AI services such as text generation and image generation. Handles authentication, App Check and integrates with Firebase core packages.

AI-written summary of version 5.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need Firebase‑hosted generative AI models like Gemini or Imagen
  • Your app already uses other Firebase services (auth, core, app‑check)
  • You prefer a managed backend over self‑hosting LLMs

Skip it when

  • You want a completely offline/on‑device model
  • You need a non‑Firebase AI provider or custom model serving

Strengths

  • Tight integration with Firebase ecosystem
  • Automatic handling of auth and App Check tokens
  • Supports latest Google generative models

Weaknesses

  • Limited to Firebase AI services only
  • Requires Firebase project configuration and internet access
  • Plugin adds native setup for each platform

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
7

Add firebase_core, firebase_auth, firebase_app_check to your project and configure each platform (Android manifest, iOS plist, web initialization). No build_runner needed.

import 'package:firebase_ai/firebase_ai.dart';

Future<void> generateText() async {
  final ai = FirebaseAI.instance;
  final response = await ai.generateText(prompt: 'Hello world');
  print(response.text);
}

Alternatives

Packages that do the same job and could replace firebase_ai.

  • openai_dart

    If you prefer using OpenAI models directly without Firebase dependencies

Works with

Packages commonly used together with firebase_ai: ones it builds on, ones built on it, and its own family.