Amazon Bedrock

2025/06/16 - Amazon Bedrock - 1 new5 updated api methods

Changes  This release of the SDK has the API and documentation for the createcustommodel API. This feature lets you copy a Amazon SageMaker trained Amazon Nova model into Amazon Bedrock for inference.

CreateCustomModel (new) Link ¶

Creates a new custom model in Amazon Bedrock from an existing SageMaker AI-trained Amazon Nova model stored in an Amazon-managed Amazon S3 bucket. After the model is active, you can use it for inference.

To use the model for inference, you must purchase Provisioned Throughput for it. You can't use On-demand inference with these custom models. For more information about Provisioned Throughput, see Provisioned Throughput.

The model appears in ListCustomModels with a customizationType of imported. To track the status of the new model, you use the GetCustomModel API operation. The model can be in the following states:

  • Creating - Initial state during validation and registration

  • Active - Model is ready for use in inference

  • Failed - Creation process encountered an error

For more information about creating custom models, including specific model requirements, see Import a SageMaker AI-trained Amazon Nova model in the Amazon Bedrock User Guide.

Related APIs

See also: AWS API Documentation

Request Syntax

client.create_custom_model(
    modelName='string',
    modelSourceConfig={
        's3DataSource': {
            's3Uri': 'string'
        }
    },
    modelKmsKeyArn='string',
    roleArn='string',
    modelTags=[
        {
            'key': 'string',
            'value': 'string'
        },
    ],
    clientRequestToken='string'
)
type modelName:

string

param modelName:

[REQUIRED]

A unique name for the custom model.

type modelSourceConfig:

dict

param modelSourceConfig:

[REQUIRED]

The data source for the model. The Amazon S3 URI in the model source must be for the Amazon-managed Amazon S3 bucket containing your model artifacts. SageMaker AI creates this bucket when you run your first SageMaker AI training job.

  • s3DataSource (dict) --

    The Amazon S3 data source of the model to import.

    • s3Uri (string) -- [REQUIRED]

      The URI of the Amazon S3 data source.

type modelKmsKeyArn:

string

param modelKmsKeyArn:

The Amazon Resource Name (ARN) of the customer managed KMS key to encrypt the custom model. If you don't provide a KMS key, Amazon Bedrock uses an Amazon Web Services-managed KMS key to encrypt the model.

If you provide a customer managed KMS key, your Amazon Bedrock service role must have permissions to use it. For more information see Encryption of imported models.

type roleArn:

string

param roleArn:

The Amazon Resource Name (ARN) of an IAM service role that Amazon Bedrock assumes to perform tasks on your behalf. This role must have permissions to access the Amazon S3 bucket containing your model artifacts and the KMS key (if specified). For more information, see Setting up an IAM service role for importing models in the Amazon Bedrock User Guide.

type modelTags:

list

param modelTags:

A list of key-value pairs to associate with the custom model resource. You can use these tags to organize and identify your resources.

For more information, see Tagging resources in the Amazon Bedrock User Guide.

  • (dict) --

    Definition of the key/value pair for a tag.

    • key (string) -- [REQUIRED]

      Key for the tag.

    • value (string) -- [REQUIRED]

      Value for the tag.

type clientRequestToken:

string

param clientRequestToken:

A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.

This field is autopopulated if not provided.

rtype:

dict

returns:

Response Syntax

{
    'modelArn': 'string'
}

Response Structure

  • (dict) --

    • modelArn (string) --

      The Amazon Resource Name (ARN) of the new custom model.

CreateModelCustomizationJob (updated) Link ¶
Changes (request)
{'customizationType': {'IMPORTED'}}

Creates a fine-tuning job to customize a base model.

You specify the base foundation model and the location of the training data. After the model-customization job completes successfully, your custom model resource will be ready to use. Amazon Bedrock returns validation loss metrics and output generations after the job completes.

For information on the format of training and validation data, see Prepare the datasets.

Model-customization jobs are asynchronous and the completion time depends on the base model and the training/validation data size. To monitor a job, use the GetModelCustomizationJob operation to retrieve the job status.

For more information, see Custom models in the Amazon Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.create_model_customization_job(
    jobName='string',
    customModelName='string',
    roleArn='string',
    clientRequestToken='string',
    baseModelIdentifier='string',
    customizationType='FINE_TUNING'|'CONTINUED_PRE_TRAINING'|'DISTILLATION'|'IMPORTED',
    customModelKmsKeyId='string',
    jobTags=[
        {
            'key': 'string',
            'value': 'string'
        },
    ],
    customModelTags=[
        {
            'key': 'string',
            'value': 'string'
        },
    ],
    trainingDataConfig={
        's3Uri': 'string',
        'invocationLogsConfig': {
            'usePromptResponse': True|False,
            'invocationLogSource': {
                's3Uri': 'string'
            },
            'requestMetadataFilters': {
                'equals': {
                    'string': 'string'
                },
                'notEquals': {
                    'string': 'string'
                },
                'andAll': [
                    {
                        'equals': {
                            'string': 'string'
                        },
                        'notEquals': {
                            'string': 'string'
                        }
                    },
                ],
                'orAll': [
                    {
                        'equals': {
                            'string': 'string'
                        },
                        'notEquals': {
                            'string': 'string'
                        }
                    },
                ]
            }
        }
    },
    validationDataConfig={
        'validators': [
            {
                's3Uri': 'string'
            },
        ]
    },
    outputDataConfig={
        's3Uri': 'string'
    },
    hyperParameters={
        'string': 'string'
    },
    vpcConfig={
        'subnetIds': [
            'string',
        ],
        'securityGroupIds': [
            'string',
        ]
    },
    customizationConfig={
        'distillationConfig': {
            'teacherModelConfig': {
                'teacherModelIdentifier': 'string',
                'maxResponseLengthForInference': 123
            }
        }
    }
)
type jobName:

string

param jobName:

[REQUIRED]

A name for the fine-tuning job.

type customModelName:

string

param customModelName:

[REQUIRED]

A name for the resulting custom model.

type roleArn:

string

param roleArn:

[REQUIRED]

The Amazon Resource Name (ARN) of an IAM service role that Amazon Bedrock can assume to perform tasks on your behalf. For example, during model training, Amazon Bedrock needs your permission to read input data from an S3 bucket, write model artifacts to an S3 bucket. To pass this role to Amazon Bedrock, the caller of this API must have the iam:PassRole permission.

type clientRequestToken:

string

param clientRequestToken:

A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.

This field is autopopulated if not provided.

type baseModelIdentifier:

string

param baseModelIdentifier:

[REQUIRED]

Name of the base model.

type customizationType:

string

param customizationType:

The customization type.

type customModelKmsKeyId:

string

param customModelKmsKeyId:

The custom model is encrypted at rest using this key.

type jobTags:

list

param jobTags:

Tags to attach to the job.

  • (dict) --

    Definition of the key/value pair for a tag.

    • key (string) -- [REQUIRED]

      Key for the tag.

    • value (string) -- [REQUIRED]

      Value for the tag.

type customModelTags:

list

param customModelTags:

Tags to attach to the resulting custom model.

  • (dict) --

    Definition of the key/value pair for a tag.

    • key (string) -- [REQUIRED]

      Key for the tag.

    • value (string) -- [REQUIRED]

      Value for the tag.

type trainingDataConfig:

dict

param trainingDataConfig:

[REQUIRED]

Information about the training dataset.

  • s3Uri (string) --

    The S3 URI where the training data is stored.

  • invocationLogsConfig (dict) --

    Settings for using invocation logs to customize a model.

    • usePromptResponse (boolean) --

      Whether to use the model's response for training, or just the prompt. The default value is False.

    • invocationLogSource (dict) -- [REQUIRED]

      The source of the invocation logs.

      • s3Uri (string) --

        The URI of an invocation log in a bucket.

    • requestMetadataFilters (dict) --

      Rules for filtering invocation logs based on request metadata.

      • equals (dict) --

        Include results where the key equals the value.

        • (string) --

          • (string) --

      • notEquals (dict) --

        Include results where the key does not equal the value.

        • (string) --

          • (string) --

      • andAll (list) --

        Include results where all of the based filters match.

        • (dict) --

          A mapping of a metadata key to a value that it should or should not equal.

          • equals (dict) --

            Include results where the key equals the value.

            • (string) --

              • (string) --

          • notEquals (dict) --

            Include results where the key does not equal the value.

            • (string) --

              • (string) --

      • orAll (list) --

        Include results where any of the base filters match.

        • (dict) --

          A mapping of a metadata key to a value that it should or should not equal.

          • equals (dict) --

            Include results where the key equals the value.

            • (string) --

              • (string) --

          • notEquals (dict) --

            Include results where the key does not equal the value.

            • (string) --

              • (string) --

type validationDataConfig:

dict

param validationDataConfig:

Information about the validation dataset.

  • validators (list) -- [REQUIRED]

    Information about the validators.

    • (dict) --

      Information about a validator.

      • s3Uri (string) -- [REQUIRED]

        The S3 URI where the validation data is stored.

type outputDataConfig:

dict

param outputDataConfig:

[REQUIRED]

S3 location for the output data.

  • s3Uri (string) -- [REQUIRED]

    The S3 URI where the output data is stored.

type hyperParameters:

dict

param hyperParameters:

Parameters related to tuning the model. For details on the format for different models, see Custom model hyperparameters.

  • (string) --

    • (string) --

type vpcConfig:

dict

param vpcConfig:

The configuration of the Virtual Private Cloud (VPC) that contains the resources that you're using for this job. For more information, see Protect your model customization jobs using a VPC.

  • subnetIds (list) -- [REQUIRED]

    An array of IDs for each subnet in the VPC to use.

    • (string) --

  • securityGroupIds (list) -- [REQUIRED]

    An array of IDs for each security group in the VPC to use.

    • (string) --

type customizationConfig:

dict

param customizationConfig:

The customization configuration for the model customization job.

  • distillationConfig (dict) --

    The Distillation configuration for the custom model.

    • teacherModelConfig (dict) -- [REQUIRED]

      The teacher model configuration.

      • teacherModelIdentifier (string) -- [REQUIRED]

        The identifier of the teacher model.

      • maxResponseLengthForInference (integer) --

        The maximum number of tokens requested when the customization job invokes the teacher model.

rtype:

dict

returns:

Response Syntax

{
    'jobArn': 'string'
}

Response Structure

  • (dict) --

    • jobArn (string) --

      Amazon Resource Name (ARN) of the fine tuning job

GetCustomModel (updated) Link ¶
Changes (response)
{'customizationType': {'IMPORTED'},
 'failureMessage': 'string',
 'modelStatus': 'Active | Creating | Failed'}

Get the properties associated with a Amazon Bedrock custom model that you have created. For more information, see Custom models in the Amazon Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.get_custom_model(
    modelIdentifier='string'
)
type modelIdentifier:

string

param modelIdentifier:

[REQUIRED]

Name or Amazon Resource Name (ARN) of the custom model.

rtype:

dict

returns:

Response Syntax

{
    'modelArn': 'string',
    'modelName': 'string',
    'jobName': 'string',
    'jobArn': 'string',
    'baseModelArn': 'string',
    'customizationType': 'FINE_TUNING'|'CONTINUED_PRE_TRAINING'|'DISTILLATION'|'IMPORTED',
    'modelKmsKeyArn': 'string',
    'hyperParameters': {
        'string': 'string'
    },
    'trainingDataConfig': {
        's3Uri': 'string',
        'invocationLogsConfig': {
            'usePromptResponse': True|False,
            'invocationLogSource': {
                's3Uri': 'string'
            },
            'requestMetadataFilters': {
                'equals': {
                    'string': 'string'
                },
                'notEquals': {
                    'string': 'string'
                },
                'andAll': [
                    {
                        'equals': {
                            'string': 'string'
                        },
                        'notEquals': {
                            'string': 'string'
                        }
                    },
                ],
                'orAll': [
                    {
                        'equals': {
                            'string': 'string'
                        },
                        'notEquals': {
                            'string': 'string'
                        }
                    },
                ]
            }
        }
    },
    'validationDataConfig': {
        'validators': [
            {
                's3Uri': 'string'
            },
        ]
    },
    'outputDataConfig': {
        's3Uri': 'string'
    },
    'trainingMetrics': {
        'trainingLoss': ...
    },
    'validationMetrics': [
        {
            'validationLoss': ...
        },
    ],
    'creationTime': datetime(2015, 1, 1),
    'customizationConfig': {
        'distillationConfig': {
            'teacherModelConfig': {
                'teacherModelIdentifier': 'string',
                'maxResponseLengthForInference': 123
            }
        }
    },
    'modelStatus': 'Active'|'Creating'|'Failed',
    'failureMessage': 'string'
}

Response Structure

  • (dict) --

    • modelArn (string) --

      Amazon Resource Name (ARN) associated with this model.

    • modelName (string) --

      Model name associated with this model.

    • jobName (string) --

      Job name associated with this model.

    • jobArn (string) --

      Job Amazon Resource Name (ARN) associated with this model. For models that you create with the CreateCustomModel API operation, this is NULL.

    • baseModelArn (string) --

      Amazon Resource Name (ARN) of the base model.

    • customizationType (string) --

      The type of model customization.

    • modelKmsKeyArn (string) --

      The custom model is encrypted at rest using this key.

    • hyperParameters (dict) --

      Hyperparameter values associated with this model. For details on the format for different models, see Custom model hyperparameters.

      • (string) --

        • (string) --

    • trainingDataConfig (dict) --

      Contains information about the training dataset.

      • s3Uri (string) --

        The S3 URI where the training data is stored.

      • invocationLogsConfig (dict) --

        Settings for using invocation logs to customize a model.

        • usePromptResponse (boolean) --

          Whether to use the model's response for training, or just the prompt. The default value is False.

        • invocationLogSource (dict) --

          The source of the invocation logs.

          • s3Uri (string) --

            The URI of an invocation log in a bucket.

        • requestMetadataFilters (dict) --

          Rules for filtering invocation logs based on request metadata.

          • equals (dict) --

            Include results where the key equals the value.

            • (string) --

              • (string) --

          • notEquals (dict) --

            Include results where the key does not equal the value.

            • (string) --

              • (string) --

          • andAll (list) --

            Include results where all of the based filters match.

            • (dict) --

              A mapping of a metadata key to a value that it should or should not equal.

              • equals (dict) --

                Include results where the key equals the value.

                • (string) --

                  • (string) --

              • notEquals (dict) --

                Include results where the key does not equal the value.

                • (string) --

                  • (string) --

          • orAll (list) --

            Include results where any of the base filters match.

            • (dict) --

              A mapping of a metadata key to a value that it should or should not equal.

              • equals (dict) --

                Include results where the key equals the value.

                • (string) --

                  • (string) --

              • notEquals (dict) --

                Include results where the key does not equal the value.

                • (string) --

                  • (string) --

    • validationDataConfig (dict) --

      Contains information about the validation dataset.

      • validators (list) --

        Information about the validators.

        • (dict) --

          Information about a validator.

          • s3Uri (string) --

            The S3 URI where the validation data is stored.

    • outputDataConfig (dict) --

      Output data configuration associated with this custom model.

      • s3Uri (string) --

        The S3 URI where the output data is stored.

    • trainingMetrics (dict) --

      Contains training metrics from the job creation.

      • trainingLoss (float) --

        Loss metric associated with the custom job.

    • validationMetrics (list) --

      The validation metrics from the job creation.

      • (dict) --

        The metric for the validator.

        • validationLoss (float) --

          The validation loss associated with this validator.

    • creationTime (datetime) --

      Creation time of the model.

    • customizationConfig (dict) --

      The customization configuration for the custom model.

      • distillationConfig (dict) --

        The Distillation configuration for the custom model.

        • teacherModelConfig (dict) --

          The teacher model configuration.

          • teacherModelIdentifier (string) --

            The identifier of the teacher model.

          • maxResponseLengthForInference (integer) --

            The maximum number of tokens requested when the customization job invokes the teacher model.

    • modelStatus (string) --

      The current status of the custom model. Possible values include:

      • Creating - The model is being created and validated.

      • Active - The model has been successfully created and is ready for use.

      • Failed - The model creation process failed. Check the failureMessage field for details.

    • failureMessage (string) --

      A failure message for any issues that occurred when creating the custom model. This is included for only a failed CreateCustomModel operation.

GetModelCustomizationJob (updated) Link ¶
Changes (response)
{'customizationType': {'IMPORTED'}}

Retrieves the properties associated with a model-customization job, including the status of the job. For more information, see Custom models in the Amazon Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.get_model_customization_job(
    jobIdentifier='string'
)
type jobIdentifier:

string

param jobIdentifier:

[REQUIRED]

Identifier for the customization job.

rtype:

dict

returns:

Response Syntax

{
    'jobArn': 'string',
    'jobName': 'string',
    'outputModelName': 'string',
    'outputModelArn': 'string',
    'clientRequestToken': 'string',
    'roleArn': 'string',
    'status': 'InProgress'|'Completed'|'Failed'|'Stopping'|'Stopped',
    'statusDetails': {
        'validationDetails': {
            'status': 'InProgress'|'Completed'|'Stopping'|'Stopped'|'Failed'|'NotStarted',
            'creationTime': datetime(2015, 1, 1),
            'lastModifiedTime': datetime(2015, 1, 1)
        },
        'dataProcessingDetails': {
            'status': 'InProgress'|'Completed'|'Stopping'|'Stopped'|'Failed'|'NotStarted',
            'creationTime': datetime(2015, 1, 1),
            'lastModifiedTime': datetime(2015, 1, 1)
        },
        'trainingDetails': {
            'status': 'InProgress'|'Completed'|'Stopping'|'Stopped'|'Failed'|'NotStarted',
            'creationTime': datetime(2015, 1, 1),
            'lastModifiedTime': datetime(2015, 1, 1)
        }
    },
    'failureMessage': 'string',
    'creationTime': datetime(2015, 1, 1),
    'lastModifiedTime': datetime(2015, 1, 1),
    'endTime': datetime(2015, 1, 1),
    'baseModelArn': 'string',
    'hyperParameters': {
        'string': 'string'
    },
    'trainingDataConfig': {
        's3Uri': 'string',
        'invocationLogsConfig': {
            'usePromptResponse': True|False,
            'invocationLogSource': {
                's3Uri': 'string'
            },
            'requestMetadataFilters': {
                'equals': {
                    'string': 'string'
                },
                'notEquals': {
                    'string': 'string'
                },
                'andAll': [
                    {
                        'equals': {
                            'string': 'string'
                        },
                        'notEquals': {
                            'string': 'string'
                        }
                    },
                ],
                'orAll': [
                    {
                        'equals': {
                            'string': 'string'
                        },
                        'notEquals': {
                            'string': 'string'
                        }
                    },
                ]
            }
        }
    },
    'validationDataConfig': {
        'validators': [
            {
                's3Uri': 'string'
            },
        ]
    },
    'outputDataConfig': {
        's3Uri': 'string'
    },
    'customizationType': 'FINE_TUNING'|'CONTINUED_PRE_TRAINING'|'DISTILLATION'|'IMPORTED',
    'outputModelKmsKeyArn': 'string',
    'trainingMetrics': {
        'trainingLoss': ...
    },
    'validationMetrics': [
        {
            'validationLoss': ...
        },
    ],
    'vpcConfig': {
        'subnetIds': [
            'string',
        ],
        'securityGroupIds': [
            'string',
        ]
    },
    'customizationConfig': {
        'distillationConfig': {
            'teacherModelConfig': {
                'teacherModelIdentifier': 'string',
                'maxResponseLengthForInference': 123
            }
        }
    }
}

