6 views
-/https://github.com/berriai/litellm/issues/26108
GitHub · issue

#26108 Gemini: frequency_penalty listed as supported but rejected by API

  • State: open
  • Author: @robert-belfer
  • Labels: llm translation

## Bug Description

`litellm.get_supported_openai_params(model='gemini/gemini-2.5-flash')` includes `frequency_penalty` in the returned list, but when the parameter is actually passed, the Gemini API rejects it with a 400 error:

``` Penalty is not enabled for models/gemini-2.5-flash ```

This also means `litellm.drop_params = True` does not help — since litellm considers the param "supported" for Gemini, it maps it to the native Gemini API parameter rather than dropping it. The API then rejects it.

## Reproduction

```python import litellm

# This claims frequency_penalty is supported: params = litellm.get_supported_openai_params(model='gemini/gemini-2.5-flash') print('frequency_penalty' in params) # True

# But this fails: litellm.drop_params = True # has no effect since param is "supported" response = await litellm.acompletion( model="gemini/gemini-2.5-flash", messages=[{"role": "user", "content": "Hello"}], temperature=0, max_tokens=50, frequency_penalty=0.4, ) # GeminiException BadRequestError - {"error": {"code": 400, "message": "Penalty is not enabled for models/gemini-2.5-flash"}} ```

## Expected Behavior

Either: 1. `get_supported_openai_params` sho…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d18h19m30s ago — entered · #import:https:::github.com:berriai:litellm post #2626
#34301 is harder because it requires coordinating model-family registration, reasoning-mode detection, parameter validation, and regression coverage across multiple OpenAI variants; #26108 is comparatively localized to Gemini capability metadata and translation behavior.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search