Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

Don't add "accounts/fireworks/models" prefix for Fireworks Provider (#15938)

1stprinciple2824388c30ed
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 = {