Skip to content

create_provisioned_model_throughput async

create_provisioned_model_throughput(
    model_units: PositiveInteger,
    provisioned_model_name: ProvisionedModelName,
    model_id: ModelIdentifier,
    *,
    config_overrides: Optional[AsyncBedrockClientConfig] = None,
    client_request_token: Optional[IdempotencyToken] = None,
    commitment_duration: Optional[CommitmentDuration] = None,
    tags: Optional[TagList] = None,
) -> CreateProvisionedModelThroughputResponse

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.

Parameters:

  • client_request_token (Optional[IdempotencyToken], default: None ) –

    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.

  • model_units (PositiveInteger) –

    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.

  • provisioned_model_name (ProvisionedModelName) –

    The name for this Provisioned Throughput.

  • model_id (ModelIdentifier) –

    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.

  • commitment_duration (Optional[CommitmentDuration], default: None ) –

    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

  • tags (Optional[TagList], default: None ) –

    Tags to associate with this Provisioned Throughput.

Raises:

  • AccessDeniedException –

    The request is denied because of missing access permissions.

  • InternalServerException –

    An internal server error occurred. Retry your request.

  • ResourceNotFoundException –

    The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.

  • ServiceQuotaExceededException –

    The number of requests exceeds the service quota. Resubmit your request later.

  • ThrottlingException –

    The number of requests exceeds the limit. Resubmit your request later.

  • TooManyTagsException –

    The request contains more tags than can be associated with a resource (50 tags per resource). The maximum number of tags includes both existing tags and those included in your current request.

  • ValidationException –

    Input validation failed. Check your request parameters and retry the request.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_bedrock/_services/async_bedrock.py
async def create_provisioned_model_throughput(
    self,
    model_units: "capo_bedrock.types.positive_integer.PositiveInteger",
    provisioned_model_name: "capo_bedrock.types.provisioned_model_name.ProvisionedModelName",
    model_id: "capo_bedrock.types.model_identifier.ModelIdentifier",
    *,
    config_overrides: Optional[AsyncBedrockClientConfig] = None,
    client_request_token: Optional[
        "capo_bedrock.types.idempotency_token.IdempotencyToken"
    ] = None,
    commitment_duration: Optional[
        "capo_bedrock.types.commitment_duration.CommitmentDuration"
    ] = None,
    tags: Optional["capo_bedrock.types.tag_list.TagList"] = None,
) -> "capo_bedrock.types.create_provisioned_model_throughput_response.CreateProvisionedModelThroughputResponse":
    """<p>Creates dedicated throughput for a base or custom model with the model units and for the duration that you specify. For pricing details, see <a href="http://aws.amazon.com/bedrock/pricing/">Amazon Bedrock Pricing</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html">Provisioned Throughput</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a>.</p>

    Args:
        client_request_token: <p>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 <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the Amazon S3 User Guide.</p>
        model_units: <p>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 <a href="https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase">Amazon Web Services support center</a> to request MUs.</p> <p>For model unit quotas, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html#prov-thru-quotas">Provisioned Throughput quotas</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a>.</p> <p>For more information about what an MU specifies, contact your Amazon Web Services account manager.</p>
        provisioned_model_name: <p>The name for this Provisioned Throughput.</p>
        model_id: <p>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 <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#prov-throughput-models">Amazon Bedrock model IDs for purchasing Provisioned Throughput</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a>.</p>
        commitment_duration: <p>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.</p> <p>Custom models support all levels of commitment. To see which base models support no commitment, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/pt-supported.html">Supported regions and models for Provisioned Throughput</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a> </p>
        tags: <p>Tags to associate with this Provisioned Throughput.</p>

    Raises:
        capo_bedrock.errors.access_denied_exception.AccessDeniedException: <p>The request is denied because of missing access permissions.</p>
        capo_bedrock.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_bedrock.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.</p>
        capo_bedrock.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The number of requests exceeds the service quota. Resubmit your request later.</p>
        capo_bedrock.errors.throttling_exception.ThrottlingException: <p>The number of requests exceeds the limit. Resubmit your request later.</p>
        capo_bedrock.errors.too_many_tags_exception.TooManyTagsException: <p>The request contains more tags than can be associated with a resource (50 tags per resource). The maximum number of tags includes both existing tags and those included in your current request. </p>
        capo_bedrock.errors.validation_exception.ValidationException: <p>Input validation failed. Check your request parameters and retry the request.</p>
        capo_bedrock.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_bedrock.types.create_provisioned_model_throughput_request.CreateProvisionedModelThroughputRequest]",
    ) -> AsyncOperationResponse[
        "capo_bedrock.types.create_provisioned_model_throughput_response.CreateProvisionedModelThroughputResponse"
    ]:
        import capo_bedrock._operations.amazon_bedrock_control_plane_service.create_provisioned_model_throughput

        (
            output,
            http_response,
        ) = await capo_bedrock._operations.amazon_bedrock_control_plane_service.create_provisioned_model_throughput.async_create_provisioned_model_throughput(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateProvisionedModelThroughput")
    )
    input_: capo_bedrock.types.create_provisioned_model_throughput_request.CreateProvisionedModelThroughputRequest = {
        "model_units": model_units,
        "provisioned_model_name": provisioned_model_name,
        "model_id": model_id,
    }
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token
    if commitment_duration is not None:
        input_["commitment_duration"] = commitment_duration
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output