forked from phoenix/litellm-mirror
(feat) proxy - use user_config for /chat/compeltions
This commit is contained in:
parent
a37a18ca80
commit
ddc31c4810
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue