@@ -1291,6 +1291,7 @@ def deploy(
12911291 reservation_affinity_values : Optional [List [str ]] = None ,
12921292 spot : bool = False ,
12931293 fast_tryout_enabled : bool = False ,
1294+ system_labels : Optional [Dict [str , str ]] = None ,
12941295 ) -> None :
12951296 """Deploys a Model to the Endpoint.
12961297
@@ -1403,6 +1404,9 @@ def deploy(
14031404 If True, model will be deployed using faster deployment path.
14041405 Useful for quick experiments. Not for production workloads. Only
14051406 available for most popular models with certain machine types.
1407+ system_labels (Dict[str, str]):
1408+ Optional. System labels to apply to Model Garden deployments.
1409+ System labels are managed by Google for internal use only.
14061410 """
14071411 self ._sync_gca_resource_if_skipped ()
14081412
@@ -1447,6 +1451,7 @@ def deploy(
14471451 disable_container_logging = disable_container_logging ,
14481452 deployment_resource_pool = deployment_resource_pool ,
14491453 fast_tryout_enabled = fast_tryout_enabled ,
1454+ system_labels = system_labels ,
14501455 )
14511456
14521457 @base .optional_sync ()
@@ -1477,6 +1482,7 @@ def _deploy(
14771482 disable_container_logging : bool = False ,
14781483 deployment_resource_pool : Optional [DeploymentResourcePool ] = None ,
14791484 fast_tryout_enabled : bool = False ,
1485+ system_labels : Optional [Dict [str , str ]] = None ,
14801486 ) -> None :
14811487 """Deploys a Model to the Endpoint.
14821488
@@ -1583,6 +1589,9 @@ def _deploy(
15831589 If True, model will be deployed using faster deployment path.
15841590 Useful for quick experiments. Not for production workloads. Only
15851591 available for most popular models with certain machine types.
1592+ system_labels (Dict[str, str]):
1593+ Optional. System labels to apply to Model Garden deployments.
1594+ System labels are managed by Google for internal use only.
15861595 """
15871596 _LOGGER .log_action_start_against_resource (
15881597 f"Deploying Model { model .resource_name } to" , "" , self
@@ -1617,6 +1626,7 @@ def _deploy(
16171626 disable_container_logging = disable_container_logging ,
16181627 deployment_resource_pool = deployment_resource_pool ,
16191628 fast_tryout_enabled = fast_tryout_enabled ,
1629+ system_labels = system_labels ,
16201630 )
16211631
16221632 _LOGGER .log_action_completed_against_resource ("model" , "deployed" , self )
@@ -1654,6 +1664,7 @@ def _deploy_call(
16541664 disable_container_logging : bool = False ,
16551665 deployment_resource_pool : Optional [DeploymentResourcePool ] = None ,
16561666 fast_tryout_enabled : bool = False ,
1667+ system_labels : Optional [Dict [str , str ]] = None ,
16571668 ) -> None :
16581669 """Helper method to deploy model to endpoint.
16591670
@@ -1767,6 +1778,9 @@ def _deploy_call(
17671778 If True, model will be deployed using faster deployment path.
17681779 Useful for quick experiments. Not for production workloads. Only
17691780 available for most popular models with certain machine types.
1781+ system_labels (Dict[str, str]):
1782+ Optional. System labels to apply to Model Garden deployments.
1783+ System labels are managed by Google for internal use only.
17701784
17711785 Raises:
17721786 ValueError: If only `accelerator_type` or `accelerator_count` is specified.
@@ -1788,6 +1802,9 @@ def _deploy_call(
17881802 disable_container_logging = disable_container_logging ,
17891803 )
17901804
1805+ if system_labels :
1806+ deployed_model .system_labels = system_labels
1807+
17911808 supports_shared_resources = (
17921809 gca_model_compat .Model .DeploymentResourcesType .SHARED_RESOURCES
17931810 in model .supported_deployment_resources_types
@@ -1847,6 +1864,9 @@ def _deploy_call(
18471864 disable_container_logging = disable_container_logging ,
18481865 )
18491866
1867+ if system_labels :
1868+ deployed_model .system_labels = system_labels
1869+
18501870 supports_automatic_resources = (
18511871 gca_model_compat .Model .DeploymentResourcesType .AUTOMATIC_RESOURCES
18521872 in model .supported_deployment_resources_types
@@ -3911,6 +3931,7 @@ def deploy(
39113931 reservation_affinity_key : Optional [str ] = None ,
39123932 reservation_affinity_values : Optional [List [str ]] = None ,
39133933 spot : bool = False ,
3934+ system_labels : Optional [Dict [str , str ]] = None ,
39143935 ) -> None :
39153936 """Deploys a Model to the PrivateEndpoint.
39163937
@@ -4026,6 +4047,9 @@ def deploy(
40264047 Format: 'projects/{project_id_or_number}/zones/{zone}/reservations/{reservation_name}'
40274048 spot (bool):
40284049 Optional. Whether to schedule the deployment workload on spot VMs.
4050+ system_labels (Dict[str, str]):
4051+ Optional. System labels to apply to Model Garden deployments.
4052+ System labels are managed by Google for internal use only.
40294053 """
40304054
40314055 if self .network :
@@ -4070,6 +4094,7 @@ def deploy(
40704094 sync = sync ,
40714095 spot = spot ,
40724096 disable_container_logging = disable_container_logging ,
4097+ system_labels = system_labels ,
40734098 )
40744099
40754100 def update (
@@ -5133,6 +5158,7 @@ def deploy(
51335158 reservation_affinity_values : Optional [List [str ]] = None ,
51345159 spot : bool = False ,
51355160 fast_tryout_enabled : bool = False ,
5161+ system_labels : Optional [Dict [str , str ]] = None ,
51365162 ) -> Union [Endpoint , PrivateEndpoint ]:
51375163 """Deploys model to endpoint. Endpoint will be created if unspecified.
51385164
@@ -5267,6 +5293,9 @@ def deploy(
52675293 If True, model will be deployed using faster deployment path.
52685294 Useful for quick experiments. Not for production workloads. Only
52695295 available for most popular models with certain machine types.
5296+ system_labels (Dict[str, str]):
5297+ Optional. System labels to apply to Model Garden deployments.
5298+ System labels are managed by Google for internal use only.
52705299
52715300 Returns:
52725301 endpoint (Union[Endpoint, PrivateEndpoint]):
@@ -5336,6 +5365,7 @@ def deploy(
53365365 private_service_connect_config = private_service_connect_config ,
53375366 deployment_resource_pool = deployment_resource_pool ,
53385367 fast_tryout_enabled = fast_tryout_enabled ,
5368+ system_labels = system_labels ,
53395369 )
53405370
53415371 @base .optional_sync (return_input_arg = "endpoint" , bind_future_to_self = False )
@@ -5371,6 +5401,7 @@ def _deploy(
53715401 ] = None ,
53725402 deployment_resource_pool : Optional [DeploymentResourcePool ] = None ,
53735403 fast_tryout_enabled : bool = False ,
5404+ system_labels : Optional [Dict [str , str ]] = None ,
53745405 ) -> Union [Endpoint , PrivateEndpoint ]:
53755406 """Deploys model to endpoint. Endpoint will be created if unspecified.
53765407
@@ -5498,6 +5529,9 @@ def _deploy(
54985529 If True, model will be deployed using faster deployment path.
54995530 Useful for quick experiments. Not for production workloads. Only
55005531 available for most popular models with certain machine types.
5532+ system_labels (Dict[str, str]):
5533+ Optional. System labels to apply to Model Garden deployments.
5534+ System labels are managed by Google for internal use only.
55015535
55025536 Returns:
55035537 endpoint (Union[Endpoint, PrivateEndpoint]):
@@ -5557,6 +5591,7 @@ def _deploy(
55575591 disable_container_logging = disable_container_logging ,
55585592 deployment_resource_pool = deployment_resource_pool ,
55595593 fast_tryout_enabled = fast_tryout_enabled ,
5594+ system_labels = system_labels ,
55605595 )
55615596
55625597 _LOGGER .log_action_completed_against_resource ("model" , "deployed" , endpoint )
0 commit comments