Amazon Bedrock vs. Amazon SageMaker - What's The Difference?

Analytical AI & MLOps

Explore Amazon Bedrock & Amazon SageMaker, differences in use case, setup, data protection, and cost.

In the realm of Artificial Intelligence (AI), a fascinating and innovative branch has taken center stage: Generative AI. This state-of-the-art technology enables machines to not only gain insights from data but to create entirely new and original content, blurring the lines between human-generated and machine-generated creations. From art and music to text and images, the potential applications of Generative AI are pushing the boundaries of what can be achieved both in business and creative works.

As GenAI is a brand new technology, we often tend to be confused about how it can be attached to a specific business and what are the tools and services that allow us to build customized solutions leveraging such innovation. Fortunately AWS offers two services that address this point: Amazon SageMaker and Amazon Bedrock. In this blog we will discuss those two services and the main differences between them.

Overview of Amazon Bedrock & SageMaker

Both Bedrock and SageMaker offer managed ML services to develop solutions around ML tasks with progressive price structures. They have similarities and differences, and together enable a full stack of solutions for the ML realm.

SageMaker, the oldest of the two options, offers a full ML suite of services. With it, you can implement solutions for a wide variety of use-cases, from classical ML like classification and regression to more complex tasks like Generative AI and computer vision. The main point to keep in mind is that it requires more maintenance and more hands-on skills for certain tasks.

On the other hand, Bedrock, one of the newest services emerging from the AWS ecosystem, provides really strong off-the-shelf capabilities that are well-suited for lean teams. Bedrock provides a serverless API, and its usage is strict to Generative AI tasks.

What is Amazon Bedrock?

Amazon Bedrock is a serverless API service engineered for easier development and deployment of Generative AI applications utilizing foundational models (FMs). These foundational models are substantial language models that have undergone extensive training on extensive datasets encompassing text and code. They exhibit versatility and can be harnessed for a multitude of applications, such as generating text, language translation, creative content generation, and providing informative responses to questions.

With Bedrock you'll have access to great features. Some of them being:

  • Foundational Models (FMs): Bedrock offers the ability to experiment and use FMs without having to worry about infrastructure since it is completely serverless. Some of the FMs you have access to are Anthropic's Claude V2, Amazon Titan and Meta's Llama 2 (AWS keeps adding models in Bedrock constantly). Its integration is fully covered through a serverless API, facilitating the process of developing GenAI applications. You can also test the FMs through the console UI, testing prompts and seeing how the FMs respond to user prompts.
  • Model Customization: With Model Customization an user can customize an Amazon Bedrock model to improve customer experience, such as adding domain specific data, so the custom model is capable of handling specific tasks, and learning new domain knowledge. Two main features are provided to create custom models in Bedrock: Fine-Tuning, where you can increase model accuracy by providing your own task-specific labeled training dataset and further specialize your FMs; and Continued Pre-Training, where you can train models using your own unlabeled data, helping models become more domain-specific by accumulating more robust knowledge and adaptability.
  • Agents: Bedrock includes a feature called Agents for Bedrock, that can implement complete tasks based on your proprietary data. With Agents, developers can build GenAI applications that are capable of using their own data and integrate internal APIs via FMs. All that within a private and secure environment. One example is the integration with AWS Lambda, that can run custom code serverless. With the integration with Lambda, Bedrock will use the configured FM for the Agent to automatically identify the course of action and run/invoke the correct Lambda function in a proper order, so user requests and tasks are solved.
  • Integration and deployment with other AWS Services: One other great feature is the integration and deployment with ongoing AWS tools, including SageMaker projects, experiments and pipelines, for a full ML workflow based on SageMaker features and Bedrock API.
  • Bedrock Examples: In this feature, Bedrock offers a wide variety of examples for prompts to generate lots of different tasks. Also, it includes sample notebooks to use Bedrock APIs for different tasks, like SQL generation and question answering. The image below showcases some of the Bedrock Examples.

What is Amazon Sagemaker?

Amazon SageMaker is a fully managed machine learning (ML) platform designed to empower developers and data scientists, to rapidly create, train, and deploy ML models. SageMaker offers an extensive toolkit and features covering the entire ML lifecycle, from data preparation and feature engineering to model training and deployment. It also includes a diverse selection of pre-built models, algorithms and sample solutions suitable for various ML tasks, from more complex tasks, like Generative AI, to classical problems like, computer vision, classification and regression.

