Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions litellm/llms/gemini/chat/transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def get_supported_openai_params(self, model: str) -> List[str]:
"stop",
"logprobs",
"frequency_penalty",
"presence_penalty",
"modalities",
"parallel_tool_calls",
"web_search_options",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from litellm.llms.vertex_ai.gemini.vertex_and_google_ai_studio_gemini import (
VertexGeminiConfig,
)
from litellm.llms.gemini.chat.transformation import GoogleAIStudioGeminiConfig
from litellm.types.llms.vertex_ai import UsageMetadata
from litellm.types.utils import ChoiceLogprobs, Usage

Expand Down Expand Up @@ -2226,3 +2227,15 @@ def test_partial_json_chunk_on_first_chunk():
assert result is None, "Partial first chunk should return None"
assert iterator.chunk_type == "accumulated_json", "Should switch to accumulated_json mode"



def test_google_ai_studio_presence_penalty_supported():
"""
Test that presence_penalty is supported for Google AI Studio Gemini.
Regression test for https://github.com/BerriAI/litellm/issues/14753
"""
config = GoogleAIStudioGeminiConfig()
supported_params = config.get_supported_openai_params(model="gemini-2.0-flash")

assert "presence_penalty" in supported_params
Loading