AndroidX icon indicating copy to clipboard operation
AndroidX copied to clipboard

Bind com.google.firebase:firebase-ai

Open fsaffioti opened this issue 4 months ago • 6 comments

Description

Firebase AI Logic  com.google.firebase:firebase-ai

Firebase AI Logic com.google.firebase:firebase-ai

The com.google.firebase:firebase-ai package is the one currently used to integrate Firebase AI Logic (formerly Vertex AI in Firebase, previously available as com.google.firebase:firebase-vertexai) into native Android apps.

To integrate Gemini AI directly into a .NET MAUI/Native Android app, we need the com.google.firebase:firebase-ai package

fsaffioti avatar Aug 14 '25 09:08 fsaffioti

@fsaffioti is this library using a local on-device model? Or is this using a Firebase cloud service?

Are the libraries being added here, useful instead:

  • https://github.com/dotnet/android-libraries/pull/1243

jonathanpeppers avatar Aug 14 '25 13:08 jonathanpeppers

This SDK integrates with Gemini models through Firebase cloud services, not purely on-device. com.google.firebase:firebase-ai is the successor to firebase-vertexai and is designed to call Gemini APIs via Firebase, while optionally supporting on-device models when configured.

It is therefore different from Google AI Edge LocalAgents or MediaPipe GenAI, which are focused on fully local inference.

It’s also part of the Firebase Android SDK. From that package, you’ve already created bindings for other components such as Xamarin.Firebase.Messaging, Xamarin.Firebase.Analytics, Xamarin.Firebase.Crashlytics, etc., but firebase-ai is currently missing. for reference https://firebase.google.com/support/release-notes/android

We’ve already tested some features in native iOS (for example, function calling) and now we would like to bring them into production in our .NET native Android/iOS app.

fsaffioti avatar Aug 14 '25 14:08 fsaffioti

So, just to be clear these are all features that compete with Azure? Could you just use Azure OpenAI libraries instead? Those would work on more platforms than Android.

You might be better off creating your own binding for this, some docs on this here:

  • https://github.com/dotnet/java-interop/wiki/Troubleshooting-Android-Bindings-Issues

jonathanpeppers avatar Aug 14 '25 17:08 jonathanpeppers

@jonathanpeppers I would like to better understand the criteria you use to decide when to create a binding. For example, Firebase Messaging (push notification) can also be implemented with Azure, just like Analytics/Crashlytics, yet you still chose to create a binding for the Firebase libraries.

We could create our own binding or a slim binding, but I thought it might have been useful for the .NET community.

fsaffioti avatar Aug 16 '25 16:08 fsaffioti

I would like to better understand the criteria you use to decide when to create a binding

Going forward, we would like to create as few as possible. We do not have enough manpower to maintain these unless the community helps.

We are still creating some important new ones, like related to on-device AI (LLM) usage:

  • https://github.com/dotnet/android-libraries/pull/1243

jonathanpeppers avatar Aug 18 '25 13:08 jonathanpeppers

https://www.nuget.org/packages/HolisticWare.Firebase.AI

https://www.nuget.org/packages?q=HolisticWare.Google.MediaPipe&includeComputedFrameworks=true&prerel=true&sortby=relevance

LocalAgents is WIP (I had issues with nuget account)

And there is much more for on-device/edge AI

https://www.nuget.org/packages/HolisticWare.AI.Generative.LM.Picovoice.PicoLLM

moljac avatar Aug 20 '25 06:08 moljac