Skip to content

fix(kits): add Gemini 3.x before 2.5 retirement - #2943

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

fix(kits): add Gemini 3.x before 2.5 retirement#2943
CorieW wants to merge 3 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.
  • Vector search Gemini/Vertex embedder uses gemini-embedding-2 (Gemini API retired gemini-embedding-001 on 14 Jul 2026). Flash completion IDs are not embedders.

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
  • Run storage-resize-images content-filter unit tests
  • Smoke vector search Gemini embeddings with gemini-embedding-2

Chatbot, translate, resize filter, and vector embeddings
still pin retiring or retired Gemini model ids.

@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.

}

/** Whether the Genkit client can serve this config (single candidate + known model). */
/** Whether the Genkit client can serve this config (single candidate). */

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.

medium

Since createModelReference has been updated to never throw and always return a ModelReference (falling back to dynamic resolution), the check !!GenkitDiscussionClient.createModelReference(...) in shouldUseGenkitClient will always evaluate to true.

We can simplify shouldUseGenkitClient to only check the candidate count, avoiding redundant model reference creation:

  static shouldUseGenkitClient(config: ResolvedGenaiChatbotConfig): boolean {
    const shouldReturnMultipleCandidates =
      config.candidateCount && config.candidateCount > 1;
    return !shouldReturnMultipleCandidates;
  }

Comment on lines +40 to +42
"gemini-3.1-pro-preview",
"gemini-3.6-flash",
"gemini-3.1-flash-lite",

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.

medium

The GEMINI_MODEL_OPTIONS list is missing gemini-3.5-flash and gemini-3.5-flash-lite, which are valid Gemini 3.x models and are included in the chatbot's knownIds. Adding them here ensures consistency across extensions and allows users to select these models from the dropdown in the Firebase Console.

Suggested change
"gemini-3.1-pro-preview",
"gemini-3.6-flash",
"gemini-3.1-flash-lite",
"gemini-3.6-flash",
"gemini-3.5-flash",
"gemini-3.5-flash-lite",
"gemini-3.1-flash-lite",
"gemini-3.1-pro-preview",

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.
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