Merge pull request #3663 from msabramo/msabramo/allow-non-admins-to-use-openai-routes

Allow non-admins to use `/engines/{model}/chat/completions`
This commit is contained in:
Krish Dholakia 2024-05-16 12:17:50 -07:00 committed by GitHub
commit ea976d8c30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 58 additions and 3 deletions

View file

@ -1076,6 +1076,8 @@ async def user_api_key_auth(
if not _is_user_proxy_admin(user_id_information): # if non-admin
if route in LiteLLMRoutes.openai_routes.value:
pass
elif request['route'].name in LiteLLMRoutes.openai_route_names.value:
pass
elif (
route in LiteLLMRoutes.info_routes.value
): # check if user allowed to call an info route