You can create a custom model by using Fine-tuning or Continued Pre-training in the Amazon Bedrock console or API. The customization job can take several hours. The duration of the job depends on the size of the training data (number of records, input tokens, and output tokens), number of epochs, and batch size.
Prerequisites
-
Create an AWS Identity and Access Management (IAM) service role to access the S3 bucket where you want to store your model customization training and validation data. You can create this role automatically by using the AWS Management Console or manually. For more information on the manual option, see Create an IAM service role for model customization.
-
(Optional) Encrypt input and output data, your customization job, or inference requests made to custom models. For more information, see Encryption of model customization jobs and artifacts.
-
(Optional) Create a virtual private cloud (VPC) to protect your customization job. For more information, see (Optional) Protect your model customization jobs using a VPC.
Submit your job
Choose the tab for your preferred method, and then follow the steps:
To submit a model customization job in the console, carry out the following steps.
-
Sign in to the AWS Management Console using an IAM role with Amazon Bedrock permissions, and open the Amazon Bedrock console at https://console.aws.amazon.com/bedrock/
. -
From the left navigation pane, choose Custom models under Foundation models.
-
In the Models tab, choose Customize model and then Create Fine-tuning job or Create Continued Pre-training job, depending on the type of model you want to train.
-
In the Model details section, do the following.
-
Choose the model that you want to customize with your own data and give your resulting model a name.
-
(Optional) By default, Amazon Bedrock encrypts your model with a key owned and managed by AWS. To use a custom KMS key, select Model encryption and choose a key.
-
(Optional) To associate tags with the custom model, expand the Tags section and select Add new tag.
-
-
In the Job configuration section, enter a name for the job and optionally add any tags to associate with the job.
-
(Optional) To use a virtual private cloud (VPC) to protect your training data and customization job, select a VPC that contains the input data and output data Amazon S3 locations, its subnets, and security groups in the VPC settings section.
Note
If you include a VPC configuration, the console cannot create a new service role for the job. Create a custom service role and add permissions similar to the example described in Attach VPC permissions to a model customization role.
-
In the Input data section, select the S3 location of the training dataset file and, if applicable, the validation dataset file.
-
In the Hyperparameters section, input values for hyperparameters to use in training.
-
In the Output data section, enter the Amazon S3 location where Amazon Bedrock should save the output of the job. Amazon Bedrock stores the training loss metrics and validation loss metrics for each epoch in separate files in the location that you specify.
-
In the Service access section, select one of the following:
-
Use an existing service role – Select a service role from the dropdown list. For more information on setting up a custom role with the appropriate permissions, see Create a service role for model customization.
-
Create and use a new service role – Enter a name for the service role.
-
-
Choose Fine-tune model or Create Continued Pre-training job to begin the job.