sagemaker.core.jumpstart.types

Contents

sagemaker.core.jumpstart.types#

This module stores types related to SageMaker JumpStart.

Classes

AdditionalModelDataSource(spec)

Data class of additional model data source mirrors CreateModel API.

BaseDeploymentConfigDataHolder()

Base class for Deployment Config Data.

DeploymentArgs([init_kwargs, deploy_kwargs, ...])

Dataclass representing a Deployment Args.

DeploymentConfigMetadata([config_name, ...])

Dataclass representing a Deployment Config Metadata

HubAccessConfig(spec)

Data class of model access config that mirrors CreateModel API.

HubArnExtractedInfo(partition, region, ...)

Data class for info extracted from Hub arn.

HubContentType(value)

Enum for Hub content objects.

HubType(value)

Enum for Hub objects.

JumpStartAdditionalDataSources(spec)

Data class of additional data sources.

JumpStartBenchmarkStat(spec)

Data class JumpStart benchmark stat.

JumpStartCachedContentKey(data_type, id_info)

Data class for the cached content keys.

JumpStartCachedContentValue(formatted_content)

Data class for the s3 cached content values.

JumpStartConfigComponent(component_name, ...)

Data class of JumpStart config component.

JumpStartConfigRanking(spec[, is_hub_content])

Data class JumpStart config ranking.

JumpStartDataHolderType()

Base class for many JumpStart types.

JumpStartECRSpecs(spec[, is_hub_content])

Data class for JumpStart ECR specs.

JumpStartEnvironmentVariable(spec[, ...])

Data class for JumpStart environment variable definitions in the hosting container.

JumpStartEstimatorDeployKwargs(model_id[, ...])

Data class for the inputs to JumpStartEstimator.deploy method.

JumpStartEstimatorFitKwargs(model_id[, ...])

Data class for the inputs to JumpStartEstimator.fit method.

JumpStartEstimatorInitKwargs(model_id[, ...])

Data class for the inputs to JumpStartEstimator.__init__ method.

JumpStartHyperparameter(spec[, is_hub_content])

Data class for JumpStart hyperparameter definition in the training container.

JumpStartInstanceTypeVariants(spec[, ...])

Data class for JumpStart instance type variants.

JumpStartKwargs()

Data class for JumpStart object kwargs.

JumpStartLaunchedRegionInfo(content_bucket, ...)

Data class for launched region info.

JumpStartMetadataBaseFields(fields[, ...])

Data class JumpStart metadata base fields that can be overridden.

JumpStartMetadataConfig(config_name, config, ...)

Data class of JumpStart metadata config.

JumpStartMetadataConfigs(configs, ...[, scope])

Data class to hold the set of JumpStart Metadata configs.

JumpStartModelDataSource(spec)

Data class JumpStart additional model data source.

JumpStartModelDeployKwargs(model_id[, ...])

Data class for the inputs to JumpStartModel.deploy method.

JumpStartModelHeader(header)

Data class JumpStart model header.

JumpStartModelInitKwargs(model_id[, ...])

Data class for the inputs to JumpStartModel.__init__ method.

JumpStartModelRegisterKwargs(model_id[, ...])

Data class for the inputs to JumpStartEstimator.deploy method.

JumpStartModelSpecs(spec[, is_hub_content])

Data class JumpStart model specs.

JumpStartPredictorSpecs(spec[, is_hub_content])

Data class for JumpStart Predictor specs.

JumpStartS3FileType(value)

Type of files published in JumpStart S3 distribution buckets.

JumpStartSerializablePayload(spec[, ...])

Data class for JumpStart serialized payload specs.

JumpStartVersionedModelId(model_id, version)

Data class for versioned model IDs.

ModelAccessConfig(spec)

Data class of model access config that mirrors CreateModel API.

S3DataSource(spec)

Data class of S3 data source that mirrors CreateModel API.

class sagemaker.core.jumpstart.types.AdditionalModelDataSource(spec: Dict[str, Any])[source]#

Bases: JumpStartDataHolderType

Data class of additional model data source mirrors CreateModel API.

SERIALIZATION_EXCLUSION_SET = {'provider'}#
channel_name#
from_json(json_obj: Dict[str, Any]) None[source]#

Sets fields in object based on json.

Parameters:

json_obj (Dict[str, Any]) – Dictionary representation of data source.

hosting_eula_key#
s3_data_source#
to_json(exclude_keys=True) Dict[str, Any][source]#

Returns json representation of AdditionalModelDataSource object.

class sagemaker.core.jumpstart.types.BaseDeploymentConfigDataHolder[source]#

Bases: JumpStartDataHolderType

Base class for Deployment Config Data.

to_json() Dict[str, Any][source]#

Represents This object as JSON.

class sagemaker.core.jumpstart.types.DeploymentArgs(init_kwargs: JumpStartModelInitKwargs | None = None, deploy_kwargs: JumpStartModelDeployKwargs | None = None, resolved_config: Dict[str, Any] | None = None)[source]#

Bases: BaseDeploymentConfigDataHolder

Dataclass representing a Deployment Args.

additional_data_sources#
compute_resource_requirements#
container_startup_health_check_timeout#
environment#
image_uri#
instance_type#
model_data#
model_data_download_timeout#
model_package_arn#
class sagemaker.core.jumpstart.types.DeploymentConfigMetadata(config_name: str | None = None, metadata_config: JumpStartMetadataConfig | None = None, init_kwargs: JumpStartModelInitKwargs | None = None, deploy_kwargs: JumpStartModelDeployKwargs | None = None)[source]#

Bases: BaseDeploymentConfigDataHolder

Dataclass representing a Deployment Config Metadata

acceleration_configs#
benchmark_metrics#
deployment_args#
deployment_config_name#
class sagemaker.core.jumpstart.types.HubAccessConfig(spec: Dict[str, Any])[source]#

Bases: JumpStartDataHolderType

Data class of model access config that mirrors CreateModel API.

from_json(json_obj: Dict[str, Any]) None[source]#

Sets fields in object based on json.

Parameters:

json_obj (Dict[str, Any]) – Dictionary representation of data source.

hub_content_arn#
to_json() Dict[str, Any][source]#

Returns json representation of ModelAccessConfig object.

class sagemaker.core.jumpstart.types.HubArnExtractedInfo(partition: str, region: str, account_id: str, hub_name: str, hub_content_type: str | None = None, hub_content_name: str | None = None, hub_content_version: str | None = None)[source]#

Bases: JumpStartDataHolderType

Data class for info extracted from Hub arn.

account_id#
static extract_region_from_arn(arn: str) str | None[source]#

Extracts hub_name, content_name, and content_version from a HubContentArn

hub_content_name#
hub_content_type#
hub_content_version#
hub_name#
partition#
region#
class sagemaker.core.jumpstart.types.HubContentType(value)[source]#

Bases: str, Enum

Enum for Hub content objects.

MODEL = 'Model'#
MODEL_REFERENCE = 'ModelReference'#
NOTEBOOK = 'Notebook'#
class sagemaker.core.jumpstart.types.HubType(value)[source]#

Bases: str, Enum

Enum for Hub objects.

HUB = 'Hub'#
class sagemaker.core.jumpstart.types.JumpStartAdditionalDataSources(spec: Dict[str, Any])[source]#

Bases: JumpStartDataHolderType

Data class of additional data sources.

from_json(json_obj: Dict[str, Any]) None[source]#

Sets fields in object based on json.

Parameters:

json_obj (Dict[str, Any]) – Dictionary representation of data source.

scripts#
speculative_decoding#
to_json() Dict[str, Any][source]#

Returns json representation of AdditionalDataSources object.

class sagemaker.core.jumpstart.types.JumpStartBenchmarkStat(spec: Dict[str, Any])[source]#

Bases: JumpStartDataHolderType

Data class JumpStart benchmark stat.

concurrency#
from_json(json_obj: Dict[str, Any]) None[source]#

Sets fields in object based on json.

Parameters:

json_obj (Dict[str, Any]) – Dictionary representation of benchmark stats.

name#
to_json() Dict[str, Any][source]#

Returns json representation of JumpStartBenchmarkStat object.

unit#
value#
class sagemaker.core.jumpstart.types.JumpStartCachedContentKey(data_type: JumpStartS3FileType | HubType | HubContentType, id_info: str)[source]#

Bases: JumpStartDataHolderType

Data class for the cached content keys.

data_type#
id_info#
class sagemaker.core.jumpstart.types.JumpStartCachedContentValue(formatted_content: Dict[JumpStartVersionedModelId, JumpStartModelHeader] | JumpStartModelSpecs, md5_hash: str | None = None)[source]#

Bases: JumpStartDataHolderType

Data class for the s3 cached content values.

formatted_content#
md5_hash#
class sagemaker.core.jumpstart.types.JumpStartConfigComponent(component_name: str, component: Dict[str, Any] | None, is_hub_content=False)[source]#

Bases: JumpStartMetadataBaseFields

Data class of JumpStart config component.

CUSTOM_FIELD_MAP = {'sage_maker_sdk_predictor_specifications': 'predictor_specs'}#
OVERRIDING_DENY_LIST = ['model_id', 'url', 'version', 'min_sdk_version', 'deprecated', 'deprecated_message', 'deprecate_warn_message', 'resource_name_base', 'gated_bucket', 'training_supported', 'incremental_training_supported']#
capabilities#
component_name#
default_inference_instance_type#
default_payloads#
default_training_dataset_key#
default_training_dataset_uri#
default_training_instance_type#
deploy_kwargs#
deprecate_warn_message#
deprecated#
deprecated_message#
dynamic_container_deployment_supported#
estimator_kwargs#
fit_kwargs#
from_json(json_obj: Dict[str, Any]) None[source]#

Initializes a JumpStartConfigComponent object from its json representation.

Parameters:

json_obj (Dict[str, Any]) – Dictionary representation of the config component.

gated_bucket#
hosting_additional_data_sources#
hosting_artifact_key#
hosting_artifact_uri#
hosting_ecr_specs#
hosting_ecr_uri#
hosting_eula_key#
hosting_instance_type_variants#
hosting_model_package_arns#
hosting_neuron_model_id#
hosting_neuron_model_version#
hosting_prepacked_artifact_key#
hosting_prepacked_artifact_version#
hosting_resource_requirements#
hosting_script_key#
hosting_use_script_uri#
hub_content_type#
hyperparameters#
incremental_training_supported#
inference_dependencies#
inference_enable_network_isolation#
inference_environment_variables#
inference_volume_size#
inference_vulnerabilities#
inference_vulnerable#
metrics#
min_sdk_version#
model_id#
model_kwargs#
model_types#
predictor_specs#
resource_name_base#
slots = ['component_name']#
supported_inference_instance_types#
supported_training_instance_types#
training_artifact_key#
training_dependencies#
training_ecr_specs#
training_ecr_uri#
training_enable_network_isolation#
training_instance_type_variants#
training_model_package_artifact_uris#
training_prepacked_script_key#
training_prepacked_script_version#
training_script_key#
training_supported#
training_volume_size#
training_vulnerabilities#
training_vulnerable#
url#
usage_info_message#
version#
class sagemaker.core.jumpstart.types.JumpStartConfigRanking(spec: Dict[str, Any] | None, is_hub_content=False)[source]#

Bases: JumpStartDataHolderType

Data class JumpStart config ranking.

description#
from_json(json_obj: Dict[str, Any]) None[source]#

Sets fields in object based on json.

Parameters:

json_obj (Dict[str, Any]) – Dictionary representation of config ranking.

rankings#
to_json() Dict[str, Any][source]#

Returns json representation of JumpStartConfigRanking object.

class sagemaker.core.jumpstart.types.JumpStartDataHolderType[source]#

Bases: object

Base class for many JumpStart types.

Allows objects to be added to dicts and sets, and improves string representation. This class overrides the __eq__ and __hash__ methods so that different objects with the same attributes/types can be compared.

class sagemaker.core.jumpstart.types.JumpStartECRSpecs(spec: Dict[str, Any], is_hub_content: bool | None = False)[source]#

Bases: JumpStartDataHolderType

Data class for JumpStart ECR specs.

framework#
framework_version#
from_json(json_obj: Dict[str, Any]) None[source]#

Sets fields in object based on json.

Parameters:

json_obj (Dict[str, Any]) – Dictionary representation of spec.

huggingface_transformers_version#
py_version#
to_json() Dict[str, Any][source]#

Returns json representation of JumpStartECRSpecs object.

class sagemaker.core.jumpstart.types.JumpStartEnvironmentVariable(spec: Dict[str, Any], is_hub_content: bool | None = False)[source]#

Bases: JumpStartDataHolderType

Data class for JumpStart environment variable definitions in the hosting container.

default#
from_json(json_obj: Dict[str, Any]) None[source]#

Sets fields in object based on json.

Parameters:

json_obj (Dict[str, Any]) – Dictionary representation of environment variable.

name#
required_for_model_class#
scope#
to_json() Dict[str, Any][source]#

Returns json representation of JumpStartEnvironmentVariable object.

type#
class sagemaker.core.jumpstart.types.JumpStartEstimatorDeployKwargs(model_id: str, model_version: str | None = None, hub_arn: str | None = None, region: str | None = None, initial_instance_count: int | None = None, instance_type: str | None = None, serializer: Any | None = None, deserializer: Any | None = None, accelerator_type: str | None = None, endpoint_name: str | None = None, tags: List[Dict[str, str | PipelineVariable]] | Dict[str, str | PipelineVariable] | None = None, kms_key: str | None = None, wait: bool | None = None, data_capture_config: Any | None = None, async_inference_config: Any | None = None, serverless_inference_config: Any | None = None, volume_size: int | None = None, model_data_download_timeout: int | None = None, container_startup_health_check_timeout: int | None = None, inference_recommendation_id: str | None = None, explainer_config: Any | None = None, image_uri: str | Any | None = None, role: str | None = None, predictor_cls: Callable | None = None, env: Dict[str, str | Any] | None = None, model_name: str | None = None, vpc_config: Dict[str, List[str | Any]] | None = None, sagemaker_session: Any | None = None, enable_network_isolation: bool | Any | None = None, model_kms_key: str | None = None, image_config: Dict[str, str | Any] | None = None, source_dir: str | None = None, code_location: str | None = None, entry_point: str | None = None, container_log_level: int | Any | None = None, dependencies: List[str] | None = None, git_config: Dict[str, str] | None = None, tolerate_deprecated_model: bool | None = None, tolerate_vulnerable_model: bool | None = None, use_compiled_model: bool = False, config_name: str | None = None)[source]#

Bases: JumpStartKwargs

Data class for the inputs to JumpStartEstimator.deploy method.

SERIALIZATION_EXCLUSION_SET: Set[str] = {'config_name', 'hub_arn', 'model_id', 'model_version', 'region', 'sagemaker_session', 'tolerate_deprecated_model', 'tolerate_vulnerable_model'}#
accelerator_type#
async_inference_config#
code_location#
config_name#
container_log_level#
container_startup_health_check_timeout#
data_capture_config#
dependencies#
deserializer#
enable_network_isolation#
endpoint_name#
entry_point#
env#
explainer_config#
git_config#
hub_arn#
image_config#
image_uri#
inference_recommendation_id#
initial_instance_count#
instance_type#
kms_key#
model_data_download_timeout#
model_id#
model_kms_key#
model_name#
model_version#
predictor_cls#
region#
role#
sagemaker_session#
serializer#
serverless_inference_config#
source_dir#
specs#
tags#
tolerate_deprecated_model#
tolerate_vulnerable_model#
use_compiled_model#
volume_size#
vpc_config#
wait#
class sagemaker.core.jumpstart.types.JumpStartEstimatorFitKwargs(model_id: str, model_version: str | None = None, hub_arn: str | None = None, model_type: JumpStartModelType | None = JumpStartModelType.OPEN_WEIGHTS, region: str | None = None, inputs: str | Dict | Any | None = None, wait: bool | None = None, logs: str | None = None, job_name: str | None = None, experiment_config: Dict[str, str] | None = None, tolerate_deprecated_model: bool | None = None, tolerate_vulnerable_model: bool | None = None, sagemaker_session: Session | None = None, config_name: str | None = None)[source]#

Bases: JumpStartKwargs

Data class for the inputs to JumpStartEstimator.fit method.

SERIALIZATION_EXCLUSION_SET: Set[str] = {'config_name', 'hub_arn', 'model_id', 'model_type', 'model_version', 'region', 'sagemaker_session', 'tolerate_deprecated_model', 'tolerate_vulnerable_model'}#
config_name#
experiment_config#
hub_arn#
inputs#
job_name#
logs#
model_id#
model_type#
model_version#
region#
sagemaker_session#
specs#
tolerate_deprecated_model#
tolerate_vulnerable_model#
wait#
class sagemaker.core.jumpstart.types.JumpStartEstimatorInitKwargs(model_id: str, model_version: str | None = None, hub_arn: str | None = None, model_type: JumpStartModelType | None = JumpStartModelType.OPEN_WEIGHTS, region: str | None = None, image_uri: str | Any | None = None, role: str | None = None, instance_count: int | Any | None = None, instance_type: str | Any | None = None, keep_alive_period_in_seconds: int | Any | None = None, volume_size: int | Any | None = None, volume_kms_key: str | Any | None = None, max_run: int | Any | None = None, input_mode: str | Any | None = None, output_path: str | Any | None = None, output_kms_key: str | Any | None = None, base_job_name: str | None = None, sagemaker_session: Any | None = None, hyperparameters: Dict[str, str | Any] | None = None, tags: List[Dict[str, str | PipelineVariable]] | Dict[str, str | PipelineVariable] | None = None, subnets: List[str | Any] | None = None, security_group_ids: List[str | Any] | None = None, model_uri: str | None = None, model_channel_name: str | Any | None = None, metric_definitions: List[Dict[str, str | Any]] | None = None, encrypt_inter_container_traffic: bool | Any | None = None, use_spot_instances: bool | Any | None = None, max_wait: int | Any | None = None, checkpoint_s3_uri: str | Any | None = None, checkpoint_local_path: str | Any | None = None, enable_network_isolation: bool | Any | None = None, rules: List[Any] | None = None, debugger_hook_config: bool | Any | None = None, tensorboard_output_config: Any | None = None, enable_sagemaker_metrics: bool | Any | None = None, profiler_config: Any | None = None, disable_profiler: bool | None = None, environment: Dict[str, str | Any] | None = None, max_retry_attempts: int | Any | None = None, source_dir: str | Any | None = None, git_config: Dict[str, str] | None = None, container_log_level: int | Any | None = None, code_location: str | None = None, entry_point: str | Any | None = None, dependencies: List[str] | None = None, instance_groups: List[Any] | None = None, training_repository_access_mode: str | Any | None = None, training_repository_credentials_provider_arn: str | Any | None = None, tolerate_vulnerable_model: bool | None = None, tolerate_deprecated_model: bool | None = None, container_entry_point: List[str] | None = None, container_arguments: List[str] | None = None, disable_output_compression: bool | None = None, enable_infra_check: bool | PipelineVariable | None = None, enable_remote_debug: bool | PipelineVariable | None = None, config_name: str | None = None, enable_session_tag_chaining: bool | PipelineVariable | None = None, training_plan: str | PipelineVariable | None = None)[source]#

Bases: JumpStartKwargs

Data class for the inputs to JumpStartEstimator.__init__ method.

SERIALIZATION_EXCLUSION_SET: Set[str] = {'config_name', 'hub_arn', 'hub_content_type', 'model_id', 'model_type', 'model_version', 'region', 'tolerate_deprecated_model', 'tolerate_vulnerable_model'}#
base_job_name#
checkpoint_local_path#
checkpoint_s3_uri#
code_location#
config_name#
container_arguments#
container_entry_point#
container_log_level#
debugger_hook_config#
dependencies#
disable_output_compression#
disable_profiler#
enable_infra_check#
enable_network_isolation#
enable_remote_debug#
enable_sagemaker_metrics#
enable_session_tag_chaining#
encrypt_inter_container_traffic#
entry_point#
environment#
git_config#
hub_arn#
hub_content_type#
hyperparameters#
image_uri#
input_mode#
instance_count#
instance_groups#
instance_type#
keep_alive_period_in_seconds#
max_retry_attempts#
max_run#
max_wait#
metric_definitions#
model_channel_name#
model_id#
model_reference_arn#
model_type#
model_uri#
model_version#
output_kms_key#
output_path#
profiler_config#
region#
role#
rules#
sagemaker_session#
security_group_ids#
source_dir#
specs#
subnets#
tags#
tensorboard_output_config#
tolerate_deprecated_model#
tolerate_vulnerable_model#
training_plan#
training_repository_access_mode#
training_repository_credentials_provider_arn#
use_spot_instances#
volume_kms_key#
volume_size#
class sagemaker.core.jumpstart.types.JumpStartHyperparameter(spec: Dict[str, Any], is_hub_content: bool | None = False)[source]#

Bases: JumpStartDataHolderType

Data class for JumpStart hyperparameter definition in the training container.

default#
exclusive_max#
exclusive_min#
from_json(json_obj: Dict[str, Any]) None[source]#

Sets fields in object based on json.

Parameters:

json_obj (Dict[str, Any]) – Dictionary representation of hyperparameter.

max#
min#
name#
options#
scope#
to_json() Dict[str, Any][source]#

Returns json representation of JumpStartHyperparameter object.

type#
class sagemaker.core.jumpstart.types.JumpStartInstanceTypeVariants(spec: Dict[str, Any] | None, is_hub_content: bool | None = False)[source]#

Bases: JumpStartDataHolderType

Data class for JumpStart instance type variants.

aliases#
from_describe_hub_content_response(response: Dict[str, Any] | None) None[source]#

Sets fields in object based on DescribeHubContent response.

Parameters:

response (Dict[str, Any]) – Dictionary representation of instance type variants.

from_json(json_obj: Dict[str, Any] | None) None[source]#

Sets fields in object based on json.

Parameters:

json_obj (Dict[str, Any]) – Dictionary representation of instance type variants.

get_image_uri(instance_type: str, region: str | None = None) str | None[source]#

Returns image uri from instance type and region.

Returns None if no instance type is available or found. None is also returned if the metadata is improperly formatted.

get_instance_specific_artifact_key(instance_type: str) str | None[source]#

Returns instance specific model artifact key.

Returns None if a model, instance type tuple does not have specific artifact key.

get_instance_specific_default_inference_instance_type(instance_type: str) str | None[source]#

Returns instance specific default inference instance type.

Returns None if a model, instance type tuple does not have instance specific inference instance types.

get_instance_specific_environment_variables(instance_type: str) Dict[str, str][source]#

Returns instance specific environment variables.

Returns empty dict if a model, instance type tuple does not have specific environment variables.

get_instance_specific_gated_model_key_env_var_value(instance_type: str) str | None[source]#

Returns instance specific gated model env var s3 key.

Returns None if a model, instance type tuple does not have instance specific property.

get_instance_specific_hyperparameters(instance_type: str) List[JumpStartHyperparameter][source]#

Returns instance specific hyperparameters.

Returns empty list if a model, instance type tuple does not have specific hyperparameters.

get_instance_specific_metric_definitions(instance_type: str) List[JumpStartHyperparameter][source]#

Returns instance specific metric definitions.

Returns empty list if a model, instance type tuple does not have specific metric definitions.

get_instance_specific_prepacked_artifact_key(instance_type: str) str | None[source]#

Returns instance specific model artifact key.

Returns None if a model, instance type tuple does not have specific artifact key.

get_instance_specific_resource_requirements(instance_type: str) str | None[source]#

Returns instance specific resource requirements.

If a value exists for both the instance family and instance type, the instance type value is chosen.

get_instance_specific_supported_inference_instance_types(instance_type: str) List[str][source]#

Returns instance specific supported inference instance types.

Returns empty list if a model, instance type tuple does not have instance specific inference instance types.

get_instance_specific_training_artifact_key(instance_type: str) str | None[source]#

Returns instance specific training artifact key.

Returns None if a model, instance type tuple does not have specific training artifact key.

get_model_package_arn(instance_type: str, region: str) str | None[source]#

Returns model package arn from instance type and region.

Returns None if no instance type is available or found. None is also returned if the metadata is improperly formatted.

regional_aliases#
regionalize(region: str) Dict[str, Any] | None[source]#

Returns regionalized instance type variants.

to_json() Dict[str, Any][source]#

Returns json representation of JumpStartInstance object.

variants#
class sagemaker.core.jumpstart.types.JumpStartKwargs[source]#

Bases: JumpStartDataHolderType

Data class for JumpStart object kwargs.

BASE_SERIALIZATION_EXCLUSION_SET: Set[str] = ['specs']#
SERIALIZATION_EXCLUSION_SET: Set[str] = {}#
to_kwargs_dict(exclude_keys: bool = True)[source]#

Serializes object to dictionary to be used for kwargs for method arguments.

class sagemaker.core.jumpstart.types.JumpStartLaunchedRegionInfo(content_bucket: str, region_name: str, gated_content_bucket: str | None = None, neo_content_bucket: str | None = None)[source]#

Bases: JumpStartDataHolderType

Data class for launched region info.

content_bucket#
gated_content_bucket#
neo_content_bucket#
region_name#
class sagemaker.core.jumpstart.types.JumpStartMetadataBaseFields(fields: Dict[str, Any], is_hub_content: bool | None = False)[source]#

Bases: JumpStartDataHolderType

Data class JumpStart metadata base fields that can be overridden.

capabilities#
default_inference_instance_type#
default_payloads#
default_training_dataset_key#
default_training_dataset_uri#
default_training_instance_type#
deploy_kwargs#
deprecate_warn_message#
deprecated#
deprecated_message#
dynamic_container_deployment_supported#
estimator_kwargs#
fit_kwargs#
from_json(json_obj: Dict[str, Any]) None[source]#

Sets fields in object based on json of header.

Parameters:

json_obj (Dict[str, Any]) – Dictionary representation of spec.

gated_bucket#
hosting_additional_data_sources#
hosting_artifact_key#
hosting_artifact_uri#
hosting_ecr_specs#
hosting_ecr_uri#
hosting_eula_key#
hosting_instance_type_variants#
hosting_model_package_arns#
hosting_neuron_model_id#
hosting_neuron_model_version#
hosting_prepacked_artifact_key#
hosting_prepacked_artifact_version#
hosting_resource_requirements#
hosting_script_key#
hosting_use_script_uri#
hub_content_type#
hyperparameters#
incremental_training_supported#
inference_dependencies#
inference_enable_network_isolation#
inference_environment_variables#
inference_volume_size#
inference_vulnerabilities#
inference_vulnerable#
metrics#
min_sdk_version#
model_id#
model_kwargs#
model_types#
predictor_specs#
resource_name_base#
set_hub_content_type(hub_content_type: HubContentType) None[source]#

Sets the hub content type.

supported_inference_instance_types#
supported_training_instance_types#
to_json() Dict[str, Any][source]#

Returns json representation of JumpStartMetadataBaseFields object.

