fix(litellm): detect Gemini models with space-separated names for thought signature injection #10787
+22
−1
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
Fixes the "Corrupted thought signature" error when using LiteLLM with Gemini 3/2.5 models via model groups that use space-separated names (e.g., "Gemini 3 Pro").
Problem
LiteLLM model groups can use space-separated model names like "Gemini 3 Pro" instead of hyphenated names like "gemini-3-pro". The
isGeminiModel()function only matched hyphenated names, causing the thought signature injection to be skipped for space-separated names.When Vertex AI receives a Gemini 3 request without the expected thought signature, it returns:
Solution
Updated
isGeminiModel()to detect both naming conventions:gemini 3,gemini 2.5Changes
isGeminiModel()functionTesting
All 19 LiteLLM handler tests pass including new tests for:
Closes COM-508
Important
Fixes
isGeminiModel()inlite-llm.tsto detect Gemini models with space-separated names, adding tests inlite-llm.spec.ts.isGeminiModel()inlite-llm.ts.lite-llm.spec.tsfor space-separated Gemini model names, including provider-prefixed variants.isGeminiModel()to match both hyphens and spaces.This description was created by
for 737fbb3. You can customize this summary. It will automatically update as commits are pushed.