Custom Models
Custom models let users customize the Amazon Bedrock base models according to their use case. Users can create custom models by running a customization job on top of the base models. They have to provide the data that is to be used and the parameters for the customization job.
How to create a custom model?
Users can make use of the POST /custom-models API call to create a custom model. The payload for the request is as follows:
{
"ModelName": "YourModelName",
"ModelType": "FINE_TUNING",
"BaseModelId": "Your Base Model Id",
"Description": "Your Model Description",
"TrainingDataLocation": "S3 Path that holds your training data",
"ValidationDataLocation": "S3 Path that holds your validation data",
"HyperParameters": {
"param-name1": "param-value1",
"param-name2": "param-value2"
}
}
ModelName: This is the name of the custom model.
ModelType: This refers to the type of customization you want to perform on the base model. The supported values are: FINE_TUNING.
BaseModelId: This is the model id of the base model you want to use.
Description: Description for the custom model.
TrainingDataLocation: The S3 path where your training data is stored.
ValidationDataLocation: The S3 path where your validation data is stored. This is optional. The data format to be used for the customization can be found here
HyperParameters: The hyper parameters to be used in the customization job. The hyper parameters supported for each base model can be found here
Once the POST request is sent, the model status is set to Pending and the customization job is triggered. Once it is complete, the model status will be set to Complete.
Listing custom models
To list the custom models, users can use the GET /custom-models API.
Getting details of a custom model
To get the details of a custom model, users can use the GET /custom-models/{id} API.
Download model data
Users can download the model training metrics as well as the training and validation data provided to it. For this, users can make use of the GET /custom-models/{id}/download?type=metrics/validation/training.
Deleting a custom model
To delete a custom model, users can use the DELETE /custom-models/{id} API.
Provisioned throughput
To use a custom model, users have to provision throughput for it. To provision throughput, users can make use of the PUT /custom-models/{id}/throughput API. Only no commitment throughput can be provisioned through this API. For more information regarding provisioned throughput, refer the Amazon Bedrock Documentation here.
To delete a provisioned throughput, users can make use of the DELETE /custom-models/{id}/throughput API.
Pricing
There are 3 costs associated with model customization:
- Price to train 1,000 tokens
- Price to store each custom model per month
- Price to infer from a custom model per model unit per hour
Please refer to the AWS documentation to get the details regarding pricing for customizing individual base models.