Skip to content

Commit 2824388

Browse files
authored
Don't add "accounts/fireworks/models" prefix for Fireworks Provider (BerriAI#15938)
* init * if not model.startswith("accounts/") and "#" not in model:
1 parent 689b210 commit 2824388

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

litellm/llms/fireworks_ai/chat/transformation.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import json
2-
from litellm._uuid import uuid
32
from typing import Any, List, Literal, Optional, Tuple, Union, cast
43

54
import httpx
65

76
import litellm
7+
from litellm._uuid import uuid
88
from litellm.constants import RESPONSE_FORMAT_TOOL_NAME
99
from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj
1010
from litellm.litellm_core_utils.llm_response_utils.get_headers import (
@@ -102,15 +102,15 @@ def get_supported_openai_params(self, model: str):
102102
"prompt_truncate_length",
103103
"context_length_exceeded_behavior",
104104
]
105-
105+
106106
# Only add tools for models that support function calling
107107
if supports_function_calling(model=model, custom_llm_provider="fireworks_ai"):
108108
supported_params.append("tools")
109-
109+
110110
# Only add tool_choice for models that explicitly support it
111111
if supports_tool_choice(model=model, custom_llm_provider="fireworks_ai"):
112112
supported_params.append("tool_choice")
113-
113+
114114
return supported_params
115115

116116
def map_openai_params(
@@ -246,7 +246,7 @@ def transform_request(
246246
litellm_params: dict,
247247
headers: dict,
248248
) -> dict:
249-
if not model.startswith("accounts/"):
249+
if not model.startswith("accounts/") and "#" not in model:
250250
model = f"accounts/fireworks/models/{model}"
251251
messages = self._transform_messages_helper(
252252
messages=messages, model=model, litellm_params=litellm_params

litellm/llms/fireworks_ai/completion/transformation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def transform_text_completion_request(
5050
) -> dict:
5151
prompt = _transform_prompt(messages=messages)
5252

53-
if not model.startswith("accounts/"):
53+
if not model.startswith("accounts/") and "#" not in model:
5454
model = f"accounts/fireworks/models/{model}"
5555

5656
data = {

0 commit comments

Comments
 (0)