forked from phoenix/litellm-mirror
check if using tag based routing
This commit is contained in:
parent
52d0f6a808
commit
1ab5c1a227
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.
|
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)
|
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:
|
if user_api_key_dict.allowed_model_region is not None:
|
||||||
data["allowed_model_region"] = user_api_key_dict.allowed_model_region
|
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 = ""
|
requester_ip_address = ""
|
||||||
if premium_user is True:
|
if premium_user is True:
|
||||||
# Only set the IP Address for Enterprise Users
|
# 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
|
requester_ip_address = request.client.host
|
||||||
data[_metadata_variable_name]["requester_ip_address"] = requester_ip_address
|
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 ###
|
### TEAM-SPECIFIC PARAMS ###
|
||||||
if user_api_key_dict.team_id is not None:
|
if user_api_key_dict.team_id is not None:
|
||||||
team_config = await proxy_config.load_team_config(
|
team_config = await proxy_config.load_team_config(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue