AI/ML, AWS, Cloud Computing

4 Mins Read

Simplify Generative AI with Amazon Bedrock and Custom Model Import

Voiced by Amazon Polly

Introduction

Building and deploying generative AI applications requires flexibility, scalability, and cost efficiency. Amazon Bedrock simplifies this process with its fully managed, on-demand API.

It provides seamless access to high-performing foundation models (FMs) from leading AI providers like AI21 Labs, Anthropic, Cohere, Meta, Mistral AI, Stability AI, and Amazon.

With its capabilities, Amazon Bedrock enables organizations to create AI applications while ensuring security, privacy, and responsible AI practices.

Previously, using custom fine-tuned models with Amazon Bedrock involved managing your inference infrastructure in Amazon SageMaker or relying on costly provisioned throughput. Now, with Amazon Bedrock Custom Model Import, you can integrate models trained or fine-tuned in SageMaker, including those created using Amazon SageMaker JumpStart, into Amazon Bedrock. This innovation allows you to harness the power of these models on demand through Amazon Bedrock’s fully managed API, streamlining the deployment process and reducing infrastructure complexity.

Pioneers in Cloud Consulting & Migration Services

  • Reduced infrastructural costs
  • Accelerated application deployment
Get Started

Solution Overview

Amazon Bedrock supports importing custom models from the following architectures:

  • Mistral
  • Flan
  • Meta Llama 2, Llama 3, Llama3.1, Llama3.2, and Llama 3.3

For this, we use a Hugging Face Flan-T5 Base model.

Prerequisites

Ensure you have an AWS account with access to Amazon Bedrock and Amazon SageMaker Studio before you start.

See Launch Amazon SageMaker Studio for details on how to set up an instance of Amazon SageMaker Studio if you don’t already have one.

Steps to Train a model in Amazon SageMaker JumpStart

  1. Open the AWS Management Console and go to Amazon SageMaker Studio.
  2. In Amazon SageMaker Studio, select JumpStartin the navigation pane.
  3. Search for and choose the Hugging Face Flan-T5 Base.

step3

4. Select Train to begin fine-tuning the model on your training data.

Use the default options when creating the training job. The defaults add suggested settings to the training job.

5. A prepopulated example dataset is used in this post’s example. Ensure your data satisfies the format criteria before entering its location in the Data section.

step5

6. Configure the security settings such as AWS Identity and Access Management (IAM) role, virtual private cloud (VPC), and encryption.

7. Note the value for Output artifact location (S3 URI) to use later.

8. To begin training, submit the job.

You may monitor your work by choosing Training from the Jobs dropdown menu. The training task is considered completed when its status is displayed as Completed. Training takes roughly ten minutes with the default settings.

step8

Steps to Import the model into Amazon Bedrock

  1. Choose Imported models under Foundation models in the navigation pane on the Amazon Bedrock console.
  2. Select Import model.
  3. Enter a memorable name for your model in the Model name
  4. Under Model import settings, select Amazon SageMaker model and select the radio button next to your model.

bedrock4

5. Under Service access, select Create, use a new service role, and enter a name for the role.

6. Select Import model.

7. The model import will be completed in about 15 minutes.

bedrock7

8. Under Playgrounds in the navigation pane, select

9. Choose Select model.

10. For Category, choose Imported models.

11. For Model, choose flan-t5-fine-tuned.

12. For Throughput, choose On-demand.

13. Choose Apply.

bedrock13

Your personalized model is now available for interaction. The following screenshot summarises Amazon Bedrock using our sample custom model.

bedrock13b

Clean up

  1. You should delete your Amazon SageMaker domain if you want to stop using it.
  2. Delete the Amazon Simple Storage Service (Amazon S3) bucket containing your model artifacts if you no longer wish to keep them.
  3. Select your model on the Imported Models page in the Amazon Bedrock console, then click the options menu (three dots) and choose Delete to remove your imported model.

cleanup

Conclusion

In conclusion, the Custom Model Import feature in Amazon Bedrock revolutionizes how you deploy and utilize custom-trained or fine-tuned models, offering a seamless, cost-effective solution for on-demand inference. By combining the training capabilities of Amazon SageMaker with the fully managed, scalable infrastructure of Amazon Bedrock, businesses can focus on creating innovative applications without the complexities of managing machine learning infrastructure.

Whether leveraging the intuitive Amazon SageMaker Studio console or the flexibility of Amazon SageMaker notebooks, you can train, fine-tune, and import your models effortlessly into Amazon Bedrock. This integration empowers you to deliver tailored, high-value experiences to your customers while benefiting from the scalability, efficiency, and simplicity of a fully managed API.

As the field of large language models continues to advance, the ability to integrate custom models into your workflows becomes indispensable. Amazon Bedrock Custom Model Import ensures that you can maximize the potential of your specialized models, transforming insights into impactful, real-world solutions.

Drop a query if you have any questions regarding Amazon Bedrock Custom Model and we will get back to you quickly.

Empowering organizations to become ‘data driven’ enterprises with our Cloud experts.

  • Reduced infrastructure costs
  • Timely data-driven decisions
Get Started

About CloudThat

CloudThat is a leading provider of Cloud Training and Consulting services with a global presence in India, the USA, Asia, Europe, and Africa. Specializing in AWS, Microsoft Azure, GCP, VMware, Databricks, and more, the company serves mid-market and enterprise clients, offering comprehensive expertise in Cloud Migration, Data Platforms, DevOps, IoT, AI/ML, and more.

CloudThat is the first Indian Company to win the prestigious Microsoft Partner 2024 Award and is recognized as a top-tier partner with AWS and Microsoft, including the prestigious ‘Think Big’ partner award from AWS and the Microsoft Superstars FY 2023 award in Asia & India. Having trained 650k+ professionals in 500+ cloud certifications and completed 300+ consulting projects globally, CloudThat is an official AWS Advanced Consulting Partner, Microsoft Gold Partner, AWS Training PartnerAWS Migration PartnerAWS Data and Analytics PartnerAWS DevOps Competency PartnerAWS GenAI Competency PartnerAmazon QuickSight Service Delivery PartnerAmazon EKS Service Delivery Partner AWS Microsoft Workload PartnersAmazon EC2 Service Delivery PartnerAmazon ECS Service Delivery PartnerAWS Glue Service Delivery PartnerAmazon Redshift Service Delivery PartnerAWS Control Tower Service Delivery PartnerAWS WAF Service Delivery PartnerAmazon CloudFrontAmazon OpenSearchAWS DMS and many more.

FAQs

1. What are the key benefits of integrating Amazon SageMaker-trained models with Amazon Bedrock?

ANS: – Integrating Amazon SageMaker-trained models with Amazon Bedrock provides several benefits, including:

  • Cost-efficient, serverless inference capabilities.
  • A fully managed API for seamless model access.
  • Reduced infrastructure management complexity.
  • The ability to deploy custom models at scale while maintaining flexibility and reliability.

2. What is Amazon Bedrock Custom Model Import, and how does it simplify AI inference?

ANS: – Amazon Bedrock Custom Model Import allows you to import trained or fine-tuned models from Amazon SageMaker into Amazon Bedrock, enabling on-demand inference without manually managing complex infrastructure.

WRITTEN BY Aayushi Khandelwal

Aayushi, a dedicated Research Associate pursuing a Bachelor's degree in Computer Science, is passionate about technology and cloud computing. Her fascination with cloud technology led her to a career in AWS Consulting, where she finds satisfaction in helping clients overcome challenges and optimize their cloud infrastructure. Committed to continuous learning, Aayushi stays updated with evolving AWS technologies, aiming to impact the field significantly and contribute to the success of businesses leveraging AWS services.

Share

Comments

    Click to Comment

Get The Most Out Of Us

Our support doesn't end here. We have monthly newsletters, study guides, practice questions, and more to assist you in upgrading your cloud career. Subscribe to get them all!