training_artifact_key#
training_dependencies#
training_ecr_specs#
training_ecr_uri#
training_enable_network_isolation#
training_instance_type_variants#
training_model_package_artifact_uris#
training_prepacked_script_key#
training_prepacked_script_version#
training_script_key#
training_supported#
training_volume_size#
training_vulnerabilities#
training_vulnerable#
url#
usage_info_message#
version#
class sagemaker.core.jumpstart.types.JumpStartMetadataConfig(config_name: str, config: Dict[str, Any], base_fields: Dict[str, Any], config_components: Dict[str, JumpStartConfigComponent], is_hub_content=False)[source]#

Bases: JumpStartDataHolderType

Data class of JumpStart metadata config.

acceleration_configs#
base_fields#
benchmark_metrics: Dict[str, List[JumpStartBenchmarkStat]]#
config_components: Dict[str, JumpStartConfigComponent]#
config_name: str | None#
default_incremental_training_config: str | None#
default_inference_config: str | None#
property resolved_config: Dict[str, Any]#

Returns the final config that is resolved from the components map.

Construct the final config by applying the list of configs from list index, and apply to the base default fields in the current model specs.

resolved_metadata_config: Dict[str, Any] | None#
supported_incremental_training_configs: List[str] | None#
supported_inference_configs: List[str] | None#
to_json() Dict[str, Any][source]#

Returns json representation of JumpStartMetadataConfig object.

class sagemaker.core.jumpstart.types.JumpStartMetadataConfigs(configs: Dict[str, JumpStartMetadataConfig] | None, config_rankings: Dict[str, JumpStartConfigRanking] | None, scope: JumpStartScriptScope = JumpStartScriptScope.INFERENCE)[source]#

Bases: JumpStartDataHolderType

Data class to hold the set of JumpStart Metadata configs.

config_rankings#
configs#
get_top_config_from_ranking(ranking_name: str = JumpStartConfigRankingName.DEFAULT, instance_type: str | None = None) JumpStartMetadataConfig | None[source]#

Gets the best the config based on config ranking.

Fallback to use the ordering in config names if ranking is not available. :param ranking_name: The ranking name that config priority is based on. :type ranking_name: str :param instance_type: The instance type which the config selection is based on. :type instance_type: Optional[str]

Raises:

NotImplementedError – If the scope is unrecognized.

scope#
to_json() Dict[str, Any][source]#

Returns json representation of JumpStartMetadataConfigs object.

class sagemaker.core.jumpstart.types.JumpStartModelDataSource(spec: Dict[str, Any])[source]#

Bases: AdditionalModelDataSource

Data class JumpStart additional model data source.

SERIALIZATION_EXCLUSION_SET = {'artifact_version', 'provider'}#
artifact_version#
channel_name#
from_json(json_obj: Dict[str, Any]) None[source]#

Sets fields in object based on json.

Parameters:

json_obj (Dict[str, Any]) – Dictionary representation of data source.

hosting_eula_key#
provider#
s3_data_source#
class sagemaker.core.jumpstart.types.JumpStartModelDeployKwargs(model_id: str, model_version: str | None = None, hub_arn: str | None = None, model_type: JumpStartModelType | None = JumpStartModelType.OPEN_WEIGHTS, region: str | None = None, initial_instance_count: int | None = None, instance_type: str | None = None, serializer: Any | None = None, deserializer: Any | None = None, accelerator_type: str | None = None, endpoint_name: str | None = None, inference_component_name: str | None = None, tags: Tags | None = None, kms_key: str | None = None, wait: bool | None = None, data_capture_config: Any | None = None, async_inference_config: Any | None = None, serverless_inference_config: Any | None = None, volume_size: int | None = None, model_data_download_timeout: int | None = None, container_startup_health_check_timeout: int | None = None, inference_recommendation_id: str | None = None, explainer_config: Any | None = None, tolerate_deprecated_model: bool | None = None, tolerate_vulnerable_model: bool | None = None, sagemaker_session: Session | None = None, training_instance_type: str | None = None, accept_eula: bool | None = None, model_reference_arn: str | None = None, endpoint_logging: bool | None = None, resources: ResourceRequirements | None = None, endpoint_type: EndpointType | None = None, config_name: str | None = None, routing_config: Dict[str, Any] | None = None, model_access_configs: Dict[str, CoreModelAccessConfig] | None = None, inference_ami_version: str | None = None)[source]#

Bases: JumpStartKwargs

Data class for the inputs to JumpStartModel.deploy method.

SERIALIZATION_EXCLUSION_SET: Set[str] = {'config_name', 'hub_arn', 'model_access_configs', 'model_id', 'model_type', 'model_version', 'region', 'sagemaker_session', 'tolerate_deprecated_model', 'tolerate_vulnerable_model', 'training_instance_type'}#
accelerator_type#
accept_eula#
async_inference_config#
config_name#
container_startup_health_check_timeout#
data_capture_config#
deserializer#
endpoint_logging#
endpoint_name#
endpoint_type#
explainer_config#
hub_arn#
inference_ami_version#
inference_component_name#
inference_recommendation_id#
initial_instance_count#
instance_type#
kms_key#
model_access_configs#
model_data_download_timeout#
model_id#
model_reference_arn#
model_type#
model_version#
region#
resources#
routing_config#
sagemaker_session#
serializer#
serverless_inference_config#
specs#
tags#
tolerate_deprecated_model#
tolerate_vulnerable_model#
training_instance_type#
volume_size#
wait#
class sagemaker.core.jumpstart.types.JumpStartModelHeader(header: Dict[str, str])[source]#

Bases: JumpStartDataHolderType

Data class JumpStart model header.

from_json(json_obj: Dict[str, str]) None[source]#

Sets fields in object based on json of header.

Parameters:

json_obj (Dict[str, str]) – Dictionary representation of header.

min_version#
model_id#
search_keywords#
spec_key#
to_json() Dict[str, str][source]#

Returns json representation of JumpStartModelHeader object.

version#
class sagemaker.core.jumpstart.types.JumpStartModelInitKwargs(model_id: str, model_version: str | None = None, hub_arn: str | None = None, model_type: JumpStartModelType | None = JumpStartModelType.OPEN_WEIGHTS, region: str | None = None, instance_type: str | None = None, image_uri: str | Any | None = None, model_data: str | Any | dict | None = None, role: str | None = None, predictor_cls: Callable | None = None, env: Dict[str, str | Any] | None = None, name: str | None = None, vpc_config: Dict[str, List[str | Any]] | None = None, sagemaker_session: Any | None = None, enable_network_isolation: bool | Any = None, model_kms_key: str | None = None, image_config: Dict[str, str | Any] | None = None, source_dir: str | None = None, code_location: str | None = None, entry_point: str | None = None, container_log_level: int | Any | None = None, dependencies: List[str] | None = None, git_config: Dict[str, str] | None = None, tolerate_vulnerable_model: bool | None = None, tolerate_deprecated_model: bool | None = None, model_package_arn: str | None = None, training_instance_type: str | None = None, resources: ResourceRequirements | None = None, config_name: str | None = None, additional_model_data_sources: Dict[str, Any] | None = None)[source]#

Bases: JumpStartKwargs

Data class for the inputs to JumpStartModel.__init__ method.

SERIALIZATION_EXCLUSION_SET: Set[str] = {'config_name', 'hub_arn', 'hub_content_type', 'instance_type', 'model_id', 'model_package_arn', 'model_type', 'model_version', 'region', 'tolerate_deprecated_model', 'tolerate_vulnerable_model', 'training_instance_type'}#
additional_model_data_sources#
code_location#
config_name#
container_log_level#
dependencies#
enable_network_isolation#
entry_point#
env#
git_config#
hub_arn#
hub_content_type#
image_config#
image_uri#
instance_type#
model_data#
model_id#
model_kms_key#
model_package_arn#
model_reference_arn#
model_type#
model_version#
name#
predictor_cls#
region#
resources#
role#
sagemaker_session#
source_dir#
specs#
tolerate_deprecated_model#
tolerate_vulnerable_model#
training_instance_type#
vpc_config#
class sagemaker.core.jumpstart.types.JumpStartModelRegisterKwargs(model_id: str, model_version: str | None = None, hub_arn: str | None = None, region: str | None = None, model_type: JumpStartModelType | None = JumpStartModelType.OPEN_WEIGHTS, tolerate_deprecated_model: bool | None = None, tolerate_vulnerable_model: bool | None = None, sagemaker_session: Any | None = None, content_types: List[str] | None = None, response_types: List[str] | None = None, inference_instances: List[str] | None = None, transform_instances: List[str] | None = None, model_package_group_name: str | None = None, image_uri: str | None = None, model_metrics: ModelMetrics | None = None, metadata_properties: MetadataProperties | None = None, approval_status: str | None = None, description: str | None = None, drift_check_baselines: DriftCheckBaselines | None = None, customer_metadata_properties: Dict[str, str] | None = None, validation_specification: str | None = None, domain: str | None = None, task: str | None = None, sample_payload_url: str | None = None, framework: str | None = None, framework_version: str | None = None, nearest_model_name: str | None = None, data_input_configuration: str | None = None, skip_model_validation: str | None = None, source_uri: str | None = None, model_life_cycle: ModelLifeCycle | None = None, config_name: str | None = None, model_card: Dict[ModelCardContent, ModelCardContent] | None = None, accept_eula: bool | None = None)[source]#

Bases: JumpStartKwargs

Data class for the inputs to JumpStartEstimator.deploy method.

SERIALIZATION_EXCLUSION_SET: Set[str] = {'config_name', 'hub_arn', 'model_id', 'model_version', 'region', 'sagemaker_session', 'tolerate_deprecated_model', 'tolerate_vulnerable_model'}#
accept_eula#
approval_status#
config_name#
content_types#
customer_metadata_properties#
data_input_configuration#
description#
domain#
drift_check_baselines#
framework#
framework_version#
hub_arn#
image_uri#
inference_instances#
metadata_properties#
model_card#
model_id#
model_life_cycle#
model_metrics#
model_package_group_name#
model_type#
model_version#
nearest_model_name#
region#
response_types#
sagemaker_session#
sample_payload_url#
skip_model_validation#
source_uri#
specs#
task#
tolerate_deprecated_model#
tolerate_vulnerable_model#
transform_instances#
validation_specification#
class sagemaker.core.jumpstart.types.JumpStartModelSpecs(spec: Dict[str, Any], is_hub_content: bool | None = False)[source]#

Bases: JumpStartMetadataBaseFields

Data class JumpStart model specs.

capabilities#
default_inference_instance_type#
default_payloads#
default_training_dataset_key#
default_training_dataset_uri#
default_training_instance_type#
deploy_kwargs#
deprecate_warn_message#
deprecated#
deprecated_message#
dynamic_container_deployment_supported#
estimator_kwargs#
fit_kwargs#
from_json(json_obj: Dict[str, Any]) None[source]#

Sets fields in object based on json of header.

Parameters:

json_obj (Dict[str, Any]) – Dictionary representation of spec.

gated_bucket#
get_additional_s3_data_sources() List[JumpStartAdditionalDataSources][source]#

Returns a list of the additional S3 data sources for use by the model.

get_speculative_decoding_s3_data_sources() List[JumpStartModelDataSource][source]#

Returns data sources for speculative decoding.

hosting_additional_data_sources#
hosting_artifact_key#
hosting_artifact_uri#
hosting_ecr_specs#
hosting_ecr_uri#
hosting_eula_key#
hosting_instance_type_variants#
hosting_model_package_arns#
hosting_neuron_model_id#
hosting_neuron_model_version#
hosting_prepacked_artifact_key#
hosting_prepacked_artifact_version#
hosting_resource_requirements#
hosting_script_key#
hosting_use_script_uri#
hub_content_type#
hyperparameters#
incremental_training_supported#
inference_config_components#
inference_config_rankings#
inference_configs#
inference_dependencies#
inference_enable_network_isolation#
inference_environment_variables#
inference_volume_size#
inference_vulnerabilities#
inference_vulnerable#
is_gated_model() bool[source]#

Returns True if the model has a EULA key or the model bucket is gated.

metrics#
min_sdk_version#
model_id#
model_kwargs#
model_types#
predictor_specs#
resource_name_base#
set_config(config_name: str, scope: JumpStartScriptScope = JumpStartScriptScope.INFERENCE) None[source]#

Apply the seleted config and resolve to the current model spec.

Parameters:
  • config_name (str) – Name of the config.

  • scope (JumpStartScriptScope, optional) – Scope of the config. Defaults to JumpStartScriptScope.INFERENCE.

Raises:

ValueError – If the scope is not supported, or cannot find config name.

slots = ['inference_configs', 'inference_config_components', 'inference_config_rankings', 'training_configs', 'training_config_components', 'training_config_rankings']#
supported_inference_instance_types#
supported_training_instance_types#
supports_incremental_training() bool[source]#

Returns True if the model supports incremental training.

supports_prepacked_inference() bool[source]#

Returns True if the model has a prepacked inference artifact.

training_artifact_key#
training_config_components#
training_config_rankings#
training_configs#
training_dependencies#
training_ecr_specs#
training_ecr_uri#
training_enable_network_isolation#
training_instance_type_variants#
training_model_package_artifact_uris#
training_prepacked_script_key#
training_prepacked_script_version#
training_script_key#
training_supported#
training_volume_size#
training_vulnerabilities#
training_vulnerable#
url#
usage_info_message#
use_inference_script_uri() bool[source]#

Returns True if the model should use a script uri when deploying inference model.

use_training_model_artifact() bool[source]#

Returns True if the model should use a model uri when kicking off training job.

version#
class sagemaker.core.jumpstart.types.JumpStartPredictorSpecs(spec: Dict[str, Any] | None, is_hub_content: bool | None = False)[source]#

Bases: JumpStartDataHolderType

Data class for JumpStart Predictor specs.

default_accept_type#
default_content_type#
from_json(json_obj: Dict[str, Any] | None) None[source]#

Sets fields in object based on json.

Parameters:

json_obj (Dict[str, Any]) – Dictionary representation of predictor specs.

supported_accept_types#
supported_content_types#
to_json() Dict[str, Any][source]#

Returns json representation of JumpStartPredictorSpecs object.

class sagemaker.core.jumpstart.types.JumpStartS3FileType(value)[source]#

Bases: str, Enum

Type of files published in JumpStart S3 distribution buckets.

OPEN_WEIGHT_MANIFEST = 'manifest'#
OPEN_WEIGHT_SPECS = 'specs'#
PROPRIETARY_MANIFEST = 'proprietary_manifest'#
PROPRIETARY_SPECS = 'proprietary_specs'#
class sagemaker.core.jumpstart.types.JumpStartSerializablePayload(spec: Dict[str, Any] | None, is_hub_content: bool | None = False)[source]#

Bases: JumpStartDataHolderType

Data class for JumpStart serialized payload specs.

accept#
body#
content_type#
from_json(json_obj: Dict[str, Any] | None) None[source]#

Sets fields in object based on json.

Parameters:

json_obj (Dict[str, Any]) – Dictionary representation of serializable payload specs.

Raises:

KeyError – If the dictionary is missing keys.

prompt_key#
raw_payload#
to_json() Dict[str, Any][source]#

Returns json representation of JumpStartSerializablePayload object.

class sagemaker.core.jumpstart.types.JumpStartVersionedModelId(model_id: str, version: str)[source]#

Bases: JumpStartDataHolderType

Data class for versioned model IDs.

model_id#
version#
class sagemaker.core.jumpstart.types.ModelAccessConfig(spec: Dict[str, Any])[source]#

Bases: JumpStartDataHolderType

Data class of model access config that mirrors CreateModel API.

accept_eula#
from_json(json_obj: Dict[str, Any]) None[source]#

Sets fields in object based on json.

Parameters:

json_obj (Dict[str, Any]) – Dictionary representation of data source.

to_json() Dict[str, Any][source]#

Returns json representation of ModelAccessConfig object.

class sagemaker.core.jumpstart.types.S3DataSource(spec: Dict[str, Any])[source]#

Bases: JumpStartDataHolderType

Data class of S3 data source that mirrors CreateModel API.

compression_type#
from_json(json_obj: Dict[str, Any]) None[source]#

Sets fields in object based on json.

Parameters:

json_obj (Dict[str, Any]) – Dictionary representation of data source.

hub_access_config#
model_access_config#
s3_data_type#
s3_uri#
set_bucket(bucket: str) None[source]#

Sets bucket name from S3 URI.

to_json() Dict[str, Any][source]#

Returns json representation of S3DataSource object.