mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
refactor(fireworks): name the Foundry deployment id prefix instead of commenting it
This commit is contained in:
parent
dc54b16d3c
commit
8dc8cae0ec
1 changed files with 4 additions and 6 deletions
|
|
@ -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}"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue