[Chore-Proxy] enforce jwt auth as enterprise feature (#5770)

* enforce prometheus as enterprise feature

* show correct error on prometheus metric when not enrterprise user

* docs promethues metrics enforced

* docs enforce JWT auth

* enforce JWT auth as enterprise feature

* fix merge conflicts
This commit is contained in:
Ishaan Jaff 2024-09-18 16:28:37 -07:00 committed by GitHub
parent 9fff5f3da8
commit 707d654a85
3 changed files with 12 additions and 8 deletions

View file

@ -7,11 +7,15 @@ Use JWT's to auth admins / projects into the proxy.
:::info
This is a new feature, and subject to changes based on feedback.
✨ JWT-based Auth is on LiteLLM Enterprise starting at $250/mo
[Enterprise Pricing](https://www.litellm.ai/#pricing)
[Contact us here to get a free trial](https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat)
*UPDATE*: This will be moving to the [enterprise tier](./enterprise.md), once it's out of beta (~by end of April).
:::
## Usage
### Step 1. Setup Proxy

View file

@ -218,6 +218,12 @@ async def user_api_key_auth(
return await handle_oauth2_proxy_request(request=request)
if general_settings.get("enable_jwt_auth", False) is True:
from litellm.proxy.proxy_server import premium_user
if premium_user is not True:
raise ValueError(
f"JWT Auth is an enterprise only feature. {CommonProxyErrors.not_premium_user.value}"
)
is_jwt = jwt_handler.is_jwt(token=api_key)
verbose_proxy_logger.debug("is_jwt: %s", is_jwt)
if is_jwt:

View file

@ -6,9 +6,3 @@ model_list:
api_base: https://exampleopenaiendpoint-production.up.railway.app
litellm_settings:
success_callback: ["gcs_bucket"]