How not to break the bank while using Amazon Bedrock?

VijayaNirmalaGopal - Aug 15 - - Dev Community

Welcome to an interesting post on how to be wise in using the most happening concept of the era - AI !!

Amazon Bedrock is a fully managed service which provides the use of Foundation Models, which is used to build generative AI applications in AWS. Just not using the available "Foundation Models" but you can customize models with your own data set(that you could store in S3) too. Best part is that Amazon Bedrock is Serverless !! Whoa !!!

Now, as exciting as it sounds, before you use Amazon Bedrock, in order to develop & create new applications to generate images, prompts, suggestions based on customer experience, product recommendations, it is always good to be known about the cost aspects involved here. Let us explore the aspects against which the Amazon Bedrock is charged at.

To start with,

1) Firstly, you need to identify & decide the right AWS Region that will be used for developing Amazon Bedrock Applications

2) Secondly, few Titan models have been listed(as of this blog post time of creation) and select according to the requirement

3) Thirdly, feed in the "Input Tokens" and/or "Output Tokens" as according to the model that will be used in your use case

Input Token: is the basic unit of text used by the Model(selected) in order to understand the user input to prompt

Output Token: is again, charges applied for every text prompted out for text generating model selection(s)

4) Then comes, "Model Customization"; feed in the data, if you need Model customization using custom data set. Here again, the customization of cost is impacted with two factors which is no. of tokens in the data store & no. of epochs that will be fed in

5) Next is the "Customization - Storage" which is about storing your model

6) Lastly, the "Provisioned Throughput" section which is the pricing details break up based on "Model Customized", "Billing-term commitment" & "Billed hours/month"

Now this derived your total cost of using Amazon Bedrock. Let us see options against the key areas like Model, Tokens, Customization, Storage & Throughput ! Gear up for the details folks !!

1) To start with, we name the estimate sheet & select the AWS Region(which are the basics)

Image description

2) Next aspect is to estimate the Model to be used; let us see all Titan models listed for estimate

Note: I use '1' for evaluating parameters like token(s) & highest Unit to understand base cost

Units: is the measure of pricing for Input/Output tokens. Classified as per month, thousand per month, million per month

Titan Lite

Lite holds base cost as below:
Image description

Titan Express

Now let us see, the cost for express

Image description

Titan Text Embeddings
There is no "Storage, Modernization or Provisioned Throughput' estimate on selecting this model and the cost is as below:

Image description

Titan Multimodal Embeddings

Here, the input tokens & input images are fed as evaluators as there are no output tokens for embedding model

Image description

Titan Image Generator

Standard & Premium are the two types of image generation available with 1024*1024 & 512*512 as image dimensions

Image description

3) Third in order, let us estimate the Model customization

Input tokens & Epochs involved being the key deciding factors, below are the charges

Image description

4) Fourth in line, let us estimate the customized Model storage

For one custom model storage, costs are as below

Image description

5) Lastly, provisioned throughput

Obviously, custom model involves more charges compared to non-customized Model throughput & another facto is the commitment for 1-6 months which gives and edge compared to uncommitted mode

Image description

So, given the usage of Titan Lite model for Amazon Bedrock, the total charges across all key factors of cost like Storage, Customization, Throughput, the total cost is as below:

Image description

I hope the above listings in detail, gives an idea of coverage & the aspects to look into, before moving on to use the Amazon Bedrock.

I encourage on reading more about Amazon Bedrock pricing categories at on-demand, model & batch level details at Link

Enjoy the experience !!

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .