You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🚀 [firebase_ai] Support Files API as an alternative to InlineDataPart #17615
When I ask Gemini to extract some information from a video file it takes way too long 20 - 25 seconds for videos which are 30 seconds max and take around 1-5 mb.
Usage of the REST API resulted in 2x faster Gemini response.
I can't tell why exactly but the only noticeable difference I see is the way video file is supplied in the library and when working with REST so my guess is that's what made it faster.
The Gemini Developer API Files API is not currently exposed through Firebase AI Logic SDKs, so this is not something firebase_ai can just route through without backend/API support. In Firebase AI Logic, the supported alternative to InlineDataPart for larger or reusable media is to upload the file to Cloud Storage for Firebase and pass it as FileData.
For Flutter, that looks like:
final videoPart =FileData('video/mp4', 'gs://your-bucket/path/video.mp4');
final response =await model.generateContent([
Content.multi([
videoPart,
constTextPart('Extract the relevant information from this video.'),
]),
]);
I’m going to close this as an upstream Firebase AI Logic feature request rather than a FlutterFire bug. If Firebase AI Logic adds a Files API surface in the future, we can expose it in firebase_ai.
Activity
Lyokone commentedon Jun 8, 2026
Hi @ReplayAppTeam, thanks for the detailed comparison.
The Gemini Developer API Files API is not currently exposed through Firebase AI Logic SDKs, so this is not something
firebase_aican just route through without backend/API support. In Firebase AI Logic, the supported alternative toInlineDataPartfor larger or reusable media is to upload the file to Cloud Storage for Firebase and pass it asFileData.For Flutter, that looks like:
The Firebase docs cover this flow here: https://firebase.google.com/docs/ai-logic/solutions/cloud-storage
I’m going to close this as an upstream Firebase AI Logic feature request rather than a FlutterFire bug. If Firebase AI Logic adds a Files API surface in the future, we can expose it in
firebase_ai.