mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
feat - enforce enforced_params as a premium feature
This commit is contained in:
parent
d827557b82
commit
aaf35c7966
2 changed files with 21 additions and 0 deletions
|
@ -98,6 +98,17 @@ def common_checks(
|
|||
f"'user' param not passed in. 'enforce_user_param'={general_settings['enforce_user_param']}"
|
||||
)
|
||||
if general_settings.get("enforced_params", None) is not None:
|
||||
# Enterprise ONLY Feature
|
||||
# we already validate if user is premium_user when reading the config
|
||||
# Add an extra premium_usercheck here too, just incase
|
||||
from litellm.proxy.proxy_server import premium_user, CommonProxyErrors
|
||||
|
||||
if premium_user is not True:
|
||||
raise ValueError(
|
||||
"Trying to use `enforced_params`"
|
||||
+ CommonProxyErrors.not_premium_user.value
|
||||
)
|
||||
|
||||
if route in LiteLLMRoutes.openai_routes.value:
|
||||
# loop through each enforced param
|
||||
# example enforced_params ['user', 'metadata', 'metadata.generation_name']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue