Update proxy_server.py (#17468)

Co-authored-by: razvan9991 <57962056+razvan9991@users.noreply.github.com>
This commit is contained in:
razvan_butnaru 2025-12-12 14:34:43 +02:00 committed by GitHub
parent 5df701d15c
commit f6251efab9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5313,7 +5313,7 @@ async def embeddings( # noqa: PLR0915
# check if provider accept list of tokens as input - e.g. for langchain integration
if llm_router is not None and data.get("model") in router_model_names:
# Use router's O(1) lookup instead of O(N) iteration through llm_model_list
deployment = llm_router.get_deployment(model_id=data["model"])
deployment = llm_router.get_deployment_by_model_group_name(model_group_name=data["model"])
if deployment is not None:
litellm_params = deployment.get("litellm_params", {}) or {}
litellm_model = litellm_params.get("model", "")