From 438b2854511e55989830fb8a4e07c59e1321ad70 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Sat, 28 Oct 2023 13:18:34 -0700 Subject: [PATCH] build(litellm_server/main.py): add support for proxying azure endpoint --- litellm_server/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/litellm_server/main.py b/litellm_server/main.py index 76eab9ead26..7bbe408d7ab 100644 --- a/litellm_server/main.py +++ b/litellm_server/main.py @@ -94,10 +94,13 @@ async def embedding(request: Request): @router.post("/v1/chat/completions") @router.post("/chat/completions") -async def chat_completion(request: Request): +@router.post("/openai/deployments/{model}/chat/completions") # azure compatible endpoint +async def chat_completion(request: Request, model: Optional[str] = None): global llm_model_list try: data = await request.json() + if model: + data["model"] = model ## CHECK KEYS ## # default to always using the "ENV" variables, only if AUTH_STRATEGY==DYNAMIC then reads headers env_validation = litellm.validate_environment(model=data["model"])