mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
feat(fireworks_ai): drop reasoning_effort=auto to the model default
Fireworks rejects reasoning_effort="auto" (accepted set: low, medium, high, xhigh, max, none, adaptive), so OpenAI-compatible clients sending it 400. Omitting the param means model default on Fireworks, which is exactly what auto means on OpenAI's side, so skip it in map_openai_params instead of forwarding.
This commit is contained in:
parent
0c0e1e8374
commit
599283584f
2 changed files with 20 additions and 2 deletions
|
|
@ -295,7 +295,7 @@ class FireworksAIConfig(FireworksAIMixin, OpenAIGPTConfig):
|
|||
optional_params["reasoning_effort"] = "medium"
|
||||
elif value is False:
|
||||
optional_params["reasoning_effort"] = "none"
|
||||
else:
|
||||
elif value != "auto":
|
||||
optional_params["reasoning_effort"] = value
|
||||
elif param in supported_openai_params:
|
||||
if value is not None:
|
||||
|
|
@ -303,7 +303,9 @@ class FireworksAIConfig(FireworksAIMixin, OpenAIGPTConfig):
|
|||
|
||||
return optional_params
|
||||
|
||||
def map_extra_body_params(self, optional_params: Mapping[str, object], model: str) -> dict: # noqa: LIT001 # http handler pops extra_body off the returned dict
|
||||
def map_extra_body_params(
|
||||
self, optional_params: Mapping[str, object], model: str
|
||||
) -> dict: # mutable-ok: http handler pops extra_body off the returned dict
|
||||
extra_body: Final = optional_params.get("extra_body")
|
||||
if not isinstance(extra_body, dict):
|
||||
return dict(optional_params) # mutable-ok: JSON request body
|
||||
|
|
|
|||
|
|
@ -1153,6 +1153,22 @@ def test_reasoning_effort_integer_passthrough():
|
|||
assert isinstance(result["reasoning_effort"], int)
|
||||
|
||||
|
||||
def test_reasoning_effort_auto_dropped_to_model_default():
|
||||
"""
|
||||
Fireworks rejects reasoning_effort="auto" (accepted set: low/medium/high/
|
||||
xhigh/max/none/adaptive). Omitting the param is the model default, which is
|
||||
exactly what "auto" means on OpenAI's side, so it must not reach the request.
|
||||
"""
|
||||
config = FireworksAIConfig()
|
||||
result = config.map_openai_params(
|
||||
{"reasoning_effort": "auto"},
|
||||
{},
|
||||
_REASONING_MODEL,
|
||||
drop_params=False,
|
||||
)
|
||||
assert "reasoning_effort" not in result
|
||||
|
||||
|
||||
def test_transform_response_captures_perf_metrics():
|
||||
body = {
|
||||
**_BASE_CHAT_COMPLETION_RESPONSE,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue