Skip to content

Commit 3e30764

Browse files
authored
fix(google_gemini): Update thinking budgets from 24576 to 32768 tokens
1 parent c545c67 commit 3e30764

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

docs/google-gemini-integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This integration enables **Open WebUI** to interact with **Google Gemini** model
2626
> Streaming is automatically disabled for image generation models to prevent chunk size issues.
2727
2828
- **Thinking Support**
29-
Support reasoning and thinking steps, allowing models to break down complex tasks. Includes configurable thinking levels for Gemini 3 Pro ("low"/"high") and thinking budgets (0-24576 tokens) for other thinking-capable models.
29+
Support reasoning and thinking steps, allowing models to break down complex tasks. Includes configurable thinking levels for Gemini 3 Pro ("low"/"high") and thinking budgets (0-32768 tokens) for other thinking-capable models.
3030

3131
> [!Note]
3232
> **Thinking Levels vs Thinking Budgets**: Gemini 3 Pro models use `thinking_level` ("low" or "high"), while other models like Gemini 2.5 use `thinking_budget` (token count). See [Gemini Thinking Documentation](https://ai.google.dev/gemini-api/docs/thinking) for details.

pipelines/google/google_gemini.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
- Optimized payload creation for image generation models
3333
- Configurable image processing parameters (size, quality, compression)
3434
- Flexible upload fallback options and optimization controls
35-
- Configurable thinking levels (low/high) for Gemini 3 Pro models
36-
- Configurable thinking budgets (0-24576 tokens) for Gemini 2.5 models
35+
- Configurable thinking levels (low/high) for Gemini 3 models
36+
- Configurable thinking budgets (0-32768 tokens) for Gemini 2.5 models
3737
"""
3838

3939
import os
@@ -175,7 +175,7 @@ class Valves(BaseModel):
175175
)
176176
THINKING_LEVEL: str = Field(
177177
default=os.getenv("GOOGLE_THINKING_LEVEL", ""),
178-
description="Thinking level for Gemini 3 Pro models only ('low' or 'high'). "
178+
description="Thinking level for Gemini 3 models ('low' or 'high'). "
179179
"Ignored for other models. Empty string means use model default.",
180180
)
181181
USE_VERTEX_AI: bool = Field(
@@ -1523,6 +1523,7 @@ def _configure_generation(
15231523
)
15241524
else:
15251525
# -1 means dynamic thinking
1526+
thinking_config_params["thinking_budget"] = -1
15261527
self.log.debug(
15271528
f"Using dynamic thinking (model decides) for model {model_id}"
15281529
)

0 commit comments

Comments
 (0)