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]

refactor(fireworks): name the Foundry deployment id prefix instead of commenting it

mateo-berri8dc8cae0ec14
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}"