Skip to content

fix(kits): update Gemini models - #2943

Open
CorieW wants to merge 6 commits into
kitsfrom
fix/kits-gemini-model-lifecycle
Open

fix(kits): update Gemini models#2943
CorieW wants to merge 6 commits into
kitsfrom
fix/kits-gemini-model-lifecycle

Conversation

@CorieW

@CorieW CorieW commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

  • Default translate and genai chatbot to gemini-3.6-flash; add 3.x ids to the translate select list (2.5 kept until October 2026).
  • Genkit chatbot no longer throws Model not found. for unknown ids — falls through to googleAI.model() / vertexAI.model().
  • Resize content filter uses gemini-3.1-flash-lite.
  • All Vertex AI call sites now target the global endpoint: resize content filter, translate, and the chatbot's VERTEX_AI_MODEL_LOCATION default. Gemini 3.x is served from global, us and eu only, so the previous "same as the function region" behaviour would 404 for the new default model.
  • Chatbot TEMPERATURE / TOP_P / TOP_K are documented as deprecated for Gemini 3.x.

Vertex AI location

gemini-3.6-flash and the other Gemini 3.x models are only served from the Vertex AI global, us and eu endpoints (locations). A single region such as us-central1 returns a 404. The three call sites previously defaulted to the function region, so a Vertex install on the new default model would have failed:

Call site Before After
storage-resize-images content filter FUNCTION_REGION (required) global, hardcoded with a comment
firestore-translate-text config.region (FUNCTION_REGION) global, hardcoded with a comment
firestore-genai-chatbot VERTEX_AI_MODEL_LOCATION, default null = function region default global; a region is still selectable for models served there

Sampling controls

Gemini 3.x deprecates temperature, topP and topK, and the Vertex AI model card for gemini-3.6-flash states 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 in config.ts and in the README table.

Why gemini-3.1-flash-lite (not gemini-3.5-flash-lite or higher)

The resize content filter is a high-volume yes/no image check, previously hardcoded to gemini-2.5-flash. We picked gemini-3.1-flash-lite because 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-lite is the same sticker as 2.5 Flash; gemini-3.5-flash and gemini-3.6-flash are about 5× input.

Test plan

  • Run firestore-genai-chatbot unit tests (includes current-model Genkit path)
  • Confirm translate GEMINI_MODEL select includes 3.x and defaults to 3.6 Flash
  • Smoke chatbot + translate with gemini-3.6-flash on Vertex at global
  • Confirm a Vertex chatbot install pinned to us-central1 fails on gemini-3.6-flash, and that the new global default succeeds
  • Run storage-resize-images content-filter unit tests
  • Smoke resize with content filter enabled (Vertex global; regional us-central1 404s this model)
  • tsc -b clean for chatbot and translate

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread kits/firestore-genai-chatbot/src/generative-client/genkit.ts
Comment thread kits/firestore-translate-text/src/config.ts
@CorieW
CorieW requested a review from a team as a code owner August 17, 2026 22:23
@CorieW CorieW changed the title fix(kits): add Gemini 3.x before 2.5 retirement fix(kits): update Gemini models Aug 18, 2026
CorieW added 6 commits August 19, 2026 13:19
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
CorieW force-pushed the fix/kits-gemini-model-lifecycle branch from 0dcd034 to 2cad2db Compare August 19, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants