forked from phoenix/litellm-mirror
check if using tag based routing
This commit is contained in:
parent
08adda7091
commit
f3e0a89597
1 changed files with 12 additions and 2 deletions
|
@ -75,7 +75,7 @@ async def add_litellm_data_to_request(
|
|||
dict: The modified data dictionary.
|
||||
|
||||
"""
|
||||
from litellm.proxy.proxy_server import premium_user
|
||||
from litellm.proxy.proxy_server import llm_router, premium_user
|
||||
|
||||
safe_add_api_version_from_query_params(data, request)
|
||||
|
||||
|
@ -166,7 +166,8 @@ async def add_litellm_data_to_request(
|
|||
if user_api_key_dict.allowed_model_region is not None:
|
||||
data["allowed_model_region"] = user_api_key_dict.allowed_model_region
|
||||
|
||||
## [Enterprise Only] Add User-IP Address
|
||||
## [Enterprise Only]
|
||||
# Add User-IP Address
|
||||
requester_ip_address = ""
|
||||
if premium_user is True:
|
||||
# Only set the IP Address for Enterprise Users
|
||||
|
@ -179,6 +180,15 @@ async def add_litellm_data_to_request(
|
|||
requester_ip_address = request.client.host
|
||||
data[_metadata_variable_name]["requester_ip_address"] = requester_ip_address
|
||||
|
||||
# Enterprise Only - Check if using tag based routing
|
||||
if llm_router and llm_router.enable_tag_filtering is True:
|
||||
if premium_user is not True:
|
||||
verbose_proxy_logger.warning(
|
||||
"router.enable_tag_filtering is on %s \n switched off router.enable_tag_filtering",
|
||||
CommonProxyErrors.not_premium_user.value,
|
||||
)
|
||||
llm_router.enable_tag_filtering = False
|
||||
|
||||
### TEAM-SPECIFIC PARAMS ###
|
||||
if user_api_key_dict.team_id is not None:
|
||||
team_config = await proxy_config.load_team_config(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue