If you’re an Android developer looking to implement innovative AI features in your app, we recently launched powerful new updates: hybrid inference, a new API for Firebase AI Logic to leverage both on-device and cloud inference, and support for new Gemini models, including the latest Nano Banana models for image generation.
Let’s jump in!
Experiments with hybrid estimation
with new Firebase API for Hybrid EstimatingWe’ve implemented a simple rule-based routing approach as an initial solution to give you the flexibility to use both on-device and cloud inference through a unified API. We plan to provide more sophisticated routing capabilities in the future.
This allows your app to dynamically switch between Gemini Nano running locally on the device and the cloud-hosted Gemini model. On-device execution uses ML Kit’s Prompt API. Cloud Inference supports all Gemini models of Firebase AI Logic in both Vertex AI and developer API.
To use it, add firebase-ai-ondevice Dependencies on your app with Firebase AI Logic:
dependencies {
(...)
implementation("com.google.firebase:firebase-ai:17.11.0")
implementation("com.google.firebase:firebase-ai-ondevice:16.0.0-beta01")
}
During initialization, you create a GenerativeModel example and configure it with specific estimation modes, like PREFER_ON_DEVICE (falls back to the cloud if Gemini Nano is not available on the device) or PREFER_IN_CLOUD (Reverts to on-device estimation when offline):
val model = Firebase.ai(backend = GenerativeBackend.googleAI())
.generativeModel(
modelName = "gemini-3.1-flash-lite",
onDeviceConfig = OnDeviceConfig(
mode = InferenceMode.PREFER_ON_DEVICE
)
)
val response = model.generateContent(prompt)
The Firebase API for Hybrid Inference for Android is still experimental, and we encourage you to try it in your app, especially if you’re already using Firebase AI Logic. Currently, on-device models are specialized for single-turn text generation based on text or a single bitmap image input. review the boundaries For more information.
we just published a New sample in the AI ​​sample catalog leveraging the Firebase API for hybrid; This demonstrates how the Firebase API for Hybrid Inference can be used to generate reviews based on some selected topics and then translate it into different languages. Check out the code to see it in action!
The new hybrid estimation model in action
Try our new models
As part of the new Gemini models, we have released two models that are especially useful for Android developers and are easy to integrate into your applications through the Firebase AI Logic SDK.
nano banana
Last year we released Nano Banana, a state-of-the-art image formation model. And a few weeks ago, we released some new Nano Banana models.
Nano Banana Pro (Gemini 3 Pro image) Designed for professional asset production and can render high-fidelity text in a specific font or even simulating different types of handwriting.
New nano banana models leverage real-world knowledge and deep reasoning capabilities to create accurate and detailed images.
We’ve updated our Magic Selfie sample (use image generation to change the background of your selfie!) to use the Nano Banana 2. Background segmentation is now handled directly with the image generation model which simplifies implementation and allows Nano Banana 2 to shine better image generation capabilities. try it out Here.
Updated Magic Selfie sample uses Nano Banana 2 to update selfie background
You can use it through the Firebase AI Logic SDK. Read more about it Android Documentation.
Gemini 3.1 Flash-Lite
we also released Gemini 3.1 Flash-LiteA new version of the Gemini flash-light family. The Gemini Flash-Lite model has been particularly liked by Android developers for its good quality/latency ratio and low estimation cost. It is used by Android developers for various use-cases such as in-app messaging translation or generating a recipe from a photo of a dish.
Gemini 3.1 Flash-Lite, which is currently in preview, will enable more advanced use cases with lower latency than Gemini 2.5 Flash-Lite. To know more about this model, check out its review firebase documentation.
conclusion
This is a great time to explore the new hybrid samples in our catalog to implement these capabilities and understand the benefits of routing between on-device and cloud inference. We also encourage you to check out our documentation for testing new Gemini models.

.gif)