Skip to content

fix: gemini minimal reasoning effort#1486

Merged
VisargD merged 3 commits intoPortkey-AI:mainfrom
narengogi:fix/gemini-minimal-reasoning
Dec 24, 2025
Merged

fix: gemini minimal reasoning effort#1486
VisargD merged 3 commits intoPortkey-AI:mainfrom
narengogi:fix/gemini-minimal-reasoning

Conversation

@narengogi
Copy link
Member

Description: (required)

  • Gemini supports new reasoning modes (minimal and medium) (previously only low and high were supported) for the gemini 3 flash models, this PR just updates the mapping

payload to test

{
    "model": "gemini-3-flash-preview",
    "stream": false,
    "stop": ["NO_RESPONSE_REQUIRED"],
    "reasoning_effort": "minimal",
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "Give me the flight ticket details from BLR to LDX"
                }
            ]
        }
    ]
}

Type of Change:

  • Refactoring (no functional changes)

@narengogi narengogi requested a review from Copilot December 24, 2025 05:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Gemini's reasoning effort mapping to support the newly introduced "minimal" and "medium" modes for Gemini 3 Flash models. Previously, the code mapped OpenAI-style reasoning efforts to Vertex AI's thinking levels (consolidating minimal/low to "low" and medium/high to "high"), but now passes the reasoning_effort value directly without transformation.

Key changes:

  • Removed the mapping function that converted reasoning effort values to thinking levels
  • Updated both Google and Google Vertex AI providers to use reasoning_effort values directly

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/providers/google/chatComplete.ts Removed mapping function import and usage; now passes reasoning_effort directly to thinkingConfig
src/providers/google-vertex-ai/transformGenerationConfig.ts Removed the openaiReasoningEffortToVertexThinkingLevel mapping function and updated to use reasoning_effort directly

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@narengogi narengogi requested a review from Copilot December 24, 2025 05:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@narengogi narengogi requested review from VisargD and b4s36t4 December 24, 2025 05:21
@VisargD VisargD merged commit 36eb0b4 into Portkey-AI:main Dec 24, 2025
1 check passed
@davidwhite-spec
Copy link

@narengogi @VisargD hi.
Screenshot 2025-12-25 at 1 24 34 AM

We were using gemini 3 flash with reasoning effort set to "low" and we saw our latency drop like crazy from 11s to 3s. Can you help me understand what is going on? Was I truly using "low" before? Am I truly using "low" now?

@narengogi
Copy link
Member Author

narengogi commented Dec 26, 2025

@davidwhite-spec haha, yes there was no minimal and medium setting previously in the gemini spec, it was added for the gemini 3 flash models, so previously to avoid errors minimal and low were mapped to low, now they are not

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.

3 participants

Comments