From 2824388c30ede1c2c01d0b64633a000c5f439876 Mon Sep 17 00:00:00 2001 From: 1stprinciple Date: Fri, 31 Oct 2025 04:36:42 +0100 Subject: [PATCH] Don't add "accounts/fireworks/models" prefix for Fireworks Provider (#15938) * init * if not model.startswith("accounts/") and "#" not in model: --- litellm/llms/fireworks_ai/chat/transformation.py | 10 +++++----- litellm/llms/fireworks_ai/completion/transformation.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/litellm/llms/fireworks_ai/chat/transformation.py b/litellm/llms/fireworks_ai/chat/transformation.py index 524b1c97145..a65eaf38845 100644 --- a/litellm/llms/fireworks_ai/chat/transformation.py +++ b/litellm/llms/fireworks_ai/chat/transformation.py @@ -1,10 +1,10 @@ import json -from litellm._uuid import uuid from typing import Any, List, Literal, Optional, Tuple, Union, cast import httpx import litellm +from litellm._uuid import uuid from litellm.constants import RESPONSE_FORMAT_TOOL_NAME from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj from litellm.litellm_core_utils.llm_response_utils.get_headers import ( @@ -102,15 +102,15 @@ class FireworksAIConfig(OpenAIGPTConfig): "prompt_truncate_length", "context_length_exceeded_behavior", ] - + # Only add tools for models that support function calling if supports_function_calling(model=model, custom_llm_provider="fireworks_ai"): supported_params.append("tools") - + # Only add tool_choice for models that explicitly support it if supports_tool_choice(model=model, custom_llm_provider="fireworks_ai"): supported_params.append("tool_choice") - + return supported_params def map_openai_params( @@ -246,7 +246,7 @@ class FireworksAIConfig(OpenAIGPTConfig): litellm_params: dict, headers: dict, ) -> dict: - if not model.startswith("accounts/"): + if not model.startswith("accounts/") and "#" not in model: model = f"accounts/fireworks/models/{model}" messages = self._transform_messages_helper( messages=messages, model=model, litellm_params=litellm_params diff --git a/litellm/llms/fireworks_ai/completion/transformation.py b/litellm/llms/fireworks_ai/completion/transformation.py index 607e709c425..3ac77288c70 100644 --- a/litellm/llms/fireworks_ai/completion/transformation.py +++ b/litellm/llms/fireworks_ai/completion/transformation.py @@ -50,7 +50,7 @@ class FireworksAITextCompletionConfig(FireworksAIMixin, BaseTextCompletionConfig ) -> dict: prompt = _transform_prompt(messages=messages) - if not model.startswith("accounts/"): + if not model.startswith("accounts/") and "#" not in model: model = f"accounts/fireworks/models/{model}" data = {