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:
Mateo Wang 2026-08-18 14:09:49 -07:00 committed by GitHub
commit 840c5f680d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View file

@ -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}"

View file

@ -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):