fix(vertex): map reasoning_effort to thinkingBudget for Gemini 2.5 - #1741
Open
Solaris-star wants to merge 1 commit into
Open
fix(vertex): map reasoning_effort to thinkingBudget for Gemini 2.5#1741Solaris-star wants to merge 1 commit into
Solaris-star wants to merge 1 commit into
Conversation
Bare reasoning_effort was always emitted as thinkingLevel, which Vertex silently drops on Gemini 2.5 models. flash-lite defaults thinking off, so the no-op was user-visible as zero reasoning tokens. Branch by model family: - Gemini 2.5 → thinkingBudget (+ includeThoughts) - Gemini 3+ → thinkingLevel Also honor nested reasoning.effort (Responses API shape). Fixes Portkey-AI#1639
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
#1639: on Vertex
/v1/responses(and chat transforms in OSS), barereasoning_effortwas always mapped tothinkingConfig.thinkingLevel. That field is Gemini 3+ only. On Gemini 2.5 (especiallygemini-2.5-flash-lite, default thinking off) Vertex silently drops it → HTTP 200 with zero reasoning tokens.Nested
reasoning: { effort }worked in production as a workaround; bare shorthand did not.Change
reasoning_effort/ nestedreasoning.effortby model family:thinkingConfig.thinkingBudget(+includeThoughts)thinkingConfig.thinkingLevel(previous behaviour)transformGenerationConfig.ts; google provider reuses themnoneEffort → budget map:
minimal=512,low=1024,medium=8192,high=24576(numeric strings also accepted).Test plan
npx jest src/providers/google-vertex-ai/transformGenerationConfig.test.ts— 11 passedFixes #1639