Skip to content

[Bug]: Frequency_penalty and presence_penalty are not supported for gemini-2.5-pro model #16031

@tanvithakur94

Description

@tanvithakur94

What happened?

We are seeing issues with gemini-2.5-pro model wherein we are seeing error:

"UnsupportedParamsError: vertex_ai does not support parameters: ['frequency_penalty'], for model=gemini-2.5-pro. To drop these, set `drop_params=True` or for proxy:\n\n`litellm_settings:\n drop_params: true`\n. \n If you want to use these params dynamically send allowed_openai_params=['frequency_penalty'] in your request."

We investigated and found the error related to this logic https://github.com/BerriAI/litellm/blob/main/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py#L225.

We should simply be doing:

    def _supports_penalty_parameters(self, model: str) -> bool:
        unsupported_models = ["gemini-2.5-pro-preview-06-05"]

        for pattern in unsupported_models:
                return False

        return True

Can somebody take a look at this asap?

Relevant log output

Are you a ML Ops Team?

No

What LiteLLM version are you on ?

v1.78.7

Twitter / LinkedIn details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions