Merge pull request #4043 from BerriAI/litellm_enforce_params

[Feat] Enterprise - Enforce Params in request to LiteLLM Proxy
This commit is contained in:
Ishaan Jaff 2024-06-07 08:52:46 -07:00 committed by GitHub
commit 7b1047bd1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 204 additions and 1 deletions

View file

@ -2878,6 +2878,16 @@ class ProxyConfig:
)
health_check_interval = general_settings.get("health_check_interval", 300)
## check if user has set a premium feature in general_settings
if (
general_settings.get("enforced_params") is not None
and premium_user is not True
):
raise ValueError(
"Trying to use `enforced_params`"
+ CommonProxyErrors.not_premium_user.value
)
router_params: dict = {
"cache_responses": litellm.cache
!= None, # cache if user passed in cache values