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]

fix(fireworks): skip accounts/ rewrite for FW-* Foundry deployment ids

Bruno Felthesdc54b16d3c84
diff --git a/litellm/llms/fireworks_ai/common_utils.py b/litellm/llms/fireworks_ai/common_utils.py
index e07e7a26f9e..522c955770c 100644
--- a/litellm/llms/fireworks_ai/common_utils.py
+++ b/litellm/llms/fireworks_ai/common_utils.py
@@ -33,6 +33,11 @@ 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-"):
+ return stripped
if stripped.startswith(("routers/", "models/")):
return f"accounts/fireworks/{stripped}"
if stripped.endswith("-fast"):
diff --git a/tests/test_litellm/llms/fireworks_ai/test_fireworks_ai_common_utils.py b/tests/test_litellm/llms/fireworks_ai/test_fireworks_ai_common_utils.py
index 4af395baf41..b52c910d5a6 100644
--- a/tests/test_litellm/llms/fireworks_ai/test_fireworks_ai_common_utils.py
+++ b/tests/test_litellm/llms/fireworks_ai/test_fireworks_ai_common_utils.py
@@ -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):