☁️ AI/ML on AWS

Choosing the Right Service & Building Responsibly

🎯 Why This Lesson Matters

From Theory to Cloud Practice

In Lessons 1-7, you learned how AI and ML work: from classic ML vs deep learning, to neural networks, LLM training, prompt engineering, RAG, fine-tuning, and responsible AI principles.

Now the question is: how do you actually build and deploy these solutions? AWS provides a layered set of AI/ML services so you can pick the right tool for the job, whether you need a quick pre-built API or full control over custom model training.

πŸ”— What You'll Learn

  • The three tiers of AWS AI/ML services and when to use each
  • How to match specific business problems to the right AWS service
  • A decision framework for choosing between pre-built APIs, foundation models, and custom training
  • AWS tools for building AI responsibly: guardrails, bias detection, and governance

πŸ—οΈ The AWS AI/ML Stack: Three Tiers

Pick Your Level of Control

AWS organizes its AI/ML services into three tiers. The higher you go, the more control you get, but also more complexity and cost. Most teams start at the top (pre-built) and move down only when needed.

🟒 Tier 1: Pre-Built AI Services (APIs)

No ML expertise needed. Call an API, get results.

Amazon Rekognition Amazon Comprehend Amazon Textract Amazon Polly Amazon Transcribe Amazon Translate Amazon Lex Amazon Personalize

πŸ”΅ Tier 2: Generative AI Platform (Foundation Models)

Access leading foundation models via API. Customize with your data.

Amazon Bedrock Bedrock Knowledge Bases Bedrock Agents Bedrock Guardrails

πŸ”΄ Tier 3: Custom ML Platform (Build Your Own)

Full control over data, training, and deployment. For ML teams.

Amazon SageMaker AI SageMaker HyperPod SageMaker Clarify

🎯 Rule of Thumb

Start at Tier 1 (pre-built APIs) whenever possible. Move to Tier 2 (Bedrock) for generative AI use cases. Only go to Tier 3 (SageMaker) when you need full custom model training or have unique requirements that the managed services can't handle.

🟒 Tier 1: Pre-Built AI Services

Ready-to-Use AI via API Calls

These services are pre-trained by AWS. You don't need any ML expertise. Just send data to an API and get results back. They cover the most common AI tasks: vision, language, speech, and recommendations.

πŸ‘οΈ Vision & Document Processing

Pre-Built API
πŸ“·

Amazon Rekognition

Analyzes images and videos using ML. Detects objects, people, scenes, and text in images. Also offers facial analysis, content moderation, and custom label detection.

Use when: You need image/video analysis, content moderation, or facial analysis without building custom computer vision models.

Pre-Built API
πŸ“„

Amazon Textract

Automatically extracts printed text, handwriting, and structured data (tables, forms) from scanned documents and images. Goes beyond simple OCR by understanding document layout.

Use when: You need to extract text and data from invoices, receipts, ID documents, or any scanned paperwork.

πŸ—£οΈ Language & Text

Pre-Built API
πŸ“

Amazon Comprehend

Natural language processing (NLP) service that finds insights in text. Detects sentiment, entities (people, places, brands), key phrases, and language. Also supports topic modeling and custom classification.

Use when: You need sentiment analysis, entity extraction, or text classification on customer reviews, support tickets, or documents.

Pre-Built API
🌐

Amazon Translate

Neural machine translation service that delivers fast, high-quality language translation. Supports thousands of language pairs and allows custom terminology for domain-specific translations.

Use when: You need to translate text between languages at scale, such as localizing content or translating customer communications.

🎀 Speech & Conversation

Pre-Built API
🎧

Amazon Transcribe

Converts speech to text using automatic speech recognition (ASR). Supports real-time and batch transcription with speaker identification and custom vocabulary.

Use when: You need to transcribe call center recordings, meetings, or media content.

Pre-Built API
πŸ”Š

Amazon Polly

Turns text into lifelike speech using deep learning. Offers dozens of voices across many languages, including neural text-to-speech voices for natural-sounding output.

Use when: You need text-to-speech for accessibility, voice assistants, or audio content generation.

Pre-Built API
πŸ€–

Amazon Lex

Build conversational interfaces (chatbots and voice bots) using the same technology that powers Alexa. Provides natural language understanding and automatic speech recognition.

Use when: You need to build a chatbot or voice bot for customer service, order tracking, or FAQ automation.

🎯 Recommendations

Pre-Built API
🎯

Amazon Personalize

Creates real-time personalized recommendations using the same ML technology used on Amazon.com. Supports product recommendations, personalized search, and customized marketing.

Use when: You need product recommendations, personalized content feeds, or targeted marketing campaigns.

Pre-Built API
πŸ”

Amazon Kendra

Intelligent enterprise search service powered by ML. Understands natural language queries and returns precise answers from across your document repositories, not just keyword matches.

Use when: You need intelligent search across internal documents, wikis, FAQs, and knowledge bases.

πŸ”΅ Tier 2: Amazon Bedrock β€” The GenAI Platform

Foundation Models as a Service

Amazon Bedrock is a fully managed service that gives you API access to leading foundation models (FMs) from multiple providers. You can build generative AI applications without managing infrastructure or training models from scratch.

Key benefit: Choose from multiple model providers through a single, unified API. Your data is not used to train the base models, and it stays within your AWS account.

🏒 Model Providers on Bedrock

Bedrock offers foundation models from multiple leading AI companies, including:

Anthropic (Claude) Meta (Llama) Amazon (Nova, Titan) Mistral AI AI21 Labs Cohere Stability AI And others

The list of available providers and models continues to grow. Check the AWS documentation for the latest list.

🧩 Key Bedrock Capabilities

GenAI
πŸ“š

Knowledge Bases

Fully managed RAG (Retrieval Augmented Generation) capability. Connect your data sources β€” documents, databases, web pages β€” and Bedrock handles chunking, embedding, storage, and retrieval automatically.

Remember Lesson 6? RAG gives models access to your private data. Bedrock Knowledge Bases implements the entire RAG pipeline as a managed service.

GenAI
πŸ€–

Agents

Build AI agents that can plan and execute multi-step tasks. Agents can call APIs, query databases, and take actions on behalf of users. Bedrock also supports multi-agent collaboration for complex workflows.

Example: An agent that handles a customer return by looking up the order, checking the return policy, and initiating the refund β€” all autonomously.

GenAI
πŸ›‘οΈ

Guardrails

Configurable safeguards for your GenAI applications. Define policies to filter harmful content, block sensitive information (PII), prevent hallucinations, and enforce topic boundaries. Works across any FM on Bedrock and even models hosted outside Bedrock.

Key feature: Includes Automated Reasoning to help prevent factual errors from hallucinations in RAG and summarization use cases.

GenAI
πŸŽ›οΈ

Model Customization

Fine-tune foundation models with your own data directly in Bedrock. Supports continued pre-training and fine-tuning while keeping your data private and secure within your AWS account.

Remember Lesson 6? Fine-tuning teaches models specialized behaviors. Bedrock lets you do this without managing training infrastructure.

πŸ”΄ Tier 3: Amazon SageMaker AI β€” Custom ML

Full Control for ML Teams

Amazon SageMaker AI is a comprehensive platform for building, training, and deploying custom machine learning models. It covers the entire ML lifecycle: data preparation, model training, tuning, deployment, and monitoring.

Use SageMaker when pre-built services and foundation models don't meet your needs β€” for example, when you have proprietary data and need a custom model architecture, or when you need to train or fine-tune models at massive scale.

Custom ML
πŸ‹οΈ

Model Training

Train custom models using built-in algorithms, your own code, or popular frameworks (PyTorch, TensorFlow). SageMaker manages the infrastructure, scaling, and distributed training.

Custom ML
πŸš€

Model Deployment

Deploy models with real-time endpoints, batch inference, async inference, or serverless inference. SageMaker handles auto-scaling and infrastructure management.

Custom ML
⚑

SageMaker HyperPod

Purpose-built infrastructure for large-scale model training. Scales across thousands of AI accelerators and can reduce foundation model training and fine-tuning costs by up to 40%.

πŸ” SageMaker Clarify β€” Bias Detection & Explainability

SageMaker Clarify helps you detect potential bias in your training data and model predictions, and explains how models make decisions. Key capabilities:

  • Data bias detection: Identifies biases in training data before you even train a model
  • Model bias detection: Measures bias in model predictions after training
  • Feature attribution: Explains which features most influenced each prediction
  • Production monitoring: Monitors deployed models for bias drift or feature attribution changes over time

Clarify supports guidelines such as ISO 42001 for AI management systems.

βš–οΈ Bedrock vs SageMaker: When to Use Which

The Most Common Question

Teams often ask: "Should I use Bedrock or SageMaker?" The answer depends on your use case, team expertise, and how much control you need.

Aspect πŸ”΅ Amazon Bedrock πŸ”΄ Amazon SageMaker AI
Primary Use Generative AI apps using foundation models Custom ML model training and deployment
ML Expertise Needed Low to medium Medium to high
Model Choice Select from leading FMs (Claude, Llama, Nova, etc.) Bring your own model or use built-in algorithms
Infrastructure Fully managed, serverless Managed but you configure instances and scaling
Customization Fine-tuning, RAG, prompt engineering Full control: architecture, training, hyperparameters
Best For Chatbots, content generation, summarization, RAG Fraud detection, forecasting, custom NLP, recommendation engines
Time to Production Hours to days Weeks to months
Pricing Pay per token/request Pay for compute instances used

πŸ’‘ They're Complementary, Not Competing

Many organizations use both. For example: Bedrock for a customer-facing chatbot with RAG, and SageMaker for a custom fraud detection model trained on proprietary transaction data. The right choice depends on the specific problem you're solving.

🧭 Decision Framework: Matching Problems to Services

Interactive: Find the Right AWS Service

Click on a business scenario below to see which AWS service is the best fit and why.

πŸ“„

"We need to extract data from thousands of invoices"

πŸ’¬

"We want a chatbot that answers questions from our docs"

😊

"We need to analyze sentiment in customer reviews"

πŸ”’

"We need a custom fraud detection model for our transactions"

✍️

"We want to generate marketing content at scale"

πŸ›‘οΈ

"We need to moderate user-uploaded images"

πŸ“ž

"We want to transcribe and analyze call center recordings"

🎯

"We need personalized product recommendations"

🌳 Quick Decision Tree

Answer the Questions to Find Your Tier

Walk through these questions to determine which tier of AWS AI/ML services fits your use case.

Is your task a common AI pattern?

(image analysis, text extraction, speech-to-text, translation, sentiment analysis)

βœ… Yes β†’ Use Pre-Built AI Services (Tier 1)
❌ No β†’ Continue ↓

Do you need generative AI capabilities?

(text generation, summarization, chatbot, code generation, RAG)

βœ… Yes β†’ Use Amazon Bedrock (Tier 2)
❌ No β†’ Continue ↓

Do you need a custom-trained model?

(proprietary data, custom architecture, specialized predictions, full ML pipeline control)

βœ… Yes β†’ Use Amazon SageMaker AI (Tier 3)

πŸ›‘οΈ Responsible AI on AWS

From Principles to Practice

In Lesson 7, you learned about ethical AI principles: transparency, fairness, accountability, privacy, and safety. AWS provides concrete tools and frameworks to put these principles into practice.

AWS Responsible AI Framework: 8 Dimensions

AWS defines eight dimensions of responsible AI to guide organizations throughout the AI lifecycle:

βš–οΈ

Fairness

AI systems should not discriminate against individuals or groups

πŸ”

Explainability

Understand and explain how AI systems make decisions

πŸ”’

Privacy & Security

Protect data and ensure secure AI operations

πŸ›‘οΈ

Safety

Prevent AI systems from causing harm

πŸŽ›οΈ

Controllability

Maintain human oversight and control over AI

βœ…

Veracity & Robustness

Ensure AI outputs are accurate and reliable

πŸ“‹

Governance

Establish policies and processes for AI management

πŸ‘οΈ

Transparency

Be open about AI capabilities and limitations

πŸ”§ AWS Tools for Responsible AI

πŸ›‘οΈ

Amazon Bedrock Guardrails

What it does: Configurable safeguards that evaluate user inputs and model responses based on your policies. Provides content filtering, PII redaction, topic restrictions, and hallucination prevention.

Responsible AI dimensions: Safety, controllability, veracity

Works across all FMs on Bedrock and can also be applied to models hosted outside Bedrock via the ApplyGuardrail API.

πŸ”¬

SageMaker Clarify

