createCustomModel
inline suspend fun BedrockClient.createCustomModel(crossinline block: CreateCustomModelRequest.Builder.() -> Unit): CreateCustomModelResponse
Creates a new custom model in Amazon Bedrock. 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 registrationActive
- Model is ready for use in inferenceFailed
- Creation process encountered an error
Related APIs
Samples
import aws.sdk.kotlin.services.bedrock.model.ModelDataSource
import aws.sdk.kotlin.services.bedrock.model.S3DataSource
import aws.sdk.kotlin.services.bedrock.model.Tag
fun main() {
//sampleStart
// Successful CreateCustomModel API call
val resp = bedrockClient.createCustomModel {
modelName = "SampleModel"
modelSourceConfig = ModelDataSource.S3DataSource(S3DataSource {
s3Uri = "s3://my-bucket/folder"
}
)
roleArn = "arn:aws:iam::123456789012:role/SampleRole"
modelKmsKeyArn = "arn:aws:kms:us-east-1:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab"
modelTags = listOf<Tag>(
Tag {
key = "foo"
value = "foo"
},
Tag {
key = "foo"
value = "foo"
}
)
clientRequestToken = "foo"
}
//sampleEnd
}