Skip to content

Create Model Customization Job

bedrock_create_model_customization_job R Documentation

Creates a fine-tuning job to customize a base model

Description

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 get_model_customization_job operation to retrieve the job status.

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

Usage

bedrock_create_model_customization_job(jobName, customModelName,
  roleArn, clientRequestToken, baseModelIdentifier, customizationType,
  customModelKmsKeyId, jobTags, customModelTags, trainingDataConfig,
  validationDataConfig, outputDataConfig, hyperParameters, vpcConfig)

Arguments

jobName

[required] A name for the fine-tuning job.

customModelName

[required] A name for the resulting custom model.

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.

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.

baseModelIdentifier

[required] Name of the base model.

customizationType

The customization type.

customModelKmsKeyId

The custom model is encrypted at rest using this key.

jobTags

Tags to attach to the job.

customModelTags

Tags to attach to the resulting custom model.

trainingDataConfig

[required] Information about the training dataset.

validationDataConfig

Information about the validation dataset.

outputDataConfig

[required] S3 location for the output data.

hyperParameters

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

vpcConfig

VPC configuration (optional). Configuration parameters for the private Virtual Private Cloud (VPC) that contains the resources you are using for this job.

Value

A list with the following syntax:

list(
  jobArn = "string"
)

Request syntax

svc$create_model_customization_job(
  jobName = "string",
  customModelName = "string",
  roleArn = "string",
  clientRequestToken = "string",
  baseModelIdentifier = "string",
  customizationType = "FINE_TUNING"|"CONTINUED_PRE_TRAINING",
  customModelKmsKeyId = "string",
  jobTags = list(
    list(
      key = "string",
      value = "string"
    )
  ),
  customModelTags = list(
    list(
      key = "string",
      value = "string"
    )
  ),
  trainingDataConfig = list(
    s3Uri = "string"
  ),
  validationDataConfig = list(
    validators = list(
      list(
        s3Uri = "string"
      )
    )
  ),
  outputDataConfig = list(
    s3Uri = "string"
  ),
  hyperParameters = list(
    "string"
  ),
  vpcConfig = list(
    subnetIds = list(
      "string"
    ),
    securityGroupIds = list(
      "string"
    )
  )
)