mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(router.py): speed improvements to the router
This commit is contained in:
parent
8560794963
commit
04f745e314
4 changed files with 92 additions and 5 deletions
|
@ -178,7 +178,7 @@ async def acompletion(*args, **kwargs):
|
|||
response = completion(*args, **kwargs)
|
||||
else:
|
||||
# Await normally
|
||||
init_response = completion(*args, **kwargs)
|
||||
init_response = await loop.run_in_executor(None, func_with_context)
|
||||
if isinstance(init_response, dict) or isinstance(init_response, ModelResponse): ## CACHING SCENARIO
|
||||
response = init_response
|
||||
elif asyncio.iscoroutine(init_response):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue