mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
fix hide - _auto_infer_region behind a feature flag
This commit is contained in:
parent
4244bb8a57
commit
437af37f97
1 changed files with 16 additions and 13 deletions
|
@ -2558,20 +2558,23 @@ class Router:
|
||||||
self.set_client(model=deployment.to_json(exclude_none=True))
|
self.set_client(model=deployment.to_json(exclude_none=True))
|
||||||
|
|
||||||
# set region (if azure model)
|
# set region (if azure model)
|
||||||
# try:
|
_auto_infer_region = os.environ.get("AUTO_INFER_REGION", "true")
|
||||||
# if "azure" in deployment.litellm_params.model:
|
_auto_infer_region_value = bool(_auto_infer_region)
|
||||||
# region = litellm.utils.get_model_region(
|
if _auto_infer_region_value == True:
|
||||||
# litellm_params=deployment.litellm_params, mode=None
|
try:
|
||||||
# )
|
if "azure" in deployment.litellm_params.model:
|
||||||
|
region = litellm.utils.get_model_region(
|
||||||
|
litellm_params=deployment.litellm_params, mode=None
|
||||||
|
)
|
||||||
|
|
||||||
# deployment.litellm_params.region_name = region
|
deployment.litellm_params.region_name = region
|
||||||
# except Exception as e:
|
except Exception as e:
|
||||||
# verbose_router_logger.error(
|
verbose_router_logger.error(
|
||||||
# "Unable to get the region for azure model - {}, {}".format(
|
"Unable to get the region for azure model - {}, {}".format(
|
||||||
# deployment.litellm_params.model, str(e)
|
deployment.litellm_params.model, str(e)
|
||||||
# )
|
)
|
||||||
# )
|
)
|
||||||
# pass # [NON-BLOCKING]
|
pass # [NON-BLOCKING]
|
||||||
|
|
||||||
return deployment
|
return deployment
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue