createProvisionedModelThroughput method
Creates dedicated throughput for a base or custom model with the model units and for the duration that you specify. For pricing details, see Amazon Bedrock Pricing. For more information, see Provisioned Throughput in the Amazon Bedrock User Guide.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw TooManyTagsException.
May throw ValidationException.
Parameter modelId :
The Amazon Resource Name (ARN) or name of the model to associate with this
Provisioned Throughput. For a list of models for which you can purchase
Provisioned Throughput, see Amazon
Bedrock model IDs for purchasing Provisioned Throughput in the Amazon
Bedrock User Guide.
Parameter modelUnits :
Number of model units to allocate. A model unit delivers a specific
throughput level for the specified model. The throughput level of a model
unit specifies the total number of input and output tokens that it can
process and generate within a span of one minute. By default, your account
has no model units for purchasing Provisioned Throughputs with commitment.
You must first visit the Amazon
Web Services support center to request MUs.
For model unit quotas, see Provisioned Throughput quotas in the Amazon Bedrock User Guide.
For more information about what an MU specifies, contact your Amazon Web Services account manager.
Parameter provisionedModelName :
The name for this Provisioned Throughput.
Parameter 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 in the Amazon S3 User Guide.
Parameter commitmentDuration :
The commitment duration requested for the Provisioned Throughput. Billing
occurs hourly and is discounted for longer commitment terms. To request a
no-commit Provisioned Throughput, omit this field.
Custom models support all levels of commitment. To see which base models support no commitment, see Supported regions and models for Provisioned Throughput in the Amazon Bedrock User Guide
Parameter tags :
Tags to associate with this Provisioned Throughput.
Implementation
Future<CreateProvisionedModelThroughputResponse>
createProvisionedModelThroughput({
required String modelId,
required int modelUnits,
required String provisionedModelName,
String? clientRequestToken,
CommitmentDuration? commitmentDuration,
List<Tag>? tags,
}) async {
_s.validateNumRange(
'modelUnits',
modelUnits,
1,
1152921504606846976,
isRequired: true,
);
final $payload = <String, dynamic>{
'modelId': modelId,
'modelUnits': modelUnits,
'provisionedModelName': provisionedModelName,
'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
if (commitmentDuration != null)
'commitmentDuration': commitmentDuration.value,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/provisioned-model-throughput',
exceptionFnMap: _exceptionFns,
);
return CreateProvisionedModelThroughputResponse.fromJson(response);
}