mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 02:34:29 +00:00
feat(router.py): enable passing chat completion params for Router.chat.completion.create
This commit is contained in:
parent
95f9c6779d
commit
03303033e5
2 changed files with 58 additions and 31 deletions
|
@ -34,6 +34,7 @@ class Router:
|
|||
cache_responses: bool = False,
|
||||
num_retries: Optional[int] = None,
|
||||
timeout: float = 600,
|
||||
chat_completion_params = {}, # default params for Router.chat.completion.create
|
||||
routing_strategy: Literal["simple-shuffle", "least-busy"] = "simple-shuffle") -> None:
|
||||
|
||||
if model_list:
|
||||
|
@ -42,6 +43,8 @@ class Router:
|
|||
|
||||
if num_retries:
|
||||
self.num_retries = num_retries
|
||||
|
||||
self.chat = litellm.Chat(params=chat_completion_params)
|
||||
|
||||
litellm.request_timeout = timeout
|
||||
self.routing_strategy = routing_strategy
|
||||
|
@ -65,7 +68,6 @@ class Router:
|
|||
litellm.cache = litellm.Cache(**cache_config) # use Redis for caching completion requests
|
||||
self.cache_responses = cache_responses
|
||||
|
||||
self.chat = litellm.Chat(params={})
|
||||
|
||||
|
||||
def _start_health_check_thread(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue