Skip to content
Merged
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
8 changes: 6 additions & 2 deletions litellm/llms/fireworks_ai/chat/transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,15 @@ 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"
) or supports_tool_choice(model=model, custom_llm_provider="fireworks_ai"):
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") or supports_reasoning(
model=model, custom_llm_provider="fireworks_ai"
):
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 @@ -4,11 +4,9 @@
import pytest

import litellm


from litellm import get_model_info, supports_reasoning, supports_vision
from litellm.llms.fireworks_ai.chat.transformation import FireworksAIConfig
from litellm.constants import SESSION_ID_GENERATED_METADATA_KEY
from litellm.llms.fireworks_ai.chat.transformation import FireworksAIConfig
from litellm.llms.fireworks_ai.common_utils import get_fireworks_session_id
from litellm.types.utils import (
ChatCompletionMessageToolCall,
Expand Down Expand Up @@ -363,6 +361,27 @@ 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_preserves_generic_reasoning_fallback():
config = FireworksAIConfig()

supported_params = config.get_supported_openai_params(
"fireworks_ai/accounts/fireworks/models/glm-5p3-flash"
)

assert "reasoning_effort" in supported_params


def test_get_supported_openai_params_parallel_tool_calls_without_tool_choice(
monkeypatch,
):
Expand Down
Loading