mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-28 04:04:31 +00:00
Merge pull request #2729 from BerriAI/litellm_show_better_error_msg_with_role
(fix) show user their role when rejecting /team/new requests
This commit is contained in:
commit
efa57bb7a7
2 changed files with 14 additions and 6 deletions
|
@ -47,8 +47,9 @@ Your Proxy Swagger is available on the root of the Proxy: e.g.: `http://localhos
|
||||||
Set the following in your .env on the Proxy
|
Set the following in your .env on the Proxy
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
UI_USERNAME=ishaan-litellm
|
LITELLM_MASTER_KEY="sk-1234" # this is your master key for using the proxy server
|
||||||
UI_PASSWORD=langchain
|
UI_USERNAME=ishaan-litellm # username to sign in on UI
|
||||||
|
UI_PASSWORD=langchain # password to sign in on UI
|
||||||
```
|
```
|
||||||
|
|
||||||
On accessing the LiteLLM UI, you will be prompted to enter your username, password
|
On accessing the LiteLLM UI, you will be prompted to enter your username, password
|
||||||
|
|
|
@ -5681,7 +5681,7 @@ async def new_team(
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=400,
|
status_code=400,
|
||||||
detail={
|
detail={
|
||||||
"error": f"tpm limit higher than user max. User tpm limit={user_api_key_dict.tpm_limit}"
|
"error": f"tpm limit higher than user max. User tpm limit={user_api_key_dict.tpm_limit}. User role={user_api_key_dict.user_role}"
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -5693,7 +5693,7 @@ async def new_team(
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=400,
|
status_code=400,
|
||||||
detail={
|
detail={
|
||||||
"error": f"rpm limit higher than user max. User rpm limit={user_api_key_dict.rpm_limit}"
|
"error": f"rpm limit higher than user max. User rpm limit={user_api_key_dict.rpm_limit}. User role={user_api_key_dict.user_role}"
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -5705,7 +5705,7 @@ async def new_team(
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=400,
|
status_code=400,
|
||||||
detail={
|
detail={
|
||||||
"error": f"max budget higher than user max. User max budget={user_api_key_dict.max_budget}"
|
"error": f"max budget higher than user max. User max budget={user_api_key_dict.max_budget}. User role={user_api_key_dict.user_role}"
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -5715,7 +5715,7 @@ async def new_team(
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=400,
|
status_code=400,
|
||||||
detail={
|
detail={
|
||||||
"error": f"Model not in allowed user models. User allowed models={user_api_key_dict.models}"
|
"error": f"Model not in allowed user models. User allowed models={user_api_key_dict.models}. User id={user_api_key_dict.user_id}"
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -7099,6 +7099,13 @@ async def login(request: Request):
|
||||||
except ImportError:
|
except ImportError:
|
||||||
subprocess.run(["pip", "install", "python-multipart"])
|
subprocess.run(["pip", "install", "python-multipart"])
|
||||||
global master_key
|
global master_key
|
||||||
|
if master_key is None:
|
||||||
|
raise ProxyException(
|
||||||
|
message="Master Key not set for Proxy. Please set Master Key to use Admin UI. Set `LITELLM_MASTER_KEY` in .env or set general_settings:master_key in config.yaml. https://docs.litellm.ai/docs/proxy/virtual_keys. If set, use `--detailed_debug` to debug issue.",
|
||||||
|
type="auth_error",
|
||||||
|
param="master_key",
|
||||||
|
code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||||
|
)
|
||||||
form = await request.form()
|
form = await request.form()
|
||||||
username = str(form.get("username"))
|
username = str(form.get("username"))
|
||||||
password = str(form.get("password"))
|
password = str(form.get("password"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue