Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 2 additions & 3 deletions litellm/llms/fireworks_ai/chat/transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
get_model_cost_mutation_generation,
supports_function_calling,
supports_reasoning,
supports_tool_choice,
)

from ...openai.chat.gpt_transformation import (
Expand Down Expand Up @@ -272,11 +271,11 @@ def get_supported_openai_params(self, model: str):
)

# Only add tool_choice for models that explicitly support it
if supports_tool_choice(model=model, custom_llm_provider="fireworks_ai"):
if self._get_model_cost_capability_exact(model=model, capability="supports_tool_choice"):
supported_params.append("tool_choice")

# Only add reasoning params for models that support it
if supports_reasoning(model=model, custom_llm_provider="fireworks_ai"):
if self._get_model_cost_capability_exact(model=model, capability="supports_reasoning"):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Custom reasoning parameters get rejected

Custom model names matching known reasoning models now fail _get_model_cost_capability_exact. Their reasoning parameters are rejected or silently dropped instead of reaching Fireworks.

Prompt for agents
Restore reasoning capability handling for custom and suffixed Fireworks model names while preserving short-name resolution. In litellm/llms/fireworks_ai/chat/transformation.py, the old supports_reasoning call could obtain supports_reasoning from FireworksAIConfig.get_provider_info, which uses _get_model_cost_capability's hyphen-boundary fallback. The replacement uses only _get_model_cost_capability_exact, so names such as accounts/myorg/models/custom-glm-5p1 no longer advertise reasoning parameters. Choose a lookup that resolves default-account short names without removing the prior fuzzy reasoning support, and add a regression test for a custom or suffixed reasoning model.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

supported_params.append("reasoning_effort")
supported_params.append("reasoning_history")
supported_params.append("thinking")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,17 @@ def test_get_supported_openai_params_parallel_tool_calls():
assert "parallel_tool_calls" not in unsupported_params


def test_get_supported_openai_params_short_model_name_resolves_account_prefixed_entry():
config = FireworksAIConfig()

supported_params = config.get_supported_openai_params(
"fireworks_ai/deepseek-v4-pro-0813"
)

assert "tool_choice" in supported_params
assert "reasoning_effort" in supported_params


def test_get_supported_openai_params_parallel_tool_calls_without_tool_choice(
monkeypatch,
):
Expand Down
Loading