Response Structure

  • (dict) --

    • jobArn (string) --

      The Amazon Resource Name (ARN) of the customization job.

    • jobName (string) --

      The name of the customization job.

    • outputModelName (string) --

      The name of the output model.

    • outputModelArn (string) --

      The Amazon Resource Name (ARN) of the output model.

    • clientRequestToken (string) --

      The token that you specified in the CreateCustomizationJob request.

    • roleArn (string) --

      The Amazon Resource Name (ARN) of the IAM role.

    • status (string) --

      The status of the job. A successful job transitions from in-progress to completed when the output model is ready to use. If the job failed, the failure message contains information about why the job failed.

    • statusDetails (dict) --

      For a Distillation job, the details about the statuses of the sub-tasks of the customization job.

      • validationDetails (dict) --

        The status details for the validation sub-task of the job.

        • status (string) --

          The status of the validation sub-task of the job.

        • creationTime (datetime) --

          The start time of the validation sub-task of the job.

        • lastModifiedTime (datetime) --

          The latest update to the validation sub-task of the job.

      • dataProcessingDetails (dict) --

        The status details for the data processing sub-task of the job.

        • status (string) --

          The status of the data processing sub-task of the job.

        • creationTime (datetime) --

          The start time of the data processing sub-task of the job.

        • lastModifiedTime (datetime) --

          The latest update to the data processing sub-task of the job.

      • trainingDetails (dict) --

        The status details for the training sub-task of the job.

        • status (string) --

          The status of the training sub-task of the job.

        • creationTime (datetime) --

          The start time of the training sub-task of the job.

        • lastModifiedTime (datetime) --

          The latest update to the training sub-task of the job.

    • failureMessage (string) --

      Information about why the job failed.

    • creationTime (datetime) --

      Time that the resource was created.

    • lastModifiedTime (datetime) --

      Time that the resource was last modified.

    • endTime (datetime) --

      Time that the resource transitioned to terminal state.

    • baseModelArn (string) --

      Amazon Resource Name (ARN) of the base model.

    • hyperParameters (dict) --

      The hyperparameter values for the job. For details on the format for different models, see Custom model hyperparameters.

      • (string) --

        • (string) --

    • trainingDataConfig (dict) --

      Contains information about the training dataset.

      • s3Uri (string) --

        The S3 URI where the training data is stored.

      • invocationLogsConfig (dict) --

        Settings for using invocation logs to customize a model.

        • usePromptResponse (boolean) --

          Whether to use the model's response for training, or just the prompt. The default value is False.

        • invocationLogSource (dict) --

          The source of the invocation logs.

          • s3Uri (string) --

            The URI of an invocation log in a bucket.

        • requestMetadataFilters (dict) --

          Rules for filtering invocation logs based on request metadata.

          • equals (dict) --

            Include results where the key equals the value.

            • (string) --

              • (string) --

          • notEquals (dict) --

            Include results where the key does not equal the value.

            • (string) --

              • (string) --

          • andAll (list) --

            Include results where all of the based filters match.

            • (dict) --

              A mapping of a metadata key to a value that it should or should not equal.

              • equals (dict) --

                Include results where the key equals the value.

                • (string) --

                  • (string) --

              • notEquals (dict) --

                Include results where the key does not equal the value.

                • (string) --

                  • (string) --

          • orAll (list) --

            Include results where any of the base filters match.

            • (dict) --

              A mapping of a metadata key to a value that it should or should not equal.

              • equals (dict) --

                Include results where the key equals the value.

                • (string) --

                  • (string) --

              • notEquals (dict) --

                Include results where the key does not equal the value.

                • (string) --

                  • (string) --

    • validationDataConfig (dict) --

      Contains information about the validation dataset.

      • validators (list) --

        Information about the validators.

        • (dict) --

          Information about a validator.

          • s3Uri (string) --

            The S3 URI where the validation data is stored.

    • outputDataConfig (dict) --

      Output data configuration

      • s3Uri (string) --

        The S3 URI where the output data is stored.

    • customizationType (string) --

      The type of model customization.

    • outputModelKmsKeyArn (string) --

      The custom model is encrypted at rest using this key.

    • trainingMetrics (dict) --

      Contains training metrics from the job creation.

      • trainingLoss (float) --

        Loss metric associated with the custom job.

    • validationMetrics (list) --

      The loss metric for each validator that you provided in the createjob request.

      • (dict) --

        The metric for the validator.

        • validationLoss (float) --

          The validation loss associated with this validator.

    • vpcConfig (dict) --

      VPC configuration for the custom model job.

      • subnetIds (list) --

        An array of IDs for each subnet in the VPC to use.

        • (string) --

      • securityGroupIds (list) --

        An array of IDs for each security group in the VPC to use.

        • (string) --

    • customizationConfig (dict) --

      The customization configuration for the model customization job.

      • distillationConfig (dict) --

        The Distillation configuration for the custom model.

        • teacherModelConfig (dict) --

          The teacher model configuration.

          • teacherModelIdentifier (string) --

            The identifier of the teacher model.

          • maxResponseLengthForInference (integer) --

            The maximum number of tokens requested when the customization job invokes the teacher model.

ListCustomModels (updated) Link ¶
Changes (request, response)
Request
{'modelStatus': 'Active | Creating | Failed'}
Response
{'modelSummaries': {'customizationType': {'IMPORTED'},
                    'modelStatus': 'Active | Creating | Failed'}}

Returns a list of the custom models that you have created with the CreateModelCustomizationJob operation.

For more information, see Custom models in the Amazon Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.list_custom_models(
    creationTimeBefore=datetime(2015, 1, 1),
    creationTimeAfter=datetime(2015, 1, 1),
    nameContains='string',
    baseModelArnEquals='string',
    foundationModelArnEquals='string',
    maxResults=123,
    nextToken='string',
    sortBy='CreationTime',
    sortOrder='Ascending'|'Descending',
    isOwned=True|False,
    modelStatus='Active'|'Creating'|'Failed'
)
type creationTimeBefore:

datetime

param creationTimeBefore:

Return custom models created before the specified time.

type creationTimeAfter:

datetime

param creationTimeAfter:

Return custom models created after the specified time.

type nameContains:

string

param nameContains:

Return custom models only if the job name contains these characters.

type baseModelArnEquals:

string

param baseModelArnEquals:

Return custom models only if the base model Amazon Resource Name (ARN) matches this parameter.

type foundationModelArnEquals:

string

param foundationModelArnEquals:

Return custom models only if the foundation model Amazon Resource Name (ARN) matches this parameter.

type maxResults:

integer

param maxResults:

The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

type nextToken:

string

param nextToken:

If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

type sortBy:

string

param sortBy:

The field to sort by in the returned list of models.

type sortOrder:

string

param sortOrder:

The sort order of the results.

type isOwned:

boolean

param isOwned:

Return custom models depending on if the current account owns them ( true) or if they were shared with the current account ( false).

type modelStatus:

string

param modelStatus:

The status of them model to filter results by. Possible values include:

  • Creating - Include only models that are currently being created and validated.

  • Active - Include only models that have been successfully created and are ready for use.

  • Failed - Include only models where the creation process failed.

If you don't specify a status, the API returns models in all states.

rtype:

dict

returns:

Response Syntax

{
    'nextToken': 'string',
    'modelSummaries': [
        {
            'modelArn': 'string',
            'modelName': 'string',
            'creationTime': datetime(2015, 1, 1),
            'baseModelArn': 'string',
            'baseModelName': 'string',
            'customizationType': 'FINE_TUNING'|'CONTINUED_PRE_TRAINING'|'DISTILLATION'|'IMPORTED',
            'ownerAccountId': 'string',
            'modelStatus': 'Active'|'Creating'|'Failed'
        },
    ]
}

Response Structure

  • (dict) --

    • nextToken (string) --

      If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

    • modelSummaries (list) --

      Model summaries.

      • (dict) --

        Summary information for a custom model.

        • modelArn (string) --

          The Amazon Resource Name (ARN) of the custom model.

        • modelName (string) --

          The name of the custom model.

        • creationTime (datetime) --

          Creation time of the model.

        • baseModelArn (string) --

          The base model Amazon Resource Name (ARN).

        • baseModelName (string) --

          The base model name.

        • customizationType (string) --

          Specifies whether to carry out continued pre-training of a model or whether to fine-tune it. For more information, see Custom models.

        • ownerAccountId (string) --

          The unique identifier of the account that owns the model.

        • modelStatus (string) --

          The current status of the custom model. Possible values include:

          • Creating - The model is being created and validated.

          • Active - The model has been successfully created and is ready for use.

          • Failed - The model creation process failed.

ListModelCustomizationJobs (updated) Link ¶
Changes (response)
{'modelCustomizationJobSummaries': {'customizationType': {'IMPORTED'}}}

Returns a list of model customization jobs that you have submitted. You can filter the jobs to return based on one or more criteria.

For more information, see Custom models in the Amazon Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.list_model_customization_jobs(
    creationTimeAfter=datetime(2015, 1, 1),
    creationTimeBefore=datetime(2015, 1, 1),
    statusEquals='InProgress'|'Completed'|'Failed'|'Stopping'|'Stopped',
    nameContains='string',
    maxResults=123,
    nextToken='string',
    sortBy='CreationTime',
    sortOrder='Ascending'|'Descending'
)
type creationTimeAfter:

datetime

param creationTimeAfter:

Return customization jobs created after the specified time.

type creationTimeBefore:

datetime

param creationTimeBefore:

Return customization jobs created before the specified time.

type statusEquals:

string

param statusEquals:

Return customization jobs with the specified status.

type nameContains:

string

param nameContains:

Return customization jobs only if the job name contains these characters.

type maxResults:

integer

param maxResults:

The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

type nextToken:

string

param nextToken:

If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

type sortBy:

string

param sortBy:

The field to sort by in the returned list of jobs.

type sortOrder:

string

param sortOrder:

The sort order of the results.

rtype:

dict

returns:

Response Syntax

{
    'nextToken': 'string',
    'modelCustomizationJobSummaries': [
        {
            'jobArn': 'string',
            'baseModelArn': 'string',
            'jobName': 'string',
            'status': 'InProgress'|'Completed'|'Failed'|'Stopping'|'Stopped',
            'statusDetails': {
                'validationDetails': {
                    'status': 'InProgress'|'Completed'|'Stopping'|'Stopped'|'Failed'|'NotStarted',
                    'creationTime': datetime(2015, 1, 1),
                    'lastModifiedTime': datetime(2015, 1, 1)
                },
                'dataProcessingDetails': {
                    'status': 'InProgress'|'Completed'|'Stopping'|'Stopped'|'Failed'|'NotStarted',
                    'creationTime': datetime(2015, 1, 1),
                    'lastModifiedTime': datetime(2015, 1, 1)
                },
                'trainingDetails': {
                    'status': 'InProgress'|'Completed'|'Stopping'|'Stopped'|'Failed'|'NotStarted',
                    'creationTime': datetime(2015, 1, 1),
                    'lastModifiedTime': datetime(2015, 1, 1)
                }
            },
            'lastModifiedTime': datetime(2015, 1, 1),
            'creationTime': datetime(2015, 1, 1),
            'endTime': datetime(2015, 1, 1),
            'customModelArn': 'string',
            'customModelName': 'string',
            'customizationType': 'FINE_TUNING'|'CONTINUED_PRE_TRAINING'|'DISTILLATION'|'IMPORTED'
        },
    ]
}

Response Structure

  • (dict) --

    • nextToken (string) --

      If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

    • modelCustomizationJobSummaries (list) --

      Job summaries.

      • (dict) --

        Information about one customization job

        • jobArn (string) --

          Amazon Resource Name (ARN) of the customization job.

        • baseModelArn (string) --

          Amazon Resource Name (ARN) of the base model.

        • jobName (string) --

          Name of the customization job.

        • status (string) --

          Status of the customization job.

        • statusDetails (dict) --

          Details about the status of the data processing sub-task of the job.

          • validationDetails (dict) --

            The status details for the validation sub-task of the job.

            • status (string) --

              The status of the validation sub-task of the job.

            • creationTime (datetime) --

              The start time of the validation sub-task of the job.

            • lastModifiedTime (datetime) --

              The latest update to the validation sub-task of the job.

          • dataProcessingDetails (dict) --

            The status details for the data processing sub-task of the job.

            • status (string) --

              The status of the data processing sub-task of the job.

            • creationTime (datetime) --

              The start time of the data processing sub-task of the job.

            • lastModifiedTime (datetime) --

              The latest update to the data processing sub-task of the job.

          • trainingDetails (dict) --

            The status details for the training sub-task of the job.

            • status (string) --

              The status of the training sub-task of the job.

            • creationTime (datetime) --

              The start time of the training sub-task of the job.

            • lastModifiedTime (datetime) --

              The latest update to the training sub-task of the job.

        • lastModifiedTime (datetime) --

          Time that the customization job was last modified.

        • creationTime (datetime) --

          Creation time of the custom model.

        • endTime (datetime) --

          Time that the customization job ended.

        • customModelArn (string) --

          Amazon Resource Name (ARN) of the custom model.

        • customModelName (string) --

          Name of the custom model.

        • customizationType (string) --

          Specifies whether to carry out continued pre-training of a model or whether to fine-tune it. For more information, see Custom models.