# InferenceSpecificationProperty

- Source: Generated at build time
- Type last changed: v2.262.0 · 22 Jul 2026

## Example

TypeScript:

```ts
// 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 inferenceSpecificationProperty: sagemaker.CfnAlgorithm.InferenceSpecificationProperty = {
  containers: [{
    image: 'image',

    // the properties below are optional
    containerHostname: 'containerHostname',
    environment: {
      environmentKey: 'environment',
    },
    framework: 'framework',
    frameworkVersion: 'frameworkVersion',
    imageDigest: 'imageDigest',
    isCheckpoint: false,
    modelInput: {
      dataInputConfig: 'dataInputConfig',
    },
    nearestModelName: 'nearestModelName',
  }],

  // the properties below are optional
  supportedContentTypes: ['supportedContentTypes'],
  supportedRealtimeInferenceInstanceTypes: ['supportedRealtimeInferenceInstanceTypes'],
  supportedResponseMimeTypes: ['supportedResponseMimeTypes'],
  supportedTransformInstanceTypes: ['supportedTransformInstanceTypes'],
};
```

Python:

```python
# 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_specification_property = sagemaker.CfnAlgorithm.InferenceSpecificationProperty(
    containers=[sagemaker.CfnAlgorithm.ModelPackageContainerDefinitionProperty(
        image="image",

        # the properties below are optional
        container_hostname="containerHostname",
        environment={
            "environment_key": "environment"
        },
        framework="framework",
        framework_version="frameworkVersion",
        image_digest="imageDigest",
        is_checkpoint=False,
        model_input=sagemaker.CfnAlgorithm.ModelInputProperty(
            data_input_config="dataInputConfig"
        ),
        nearest_model_name="nearestModelName"
    )],

    # the properties below are optional
    supported_content_types=["supportedContentTypes"],
    supported_realtime_inference_instance_types=["supportedRealtimeInferenceInstanceTypes"],
    supported_response_mime_types=["supportedResponseMimeTypes"],
    supported_transform_instance_types=["supportedTransformInstanceTypes"]
)
```

Java:

```java
// 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.*;

InferenceSpecificationProperty inferenceSpecificationProperty = InferenceSpecificationProperty.builder()
        .containers(List.of(ModelPackageContainerDefinitionProperty.builder()
                .image("image")

                // the properties below are optional
                .containerHostname("containerHostname")
                .environment(Map.of(
                        "environmentKey", "environment"))
                .framework("framework")
                .frameworkVersion("frameworkVersion")
                .imageDigest("imageDigest")
                .isCheckpoint(false)
                .modelInput(ModelInputProperty.builder()
                        .dataInputConfig("dataInputConfig")
                        .build())
                .nearestModelName("nearestModelName")
                .build()))

        // the properties below are optional
        .supportedContentTypes(List.of("supportedContentTypes"))
        .supportedRealtimeInferenceInstanceTypes(List.of("supportedRealtimeInferenceInstanceTypes"))
        .supportedResponseMimeTypes(List.of("supportedResponseMimeTypes"))
        .supportedTransformInstanceTypes(List.of("supportedTransformInstanceTypes"))
        .build();
```

C# / .NET:

```csharp
// 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 inferenceSpecificationProperty = new InferenceSpecificationProperty {
    Containers = new [] { new ModelPackageContainerDefinitionProperty {
        Image = "image",

        // the properties below are optional
        ContainerHostname = "containerHostname",
        Environment = new Dictionary<string, string> {
            { "environmentKey", "environment" }
        },
        Framework = "framework",
        FrameworkVersion = "frameworkVersion",
        ImageDigest = "imageDigest",
        IsCheckpoint = false,
        ModelInput = new ModelInputProperty {
            DataInputConfig = "dataInputConfig"
        },
        NearestModelName = "nearestModelName"
    } },

    // the properties below are optional
    SupportedContentTypes = new [] { "supportedContentTypes" },
    SupportedRealtimeInferenceInstanceTypes = new [] { "supportedRealtimeInferenceInstanceTypes" },
    SupportedResponseMimeTypes = new [] { "supportedResponseMimeTypes" },
    SupportedTransformInstanceTypes = new [] { "supportedTransformInstanceTypes" }
};
```

Golang:

```go
// 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"

inferenceSpecificationProperty := &InferenceSpecificationProperty{
	Containers: []interface{}{
		&ModelPackageContainerDefinitionProperty{
			Image: jsii.String("image"),

			// the properties below are optional
			ContainerHostname: jsii.String("containerHostname"),
			Environment: map[string]*string{
				"environmentKey": jsii.String("environment"),
			},
			Framework: jsii.String("framework"),
			FrameworkVersion: jsii.String("frameworkVersion"),
			ImageDigest: jsii.String("imageDigest"),
			IsCheckpoint: jsii.Boolean(false),
			ModelInput: &ModelInputProperty{
				DataInputConfig: jsii.String("dataInputConfig"),
			},
			NearestModelName: jsii.String("nearestModelName"),
		},
	},

	// the properties below are optional
	SupportedContentTypes: []*string{
		jsii.String("supportedContentTypes"),
	},
	SupportedRealtimeInferenceInstanceTypes: []*string{
		jsii.String("supportedRealtimeInferenceInstanceTypes"),
	},
	SupportedResponseMimeTypes: []*string{
		jsii.String("supportedResponseMimeTypes"),
	},
	SupportedTransformInstanceTypes: []*string{
		jsii.String("supportedTransformInstanceTypes"),
	},
}
```

## Properties

- `containers`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnAlgorithm.ModelPackageContainerDefinitionProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnAlgorithm.ModelPackageContainerDefinitionProperty.html)[] (required)

- `supportedContentTypes`: string[]

- `supportedRealtimeInferenceInstanceTypes`: string[]

- `supportedResponseMimeTypes`: string[]

- `supportedTransformInstanceTypes`: string[]
