InferenceComponentSpecificationProperty Struct
Details about the resources to deploy with this inference component, including the model, container, and compute resources.
| Source | |
|---|---|
| Type last changed |
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_sagemaker as sagemaker } from 'aws-cdk-lib';
const inferenceComponentSpecificationProperty: sagemaker.CfnInferenceComponent.InferenceComponentSpecificationProperty = {
baseInferenceComponentName: 'baseInferenceComponentName',
computeResourceRequirements: {
maxMemoryRequiredInMb: 123,
minMemoryRequiredInMb: 123,
numberOfAcceleratorDevicesRequired: 123,
numberOfCpuCoresRequired: 123,
},
container: {
artifactUrl: 'artifactUrl',
containerMetricsConfig: {
metricsEndpoints: [{
metricsEndpointPath: 'metricsEndpointPath',
// the properties below are optional
metricPublishFrequencyInSeconds: 123,
}],
},
deployedImage: {
resolutionTime: 'resolutionTime',
resolvedImage: 'resolvedImage',
specifiedImage: 'specifiedImage',
},
environment: {
environmentKey: 'environment',
},
image: 'image',
},
currentDataCacheConfig: {
enableCaching: false,
},
dataCacheConfig: {
enableCaching: false,
},
modelName: 'modelName',
schedulingConfig: {
availabilityZoneBalance: {
enforcementMode: 'enforcementMode',
// the properties below are optional
maxImbalance: 123,
},
placementStrategy: 'placementStrategy',
},
startupParameters: {
containerStartupHealthCheckTimeoutInSeconds: 123,
modelDataDownloadTimeoutInSeconds: 123,
},
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_sagemaker as sagemaker
inference_component_specification_property = sagemaker.CfnInferenceComponent.InferenceComponentSpecificationProperty(
base_inference_component_name="baseInferenceComponentName",
compute_resource_requirements=sagemaker.CfnInferenceComponent.InferenceComponentComputeResourceRequirementsProperty(
max_memory_required_in_mb=123,
min_memory_required_in_mb=123,
number_of_accelerator_devices_required=123,
number_of_cpu_cores_required=123
),
container=sagemaker.CfnInferenceComponent.InferenceComponentContainerSpecificationProperty(
artifact_url="artifactUrl",
container_metrics_config=sagemaker.CfnInferenceComponent.ContainerMetricsConfigProperty(
metrics_endpoints=[sagemaker.CfnInferenceComponent.MetricsEndpointProperty(
metrics_endpoint_path="metricsEndpointPath",
# the properties below are optional
metric_publish_frequency_in_seconds=123
)]
),
deployed_image=sagemaker.CfnInferenceComponent.DeployedImageProperty(
resolution_time="resolutionTime",
resolved_image="resolvedImage",
specified_image="specifiedImage"
),
environment={
"environment_key": "environment"
},
image="image"
),
current_data_cache_config=sagemaker.CfnInferenceComponent.InferenceComponentDataCacheConfigProperty(
enable_caching=False
),
data_cache_config=sagemaker.CfnInferenceComponent.InferenceComponentDataCacheConfigProperty(
enable_caching=False
),
model_name="modelName",
scheduling_config=sagemaker.CfnInferenceComponent.InferenceComponentSchedulingConfigProperty(
availability_zone_balance=sagemaker.CfnInferenceComponent.InferenceComponentAvailabilityZoneBalanceProperty(
enforcement_mode="enforcementMode",
# the properties below are optional
max_imbalance=123
),
placement_strategy="placementStrategy"
),
startup_parameters=sagemaker.CfnInferenceComponent.InferenceComponentStartupParametersProperty(
container_startup_health_check_timeout_in_seconds=123,
model_data_download_timeout_in_seconds=123
)
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.sagemaker.*;
InferenceComponentSpecificationProperty inferenceComponentSpecificationProperty = InferenceComponentSpecificationProperty.builder()
.baseInferenceComponentName("baseInferenceComponentName")
.computeResourceRequirements(InferenceComponentComputeResourceRequirementsProperty.builder()
.maxMemoryRequiredInMb(123)
.minMemoryRequiredInMb(123)
.numberOfAcceleratorDevicesRequired(123)
.numberOfCpuCoresRequired(123)
.build())
.container(InferenceComponentContainerSpecificationProperty.builder()
.artifactUrl("artifactUrl")
.containerMetricsConfig(ContainerMetricsConfigProperty.builder()
.metricsEndpoints(List.of(MetricsEndpointProperty.builder()
.metricsEndpointPath("metricsEndpointPath")
// the properties below are optional
.metricPublishFrequencyInSeconds(123)
.build()))
.build())
.deployedImage(DeployedImageProperty.builder()
.resolutionTime("resolutionTime")
.resolvedImage("resolvedImage")
.specifiedImage("specifiedImage")
.build())
.environment(Map.of(
"environmentKey", "environment"))
.image("image")
.build())
.currentDataCacheConfig(InferenceComponentDataCacheConfigProperty.builder()
.enableCaching(false)
.build())
.dataCacheConfig(InferenceComponentDataCacheConfigProperty.builder()
.enableCaching(false)
.build())
.modelName("modelName")
.schedulingConfig(InferenceComponentSchedulingConfigProperty.builder()
.availabilityZoneBalance(InferenceComponentAvailabilityZoneBalanceProperty.builder()
.enforcementMode("enforcementMode")
// the properties below are optional
.maxImbalance(123)
.build())
.placementStrategy("placementStrategy")
.build())
.startupParameters(InferenceComponentStartupParametersProperty.builder()
.containerStartupHealthCheckTimeoutInSeconds(123)
.modelDataDownloadTimeoutInSeconds(123)
.build())
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Sagemaker;
var inferenceComponentSpecificationProperty = new InferenceComponentSpecificationProperty {
BaseInferenceComponentName = "baseInferenceComponentName",
ComputeResourceRequirements = new InferenceComponentComputeResourceRequirementsProperty {
MaxMemoryRequiredInMb = 123,
MinMemoryRequiredInMb = 123,
NumberOfAcceleratorDevicesRequired = 123,
NumberOfCpuCoresRequired = 123
},
Container = new InferenceComponentContainerSpecificationProperty {
ArtifactUrl = "artifactUrl",
ContainerMetricsConfig = new ContainerMetricsConfigProperty {
MetricsEndpoints = new [] { new MetricsEndpointProperty {
MetricsEndpointPath = "metricsEndpointPath",
// the properties below are optional
MetricPublishFrequencyInSeconds = 123
} }
},
DeployedImage = new DeployedImageProperty {
ResolutionTime = "resolutionTime",
ResolvedImage = "resolvedImage",
SpecifiedImage = "specifiedImage"
},
Environment = new Dictionary<string, string> {
{ "environmentKey", "environment" }
},
Image = "image"
},
CurrentDataCacheConfig = new InferenceComponentDataCacheConfigProperty {
EnableCaching = false
},
DataCacheConfig = new InferenceComponentDataCacheConfigProperty {
EnableCaching = false
},
ModelName = "modelName",
SchedulingConfig = new InferenceComponentSchedulingConfigProperty {
AvailabilityZoneBalance = new InferenceComponentAvailabilityZoneBalanceProperty {
EnforcementMode = "enforcementMode",
// the properties below are optional
MaxImbalance = 123
},
PlacementStrategy = "placementStrategy"
},
StartupParameters = new InferenceComponentStartupParametersProperty {
ContainerStartupHealthCheckTimeoutInSeconds = 123,
ModelDataDownloadTimeoutInSeconds = 123
}
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
inferenceComponentSpecificationProperty := &InferenceComponentSpecificationProperty{
BaseInferenceComponentName: jsii.String("baseInferenceComponentName"),
ComputeResourceRequirements: &InferenceComponentComputeResourceRequirementsProperty{
MaxMemoryRequiredInMb: jsii.Number(123),
MinMemoryRequiredInMb: jsii.Number(123),
NumberOfAcceleratorDevicesRequired: jsii.Number(123),
NumberOfCpuCoresRequired: jsii.Number(123),
},
Container: &InferenceComponentContainerSpecificationProperty{
ArtifactUrl: jsii.String("artifactUrl"),
ContainerMetricsConfig: &ContainerMetricsConfigProperty{
MetricsEndpoints: []interface{}{
&MetricsEndpointProperty{
MetricsEndpointPath: jsii.String("metricsEndpointPath"),
// the properties below are optional
MetricPublishFrequencyInSeconds: jsii.Number(123),
},
},
},
DeployedImage: &DeployedImageProperty{
ResolutionTime: jsii.String("resolutionTime"),
ResolvedImage: jsii.String("resolvedImage"),
SpecifiedImage: jsii.String("specifiedImage"),
},
Environment: map[string]*string{
"environmentKey": jsii.String("environment"),
},
Image: jsii.String("image"),
},
CurrentDataCacheConfig: &InferenceComponentDataCacheConfigProperty{
EnableCaching: jsii.Boolean(false),
},
DataCacheConfig: &InferenceComponentDataCacheConfigProperty{
EnableCaching: jsii.Boolean(false),
},
ModelName: jsii.String("modelName"),
SchedulingConfig: &InferenceComponentSchedulingConfigProperty{
AvailabilityZoneBalance: &InferenceComponentAvailabilityZoneBalanceProperty{
EnforcementMode: jsii.String("enforcementMode"),
// the properties below are optional
MaxImbalance: jsii.Number(123),
},
PlacementStrategy: jsii.String("placementStrategy"),
},
StartupParameters: &InferenceComponentStartupParametersProperty{
ContainerStartupHealthCheckTimeoutInSeconds: jsii.Number(123),
ModelDataDownloadTimeoutInSeconds: jsii.Number(123),
},
}
Properties
baseInferenceComponentNameoptionalstringbase_inference_component_nameoptionalstrbaseInferenceComponentNameoptionalStringBaseInferenceComponentNameoptionalstringBaseInferenceComponentNameoptional*string #notes
Specify this parameter only if your request is meant to create an adapter inference component. An adapter inference component contains the path to an adapter model. The purpose of the adapter model is to tailor the inference output of a base foundation model, which is hosted by the base inference component. The adapter inference component uses the compute resources that you assigned to the base inference component.
When you create an adapter inference component, use the Container parameter to specify the location of the adapter artifacts. In the parameter value, use the ArtifactUrl parameter of the InferenceComponentContainerSpecification data type.
Before you can create an adapter inference component, you must have an existing inference component that contains the foundation model that you want to adapt.
computeResourceRequirementsoptionalIResolvable | CfnInferenceComponent.compute_resource_requirementsoptionaltyping.Union[IResolvable, InferenceComponentComputeResourceRequirementsProperty]computeResourceRequirementsoptionalIResolvableComputeResourceRequirementsoptionalIResolvableComputeResourceRequirementsoptionalinterface{} #Omit this parameter if your request is meant to create an adapter inference component. An adapter inference component is loaded by a base inference component, and it uses the compute resources of the base inference component.
containeroptionalIResolvable | CfnInferenceComponent.containeroptionaltyping.Union[IResolvable, InferenceComponentContainerSpecificationProperty]containeroptionalIResolvableContaineroptionalIResolvableContaineroptionalinterface{} #currentDataCacheConfigoptionalIResolvable | CfnInferenceComponent.current_data_cache_configoptionaltyping.Union[IResolvable, InferenceComponentDataCacheConfigProperty]currentDataCacheConfigoptionalIResolvableCurrentDataCacheConfigoptionalIResolvableCurrentDataCacheConfigoptionalinterface{} #dataCacheConfigoptionalIResolvable | CfnInferenceComponent.data_cache_configoptionaltyping.Union[IResolvable, InferenceComponentDataCacheConfigProperty]dataCacheConfigoptionalIResolvableDataCacheConfigoptionalIResolvableDataCacheConfigoptionalinterface{} #modelNameoptionalstringmodel_nameoptionalstrmodelNameoptionalStringModelNameoptionalstringModelNameoptional*string #schedulingConfigoptionalIResolvable | CfnInferenceComponent.scheduling_configoptionaltyping.Union[IResolvable, InferenceComponentSchedulingConfigProperty]schedulingConfigoptionalIResolvableSchedulingConfigoptionalIResolvableSchedulingConfigoptionalinterface{} #startupParametersoptionalIResolvable | CfnInferenceComponent.startup_parametersoptionaltyping.Union[IResolvable, InferenceComponentStartupParametersProperty]startupParametersoptionalIResolvableStartupParametersoptionalIResolvableStartupParametersoptionalinterface{} #