From 788efea7b3f137de91848feb67a2cad473a874fb Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Fri, 4 Sep 2026 16:25:15 +0000 Subject: [PATCH 1/3] fix(fireworks_ai): resolve tool_choice/reasoning support for short model names Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/llms/fireworks_ai/chat/transformation.py | 5 ++--- .../chat/test_fireworks_ai_chat_transformation.py | 11 +++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/litellm/llms/fireworks_ai/chat/transformation.py b/litellm/llms/fireworks_ai/chat/transformation.py index b6a5ee40672..b9c81a93730 100644 --- a/litellm/llms/fireworks_ai/chat/transformation.py +++ b/litellm/llms/fireworks_ai/chat/transformation.py @@ -32,7 +32,6 @@ from litellm.utils import ( get_model_cost_mutation_generation, supports_function_calling, supports_reasoning, - supports_tool_choice, ) from ...openai.chat.gpt_transformation import ( @@ -272,11 +271,11 @@ class FireworksAIConfig(FireworksAIMixin, OpenAIGPTConfig): ) # 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"): supported_params.append("reasoning_effort") supported_params.append("reasoning_history") supported_params.append("thinking") diff --git a/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py b/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py index ec8725db5f7..672d47a2c03 100644 --- a/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py +++ b/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py @@ -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, ): From 2f1da035ae7fa578b4ed76933fc43ec0248f1a0b Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Fri, 4 Sep 2026 17:06:01 +0000 Subject: [PATCH 2/3] fix(fireworks_ai): keep generic capability fallback for reasoning and tool_choice Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/llms/fireworks_ai/chat/transformation.py | 9 +++++++-- .../chat/test_fireworks_ai_chat_transformation.py | 14 +++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/litellm/llms/fireworks_ai/chat/transformation.py b/litellm/llms/fireworks_ai/chat/transformation.py index b9c81a93730..6aa6a3600f0 100644 --- a/litellm/llms/fireworks_ai/chat/transformation.py +++ b/litellm/llms/fireworks_ai/chat/transformation.py @@ -32,6 +32,7 @@ from litellm.utils import ( get_model_cost_mutation_generation, supports_function_calling, supports_reasoning, + supports_tool_choice, ) from ...openai.chat.gpt_transformation import ( @@ -271,11 +272,15 @@ class FireworksAIConfig(FireworksAIMixin, OpenAIGPTConfig): ) # Only add tool_choice for models that explicitly support it - if self._get_model_cost_capability_exact(model=model, capability="supports_tool_choice"): + 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 self._get_model_cost_capability_exact(model=model, capability="supports_reasoning"): + 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") diff --git a/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py b/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py index 672d47a2c03..e6fe01be4ba 100644 --- a/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py +++ b/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py @@ -4,11 +4,9 @@ from unittest.mock import MagicMock, patch 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, @@ -374,6 +372,16 @@ def test_get_supported_openai_params_short_model_name_resolves_account_prefixed_ 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, ): From dad1b132258edf500597b47dcfb0ddecf9b76fa7 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Fri, 4 Sep 2026 17:07:59 +0000 Subject: [PATCH 3/3] style(fireworks_ai): format capability fallback Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/llms/fireworks_ai/chat/transformation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/litellm/llms/fireworks_ai/chat/transformation.py b/litellm/llms/fireworks_ai/chat/transformation.py index 6aa6a3600f0..26ad9a02a79 100644 --- a/litellm/llms/fireworks_ai/chat/transformation.py +++ b/litellm/llms/fireworks_ai/chat/transformation.py @@ -278,9 +278,9 @@ class FireworksAIConfig(FireworksAIMixin, OpenAIGPTConfig): supported_params.append("tool_choice") # Only add reasoning params for models that support it - if self._get_model_cost_capability_exact( - model=model, capability="supports_reasoning" - ) or 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")