mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
Merge pull request #37242 from bruno-olivia/litellm_fw_skip_prefix_rewrite
fix(fireworks): skip accounts/ rewrite for FW-* Foundry deployment ids
This commit is contained in:
commit
840c5f680d
2 changed files with 7 additions and 1 deletions
|
|
@ -29,9 +29,12 @@ def get_fireworks_session_id(litellm_params: dict) -> str | None:
|
|||
return None
|
||||
|
||||
|
||||
AZURE_FOUNDRY_FIREWORKS_MODEL_ID_PREFIX: Final = "FW-"
|
||||
|
||||
|
||||
def resolve_fireworks_resource_name(model: str) -> str:
|
||||
stripped: Final = model.removeprefix("fireworks_ai/")
|
||||
if stripped.startswith("accounts/") or "#" in stripped:
|
||||
if stripped.startswith(("accounts/", AZURE_FOUNDRY_FIREWORKS_MODEL_ID_PREFIX)) or "#" in stripped:
|
||||
return stripped
|
||||
if stripped.startswith(("routers/", "models/")):
|
||||
return f"accounts/fireworks/{stripped}"
|
||||
|
|
|
|||
|
|
@ -39,6 +39,9 @@ from litellm.llms.fireworks_ai.common_utils import resolve_fireworks_resource_na
|
|||
"glm-4p6#accounts/gitlab/deployments/2fb7764c",
|
||||
"glm-4p6#accounts/gitlab/deployments/2fb7764c",
|
||||
),
|
||||
("FW-Kimi-K3", "FW-Kimi-K3"),
|
||||
("fireworks_ai/FW-Kimi-K3", "FW-Kimi-K3"),
|
||||
("FW-GLM-5.2-Fast", "FW-GLM-5.2-Fast"),
|
||||
],
|
||||
)
|
||||
def test_resolve_fireworks_resource_name(model, expected):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue