Skip to content

fix: compute best Gemini model by tier and version - #6845

Open
Matvey-Kuk wants to merge 1 commit into
mainfrom
Matvey-Kuk/gemini-best-model-flash
Open

fix: compute best Gemini model by tier and version#6845
Matvey-Kuk wants to merge 1 commit into
mainfrom
Matvey-Kuk/gemini-best-model-flash

Conversation

@Matvey-Kuk

Copy link
Copy Markdown
Contributor

What

Gemini's "best" model marker was matched against a hardcoded, manually-ordered list of exact model-id substrings (MODEL_MARKER_PATTERNS.gemini). Google has not shipped a gemini-3.5-pro, so the gemini-3.5-flash entry outranked the actually-available Pro models (gemini-3.1-pro-preview, gemini-3-pro-preview) and a Flash was marked "best".

Replaces the static list with a score computed from the model id in pickBestGeminiModelId (shared/gemini-models.ts): tier (Pro > Flash > Flash-lite), then newest generation, then GA over -preview. This tracks new releases with no list to maintain and can't re-break when Google ships the next model.

Changes

  • shared/gemini-models.tspickBestGeminiModelId + geminiChatScore.
  • shared/model-constants.tsMODEL_MARKER_PATTERNS.gemini now [] (computed instead).
  • backend/src/models/llm-provider-api-key-model.tsfindBestModel dispatches Gemini to the computed selector; other providers unchanged.
  • Tests for the scorer and the sync integration path.

Verified

Unit + integration tests pass; refreshing models on a dev stack marks gemini-3.1-pro-preview (newest available Pro) as best.

Gemini's "best" marker matched a hardcoded, ordered id list. With no
gemini-3.5-pro in Google's catalog, a 3.5 Flash outranked the available
Pro models, so Flash was marked best. Replace the list with a computed
score from the id (Pro > Flash > Flash-lite, then newest generation, then
GA over preview), so best tracks releases with no list to maintain.
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.

1 participant