From ddc31c4810885b76d7e11012e05138541415af23 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Tue, 2 Jan 2024 12:06:03 +0530 Subject: [PATCH] (feat) proxy - use user_config for /chat/compeltions --- litellm/proxy/proxy_server.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 31e13ac19..8e6904cd2 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -1262,6 +1262,11 @@ async def chat_completion( # skip router if user passed their key if "api_key" in data: response = await litellm.acompletion(**data) + elif "user_config" in data: + # initialize a new router instance. make request using this Router + router_config = data.pop("user_config") + user_router = litellm.Router(**router_config) + response = await user_router.acompletion(**data) elif ( llm_router is not None and data["model"] in router_model_names ): # model in router model list