From 8dc8cae0ec1482b635b369484455e52f5237c098 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Tue, 18 Aug 2026 13:17:44 -0700 Subject: [PATCH] refactor(fireworks): name the Foundry deployment id prefix instead of commenting it --- litellm/llms/fireworks_ai/common_utils.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/litellm/llms/fireworks_ai/common_utils.py b/litellm/llms/fireworks_ai/common_utils.py index 522c955770c..8e35cfebc5b 100644 --- a/litellm/llms/fireworks_ai/common_utils.py +++ b/litellm/llms/fireworks_ai/common_utils.py @@ -29,14 +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: - return stripped - # Azure AI Foundry (and similar OpenAI-compat hosts) expose Fireworks - # deployments as ids like ``FW-Kimi-K3``. Rewriting those to - # ``accounts/fireworks/models/FW-…`` yields DeploymentNotFound. - if stripped.startswith("FW-"): + 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}"