SageMaker suite of services range between a wide realm of applications. Some of the most notable features include:

  • No-code version for business analysts: analysts can make use of SageMaker Canvas to create a visual point-and-click interface to generate accurate ML predictions without having to write a single line of code. Or leverage Autopilot where a user simply provides a tabular dataset and selects the target column to predict, and SageMaker Autopilot will automatically explore different solutions to find the best model.
  • IDE for data scientistsSageMaker Studio offers a great IDE for data scientists to explore and experiment with their data and different ML models and solutions, giving them flexibility and a secure and private environment to perform their tasks. Also SageMaker Studio Notebooks can be connected to multiple AWS Services, such as S3, ECR, Redshift and Bedrock.
  • MLOps: For MLOps, SageMaker offers SageMaker Projects. This functionality assists organizations in establishing and unifying developer environments for data scientists and CI/CD systems used by MLOps engineers. Although SageMaker notebooks serve as excellent tools for experimentation and model development, data science and machine learning teams often require a more scalable approach to manage their code and implementations. This is where Projects comes in handy. Projects also play a pivotal role in assisting organizations with tasks such as configuring dependency management, overseeing code repository management, ensuring build reproducibility, and facilitating the sharing of artifacts. Within Projects, users can implement lots of different features, one of them being SageMaker Pipelines: an orchestration tool that allows engineers to organize and scale their ML workflow, from EDA up until deployment and monitoring.
  • SageMaker Pipelines: SageMaker Pipelines is a purpose-built workflow orchestration service to automate all phases of machine learning (ML) from data pre-processing to model monitoring. With an user-friendly UI and a seamless Python integration for building and managing the pipeline, SageMaker Pipelines is a great tool to create orchestrations and integration of ML workflow. You can add training jobs, processing jobs, model deployment and many other steps in a custom orchestration logic so the ML workflow is easily automated.
  • Spot Training: With spot training, SageMaker enables training models using spot instances. With that feature users can save up to 90% in training cost.
  • JumpStartSageMaker JumpStart offers a wide variety of sample notebooks, solutions and pre-trained models in order to facilitate and explain how to perform tasks in SageMaker. From pre-trained models for Computer Vision and GenAI, up to notebooks for MLOps, SageMaker JumpStart offers great samples for developers to hit the ground running with pre-built solutions. The image below depicts some examples from SageMaker JumpStart.

Use cases: Bedrock vs Sagemaker

Bedrock use cases are Generative AI tasks, and are more aligned with users that want to quickly excel in the AI realm with advanced capabilities, without worrying about infrastructure and lots of code for model build and deployment. You can use Bedrock to perform a multitude of GenAI tasks like code generation, chatbots, image generation and text generation. Bedrock also allows fine-tuning of its provided FMs.

With SageMaker on the other hand, you can implement and develop solutions for GenAI and a wide range of ML use-cases, providing more flexibility by controlling infrastructure and codes for model build, train, deployment and inference. Some examples of ML tasks that SageMaker handles are computer vision, anomaly detection (e.g. fraud detection), feature reduction (e.g. risk assessment), forecasting (e.g. market projection), classification, regression and natural language processing.

Bedrock vs Sagemaker: Major Differences

The major difference between Bedrock and SageMaker lies in the complexity of the development cycle. We can summarize the complexity of both as:

  • The simplicity of Bedrock is a virtue for lean startups looking to create and integrate advanced capabilities of Generative AI quickly .
  • The complexity of Sagemaker is a virtue for teams that are invested in exceptionally sophisticated data management, ML workflows and experimentation.

To sum this major difference up, the following diagram can be a good starting point to decide which service to choose for your use-case.

There are other differences that may impact your decision, other than complexity and ML use-case. Some of those differences are related to how cost is calculated, how to set the environment up, how privacy is implemented and the learning curve needed for working with each one of those services.

Set-up

Regarding setup, in a nutshell, Bedrock is easier to setup than SageMaker.

Being fully managed by AWS, Bedrock requires less effort compared to SageMaker considering that users and developers select one of the provided pre-trained models, run some customizations if applicable and hit the ground running.

For SageMaker, by having to set up networking and privacy configurations, environment isolation and because of the larger feature set, SageMaker requires a bigger effort for setup. Also, for using the service, users need to be more hands-on in terms of customization and code development, so there is a bigger learning curve when comparing it to Bedrock.

Privacy

  • Sagemaker users have more control over infrastructure, and so they have more control over their data.
  • Bedrock users work within AWS managed environment, so they have less control (although user data is encrypted and AWS will not use your data to train FMs)

Regarding privacy concerns, the main difference lies again in the customization capabilities of each service, even though both services provide robust security features.

SageMaker provides more control over privacy and security. Users can define and create their own VPC with the needed configurations for internet access, encrypt data at rest and in transit and manage data and service access through IAM roles.

Bedrock, on the other hand, processes data within the AWS environment. Bedrock provides and ensures that the user data does not leave the user's VPC and that it is encrypted. Also it guarantees that the user data is not used to train the foundational models used. One other cool feature of Bedrock is that, for customization jobs (model fine tuning), Bedrock makes a private copy of the foundational model to be fine-tuned, so proprietary data is not shared with model providers.

In the end, the choice between services, when it comes to privacy and security is, again, how much control your solution requires.

Customization

Regarding customization, as we have been discussing throughout this blog, SageMaker offers more flexibility when compared to Bedrock.

In Bedrock, users can customize the provided FMs with their own data, creating fine-tuned models and using those through its API.

SageMaker offers more customizations. The main one is the ability to perform other ML tasks than GenAI. Also, in SageMaker users can incorporate their own algorithms, third-party algorithms and open-source LLMs. Users have full control over codes that are used for processing, training, evaluation, deploying and predicting.

Pricing

Bedrock pricing model is dependent on the modality, provider, and model. Pricing models are separated into:

  • On-Demand: pay as you use methodology, with no time-based commitment.
  • Batch: intended for large-scale use-cases, where an user can pass multiple prompts in a single input file and all the responses are stored within a single output file. Batch pricing is the same as On-Demand.
  • Provisioned Throughput: user purchases model units for base or custom models. Its primary design is aimed at large consistent inference workloads that need guaranteed throughput. The rationale is that a model unit provides a certain throughput, measured by the maximum number of input and output tokens, and you are charged by hour having the flexibility to choose how much time to commit (between 1 month and 6 months commitment).
  • Model Customization: you are charged for model training based on the number of tokens used for fine-tuning the model and for model storage. As mentioned, for custom models you must get Provisioned Throughput to run inference. One model unit is provided with no commitment. If more is needed, you must purchase a 1-month or 6-months commitment plan.

One example of On-Demand pricing is the price of running Anthropic's Claude base model. The table below depicts the cost of both models available based on input and output-tokens.

Note: for Agents for Bedrock and Knowledge Bases for Bedrock, you are only charged for the models and vector databases you use, when applicable.

On the other hand, SageMaker pricing is based on usage, however there is more complexity involved in it. Notebook instances are charged for the time they are up and jobs like training, processing and inference are also charged for the time that the selected instance was up and running. Idle notebook instances are also charged, but you can get rid of those charges by leveraging a Lifecycle Configuration with a script that shuts down notebook instances that are idle after a user-defined period of time. Model endpoints are also charged based on time they are available and their usage.

As SageMaker is a more robust suite of services and has instances and infrastructure attached to its features, the cost breakdown is more complicated. As mentioned, there is cost associated with different features like training jobs, endpoints, notebook instances and more. AWS explanation is pretty well defined in the pricing page for SageMaker, with examples, instance types and deeper details around the cost breakdown.

Which one is right for your company?

To choose the right service for your own use-case, the following questions can serve as guidance:

  • What is your ML use-case?
  • Bedrock only provides GenAI capabilities.
  • SageMaker is suitable for a broader range of ML use-cases and GenAI as well.
  • How much are you willing to invest?
  • SageMaker will likely require a larger investment.
  • Can you manage granular costs?
  • SageMaker runs the risk of granular cost creep.
  • Who on your team will be using it?
  • Bedrock seems like a great fit for lean dev teams.
  • SageMaker has features for data scientists as well as business analysts.
  • What is your timeline?
  • Bedrock provides more off-the-shelf solutions and quicker time-to-market.
  • How much customization do you require?
  • Sagemaker enables much greater customization and set of tools to use.

If you're looking for help strategizing how to operationalize your GenAI initiatives, Caylent can help. Our Generative AI Proof Of Value Caylent Catalyst can help you build an AI roadmap for your organization and demonstrate how generative AI can positively impact you. If you have a specific GenAI vision, we can also tailor an engagement exactly to your requirements. Get in touch with our team to explore opportunities to innovate with AI.

Analytical AI & MLOps
Gustavo Gialluca

Gustavo Gialluca

Gustavo Gialluca is a Senior Machine Learning Engineer with 5 years of experience developing Machine Learning solutions, from Data Science to ML Engineering. He has experience working on projects in a variety of fields, ranging from consultancy for energy and financial companies to R&D projects with universities. He graduated from Electrical Engineering in 2019, is finishing his Masters in Electrical Engineering with emphasis in Data Science, and holds the AWS Certified Machine Learning Specialty certification. His mission is to provide value to businesses through Machine Learning and scalability. His passions are being able to assist people and to create a great work environment, as well as being on top of the innovations around the ML field and the cloud.

View Gustavo's articles

Accelerate your GenAI initiatives

Leveraging our accelerators and technical experience

Browse GenAI Offerings

Related Blog Posts

Transforming Chatbots into Multi-Use Business Tools with Generative AI

Multi-intent chatbots are revolutionizing business processes. Learn how you can leverage generative AI to solve complex organizational challenges and enhance operational efficiency with our step-by-step guide.

Analytical AI & MLOps

AI-Augmented OCR with Amazon Textract

Learn how organizations can eliminate manual data extraction with Amazon Textract, a cutting-edge tool that uses machine learning to extract and organize text and data from scanned documents.

Analytical AI & MLOps

Building Recommendation Systems Using GenAI

Explore what GenAI recommendation systems are, how they differ from traditional recommendation systems and how to build recommendation systems using GenAI.

Generative AI & LLMOps
Analytical AI & MLOps