What it does: Detects bias in training data and model predictions. Explains model decisions using feature attribution. Monitors deployed models for bias drift over time.

Responsible AI dimensions: Fairness, explainability, governance

Helps build less biased and more understandable ML models throughout the entire lifecycle.

πŸ—οΈ

AWS Well-Architected Responsible AI Lens

What it does: A structured framework for integrating ethics, transparency, and risk management into AI systems. Provides best practices, design principles, and review questions for responsible AI workloads.

Responsible AI dimensions: All eight dimensions

Emphasizes identifying and resolving potential issues as early as possible in the AI lifecycle.

πŸ‘€

Human-in-the-Loop Patterns

What it does: AWS supports human review workflows where AI predictions are reviewed by humans before taking action. Services like Amazon Augmented AI (A2I) enable this pattern.

Responsible AI dimensions: Controllability, accountability, safety

Critical for high-stakes decisions in healthcare, finance, and legal domains.

🎯 Responsible AI Checklist for AWS Projects

  • ☐ Before training: Use SageMaker Clarify to check training data for bias
  • ☐ During development: Apply Bedrock Guardrails to filter harmful content and prevent hallucinations
  • ☐ Before deployment: Test model predictions across different demographic groups for fairness
  • ☐ In production: Monitor for bias drift and feature attribution changes over time
  • ☐ For high-stakes decisions: Implement human-in-the-loop review workflows
  • ☐ Across the lifecycle: Follow the Well-Architected Responsible AI Lens best practices

πŸ—ΊοΈ The Complete Picture

Connecting All 8 Lessons

Here's how everything you've learned fits together on AWS:

Concept (Lesson) What You Learned AWS Service
Classic ML vs Deep Learning (L1) When to use each approach SageMaker AI (custom models), Pre-built APIs (common tasks)
Feature Engineering (L2) Preparing data for models SageMaker Data Wrangler, SageMaker Processing
Neural Networks (L3) How networks learn SageMaker Training, SageMaker HyperPod
Language Models (L4) Tokenization, embeddings, transformers Amazon Bedrock (access to leading FMs)
LLM Training (L5) Training process and mechanics Bedrock Model Customization, SageMaker HyperPod
Working with LLMs (L6) Prompting, RAG, fine-tuning Bedrock (prompting), Bedrock Knowledge Bases (RAG), Bedrock fine-tuning
Ethics & Responsibility (L7) Responsible AI principles Bedrock Guardrails, SageMaker Clarify, Well-Architected AI Lens
AI on AWS (L8 β€” this lesson) Choosing the right service Pre-built APIs β†’ Bedrock β†’ SageMaker (pick your tier)

πŸ’‘ Key Takeaways

What You've Learned

  • 🟒 Pre-built AI services (Rekognition, Comprehend, Textract, Polly, Transcribe, Translate, Lex, Personalize) let you add AI via simple API calls with no ML expertise
  • πŸ”΅ Amazon Bedrock provides access to leading foundation models through a unified API, with managed RAG (Knowledge Bases), Agents, Guardrails, and fine-tuning
  • πŸ”΄ Amazon SageMaker AI gives full control for custom model training, deployment, and monitoring when you need it
  • 🧭 Start simple: Pre-built APIs first, then Bedrock for GenAI, then SageMaker for custom ML
  • πŸ›‘οΈ Build responsibly: Use Bedrock Guardrails for GenAI safety, SageMaker Clarify for bias detection, and the Well-Architected Responsible AI Lens for governance
  • 🀝 Services are complementary: Many organizations use multiple tiers together for different use cases

πŸŽ“ Course Complete!

You've now covered the full journey: from understanding how AI/ML works (Lessons 1-5), to practical techniques for using it (Lessons 6-7), to choosing the right AWS services and building responsibly (Lesson 8).

You can describe AI, ML, and GenAI concepts. You can identify the right technology for a business problem. You can determine which AWS service fits a specific use case. And you know how to use these technologies responsibly.

πŸŽ‰ Course Complete!

Your Progress
βœ“
βœ“
βœ“
βœ“
βœ“
βœ“
βœ“
βœ“
πŸŽ“ All 8 lessons complete!
πŸ†

Full Course Complete!

You now understand AI/ML fundamentals, generative AI, practical techniques, and how to apply them on AWS responsibly.