fix(kits): update Gemini models - #2943
Open
CorieW wants to merge 6 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates several Firebase Extensions to use Gemini 3.6 Flash as the default model and gemini-embedding-2 for vector search. It also refactors model reference resolution in the GenAI Chatbot extension to support dynamic fallback instead of throwing errors. The review feedback suggests simplifying shouldUseGenkitClient since model resolution no longer throws, and adding missing Gemini 3.5 models to the translation options for consistency.
5 tasks
Chatbot, translate, and the resize content filter still pin retiring Gemini 2.5 model ids.
Picker listed every 2.5 model; add 3.5 Flash and Flash Lite to match the current Gemini set.
Similar price to previous gemini-2.5-flash and better quality. Avoid 3.5-flash-lite and higher cost.
gemini-3.1-flash-lite is not served on us-central1. Old @genkit-ai/vertexai rejects global; switch to @genkit-ai/google-genai.
googleAI.model()/vertexAI.model() already resolve any id.
Gemini 3.x is served on the Vertex `global`, `us` and `eu` endpoints only, so the function region is not a usable default for the new `gemini-3.6-flash` default. Translate now calls Vertex at `global`, and the chatbot's VERTEX_AI_MODEL_LOCATION defaults to `global` instead of the function region. Gemini 3.x also deprecates temperature/topP/topK — the Vertex model card for gemini-3.6-flash states custom values are ignored. The params stay for Gemini 2.5 configurations, with the limitation documented.
CorieW
added a commit
to GoogleCloudPlatform/firebase-extensions
that referenced
this pull request
Aug 19, 2026
The chatbot default and the Genkit allowlist still pin retiring Gemini 2.5 ids. Parity with firebase/extensions#2943.
CorieW
force-pushed
the
fix/kits-gemini-model-lifecycle
branch
from
August 19, 2026 17:32
0dcd034 to
2cad2db
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gemini-3.6-flash; add 3.x ids to the translate select list (2.5 kept until October 2026).Model not found.for unknown ids — falls through togoogleAI.model()/vertexAI.model().gemini-3.1-flash-lite.globalendpoint: resize content filter, translate, and the chatbot'sVERTEX_AI_MODEL_LOCATIONdefault. Gemini 3.x is served fromglobal,usandeuonly, so the previous "same as the function region" behaviour would 404 for the new default model.TEMPERATURE/TOP_P/TOP_Kare documented as deprecated for Gemini 3.x.Vertex AI location
gemini-3.6-flashand the other Gemini 3.x models are only served from the Vertex AIglobal,usandeuendpoints (locations). A single region such asus-central1returns a 404. The three call sites previously defaulted to the function region, so a Vertex install on the new default model would have failed:storage-resize-imagescontent filterFUNCTION_REGION(required)global, hardcoded with a commentfirestore-translate-textconfig.region(FUNCTION_REGION)global, hardcoded with a commentfirestore-genai-chatbotVERTEX_AI_MODEL_LOCATION, defaultnull= function regionglobal; a region is still selectable for models served thereSampling controls
Gemini 3.x deprecates
temperature,topPandtopK, and the Vertex AI model card forgemini-3.6-flashstates that custom values are ignored. The params are kept — Gemini 2.5 models still honour them and are selectable until October 2026 — but the deprecation is now documented on the params inconfig.tsand in the README table.Why
gemini-3.1-flash-lite(notgemini-3.5-flash-liteor higher)The resize content filter is a high-volume yes/no image check, previously hardcoded to
gemini-2.5-flash. We pickedgemini-3.1-flash-litebecause it is similar in price to that previous default ($0.25/$1.50 vs $0.30/$2.50 per 1M tokens) and performs better (Google: similar or better quality than 2.5 Flash, ~2.5× faster time-to-first-token).gemini-3.5-flash-liteis the same sticker as 2.5 Flash;gemini-3.5-flashandgemini-3.6-flashare about 5× input.Test plan
firestore-genai-chatbotunit tests (includes current-model Genkit path)GEMINI_MODELselect includes 3.x and defaults to 3.6 Flashgemini-3.6-flashon Vertex atglobalus-central1fails ongemini-3.6-flash, and that the newglobaldefault succeedsstorage-resize-imagescontent-filter unit testsglobal; regionalus-central1404s this model)tsc -bclean for chatbot and translate