Skip to content

Bedrock  >  Operations  >  create_model_customization_job

create_model_customization_job

Operation

create_model_customization_job async

create_model_customization_job(input: CreateModelCustomizationJobInput, plugins: list[Plugin] | None = None) -> CreateModelCustomizationJobOutput

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.

Parameters:

Name Type Description Default
input CreateModelCustomizationJobInput

An instance of CreateModelCustomizationJobInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
CreateModelCustomizationJobOutput

An instance of CreateModelCustomizationJobOutput.

Input

CreateModelCustomizationJobInput dataclass

Dataclass for CreateModelCustomizationJobInput structure.

Attributes

base_model_identifier class-attribute instance-attribute
base_model_identifier: str | None = None

Name of the base model.

client_request_token class-attribute instance-attribute
client_request_token: str | None = None

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.

custom_model_kms_key_id class-attribute instance-attribute
custom_model_kms_key_id: str | None = None

The custom model is encrypted at rest using this key.

custom_model_name class-attribute instance-attribute
custom_model_name: str | None = None

A name for the resulting custom model.

custom_model_tags class-attribute instance-attribute
custom_model_tags: list[Tag] | None = None

Tags to attach to the resulting custom model.

customization_config class-attribute instance-attribute
customization_config: CustomizationConfig | None = None

The customization configuration for the model customization job.

customization_type class-attribute instance-attribute
customization_type: CustomizationType | None = None

The customization type.

hyper_parameters class-attribute instance-attribute
hyper_parameters: dict[str, str] | None = None

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

job_name class-attribute instance-attribute
job_name: str | None = None

A name for the fine-tuning job.

job_tags class-attribute instance-attribute
job_tags: list[Tag] | None = None

Tags to attach to the job.

output_data_config class-attribute instance-attribute
output_data_config: OutputDataConfig | None = None

S3 location for the output data.

role_arn class-attribute instance-attribute
role_arn: str | None = None

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.

training_data_config class-attribute instance-attribute
training_data_config: TrainingDataConfig | None = None

Information about the training dataset.

validation_data_config class-attribute instance-attribute
validation_data_config: ValidationDataConfig | None = None

Information about the validation dataset.

vpc_config class-attribute instance-attribute
vpc_config: VpcConfig | None = None

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.

Output

CreateModelCustomizationJobOutput dataclass

Dataclass for CreateModelCustomizationJobOutput structure.

Attributes

job_arn instance-attribute
job_arn: str

Amazon Resource Name (ARN) of the fine tuning job