mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 19:54:13 +00:00
(feat) proxy - use user_config for /chat/compeltions
This commit is contained in:
parent
01c042fdc6
commit
dc5984c41d
1 changed files with 5 additions and 0 deletions
|
@ -1262,6 +1262,11 @@ async def chat_completion(
|
||||||
# skip router if user passed their key
|
# skip router if user passed their key
|
||||||
if "api_key" in data:
|
if "api_key" in data:
|
||||||
response = await litellm.acompletion(**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 (
|
elif (
|
||||||
llm_router is not None and data["model"] in router_model_names
|
llm_router is not None and data["model"] in router_model_names
|
||||||
): # model in router model list
|
): # model in router model list
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue