The AI/ML Development Lifecycle & MLOps: Pipeline, Models & Metrics
The AI/ML development lifecycle is the repeatable set of stages that turn raw data into a working, monitored model: you collect data, prepare it, train a model, evaluate and tune it, deploy it, then monitor and retrain it as the world changes. For the AIF-C01 exam you are not asked to build these pipelines — you recognize their stages, name the AWS service that fits each one, and read the metrics that say whether a model is any good. This lesson walks the pipeline in order, compares the three ways to source a foundation model, weighs managed against self-hosted deployment, and defines the model metrics (accuracy, precision, recall, F1 score) and business metrics (cost per user, ROI) the exam tests. It also covers MLOps — the practices that make model work repeatable, scalable, and production-ready, including monitoring for drift and retraining. Learn the pipeline as a single story and most Task 1.3 questions answer themselves.
On this page8 sections
- The AI/ML Pipeline, Stage by Stage
- Where Models Come From: Build vs Buy
- Running a Model in Production: Managed API vs Self-Hosted
- AWS Services for Each Pipeline Stage
- MLOps: Making ML Repeatable and Production-Ready
- Reading Model Metrics: Accuracy, Precision, Recall, and F1
- Business Metrics: Is the Model Worth It?
- Worked Example: A Fraud-Detection Pipeline
- Describe the stages of an AI/ML pipeline in order and explain what each stage contributes.
- Compare the three sources of a foundation model — a provider's managed FM, an open-source pre-trained model, and a custom-trained model — along the build-versus-buy spectrum.
- Weigh a managed API service against a self-hosted API for putting a model into production.
- Match each pipeline stage to the AWS service that supports it, including Amazon SageMaker AI, Amazon Bedrock, Amazon Q, and Kiro.
- Explain core MLOps concepts, including model monitoring for drift and why models must be retrained.
- Define accuracy, precision, recall, and F1 score, and choose the right metric for a given business risk.
The AI/ML Pipeline, Stage by Stage
An AI/ML pipeline is the ordered set of steps that carries a problem from raw data to a running model that keeps earning its keep. The exam wants you to name the stages and know what each one does, not to implement them. The order matters, because each stage depends on the output of the one before it.
| Stage | What happens |
|---|---|
| Data collection | Gather raw data from sources such as databases, logs, files, or sensors and store it centrally. |
| Data preparation | Clean errors and duplicates, label examples where needed, and shape raw fields into useful inputs (feature engineering). |
| Model training | Feed prepared data to an algorithm so it learns the patterns that map inputs to the desired output. |
| Evaluation and tuning | Test the model on held-back data, measure its metrics, and adjust settings to improve results. |
| Deployment | Make the trained model available to applications, usually behind an API that returns predictions. |
| Monitoring | Watch the live model for errors, slow responses, and accuracy that drops as real-world data changes. |
| Retraining | Refresh the model on newer data when monitoring shows its performance decaying, then redeploy. |
Notice that the pipeline is a loop, not a line: monitoring feeds retraining, which sends a new model back through evaluation and deployment. A model is never finished the day it ships. When a question describes a symptom — messy inputs, poor test scores, a live model going stale — map it to the stage that owns that work.
Where Models Come From: Build vs Buy
You do not always train a model from scratch. For generative AI in particular, the exam expects you to know three sources of a foundation model (FM), which sit on a spectrum from buy to build.
- Use a provider's managed FM. A cloud provider hosts large, ready-trained models and lets you call them through an API. This is the fastest, lowest-effort option — you write no training code and run no servers. On AWS,
Amazon Bedrockis the managed FM service. - Adapt an open-source pre-trained model. Many capable models are published openly. You download one that someone else trained, optionally customize it, and run it yourself. You gain control and portability but take on the work of hosting and maintaining it.
- Train a custom model. You build and train a model on your own data, either from scratch or by heavily adapting a base model. This gives the most control and the tightest fit to your problem, but it demands the most data, expertise, time, and cost.
The trade-off is consistent: moving from buy toward build increases control and customization but also increases cost, effort, and required expertise. A startup validating an idea leans toward a managed FM; an organization with unique data, strict requirements, and a data-science team may justify training its own. The exam rewards matching the source to the situation, not always picking the most powerful option.
Running a Model in Production: Managed API vs Self-Hosted
Once you have a model, you must make it available to applications. There are two broad methods, and the exam frames the choice as operational overhead versus control.
A managed API service means the provider hosts the model and exposes it as an endpoint you simply call. You send input, you get a prediction back, and you never touch servers, scaling, patching, or capacity planning. Amazon Bedrock is the classic example for foundation models. The upside is low operational overhead and fast time to value; the trade-off is less control over the underlying infrastructure and model internals, plus usage-based pricing.
A self-hosted API means you deploy the model onto infrastructure you manage and expose your own endpoint. You choose the hardware, control the environment, can keep everything inside your own network, and can customize the model freely. The cost is that you now own the operational burden — provisioning, scaling, security patching, availability, and monitoring all fall to you. Amazon SageMaker AI sits between these poles: it hosts models on managed endpoints, so you keep more control than a pure API while offloading much of the undifferentiated infrastructure work.
The rule of thumb the exam tests: choose a managed API when speed and low maintenance matter most, and self-hosting when you need maximum control, customization, or data isolation and have the team to run it.
AWS Services for Each Pipeline Stage
At this exam's recognition level you should be able to point at a pipeline stage and name a fitting AWS service. You are not expected to configure them.
| Pipeline stage | AWS service or feature |
|---|---|
| Data storage and collection | Amazon S3 as the central data store (data lake) |
| Data preparation | SageMaker Data Wrangler for cleaning and feature prep; SageMaker Ground Truth for data labeling |
| Feature management | SageMaker Feature Store to store and reuse engineered features |
| Model building, training, deployment | Amazon SageMaker AI, the end-to-end service to build, train, and deploy ML models |
| Managed foundation models | Amazon Bedrock, foundation models from several providers via one API |
| AI assistant | Amazon Q, a generative-AI assistant for work and for building on AWS |
| AI-assisted development | Kiro, an agentic development environment that helps engineers write and ship code |
The two anchors to memorize are SageMaker AI for the traditional build-train-deploy lifecycle and Bedrock for calling ready-made foundation models. SageMaker AI is a family: Ground Truth labels data, Data Wrangler prepares it, Feature Store manages features, and its endpoints deploy models. Amazon Q and Kiro are productivity tools — Q answers questions and assists users, Kiro helps developers build software — rather than places you train a model. If a question asks where data lives before any of this begins, the answer is almost always Amazon S3.
MLOps: Making ML Repeatable and Production-Ready
MLOps (machine learning operations) applies the discipline of software operations to the ML lifecycle. Its goal is to move a model from a one-off experiment on someone's laptop to a reliable, maintainable production system. The exam tests the concepts, not the tooling.
- Experimentation. Data scientists try many datasets, algorithms, and settings. MLOps tracks these experiments so results are reproducible and comparable.
- Repeatable, automated processes. Steps such as data prep, training, and deployment are automated into pipelines rather than run by hand, so the same inputs reliably produce the same outputs.
- Scalable systems. The infrastructure must handle growing data volumes and prediction traffic without breaking.
- Managing technical debt. ML systems accumulate hidden complexity — brittle data dependencies, undocumented steps, stale models. MLOps keeps this debt visible and under control.
- Production readiness. A model is production-ready only when it is reliable, monitored, secure, and can be updated safely.
Two production concepts appear on the exam constantly. Model monitoring watches a live model for problems, especially drift — when the real-world data flowing in gradually stops resembling the data the model was trained on, so accuracy quietly falls. Model retraining is the fix: because the world changes (new fraud tactics, new customer behavior, new products), models decay over time and must be refreshed on newer data and redeployed. Together, monitoring and retraining are why the pipeline is a loop.
Reading Model Metrics: Accuracy, Precision, Recall, and F1
To judge a classification model you compare its predictions to the known correct answers. Four terms come from that comparison, and the exam loves to test which one fits a scenario. Picture the four possible outcomes: true positives (correctly flagged), true negatives (correctly cleared), false positives (flagged by mistake), and false negatives (missed). Every metric below is built from those counts.
| Metric | Plain-English meaning | Care about it when |
|---|---|---|
| Accuracy | Of all predictions, the share that were correct | Classes are balanced and every error costs the same |
| Precision | Of the items the model flagged, the share that were truly positive | False positives are costly |
| Recall | Of the items that were truly positive, the share the model caught | You must catch every true case |
| F1 score | A single balanced blend of precision and recall | You need one number that respects both |
Accuracy can lie. If only 1 in 1,000 transactions is fraud, a model that predicts "never fraud" is 99.9% accurate and completely useless — it catches nothing. That is why precision and recall matter on imbalanced problems.
The clearest way to remember precision versus recall is two examples. For a spam filter, a false positive sends a real, important email to the junk folder, which users hate — so precision matters most. For a cancer screening model, a false negative means telling a sick patient they are healthy — so recall matters most, because you must catch every true case even at the cost of a few false alarms. F1 is the compromise when both errors hurt.
Business Metrics: Is the Model Worth It?
A model can score beautifully on precision and recall and still be a bad decision for the business. That is why the exam pairs technical metrics with business metrics — the numbers a leader uses to decide whether a model earns its cost.
- Cost per user (or per prediction or per interaction): what it costs to serve one unit of demand. A model that is accurate but expensive per call may not scale.
- Development cost: the time, talent, and compute spent building and training the model in the first place.
- Customer feedback: satisfaction scores, ratings, and complaints that reveal whether the model actually helps real users.
- Return on investment (ROI): the value the model generates — revenue gained or cost saved — measured against what it cost to build and run.
The exam framing is simple: model metrics tell you whether the model is good at its task, while business metrics tell you whether it is worth doing. A fraud model that blocks $2 million in losses but costs $3 million to operate has excellent recall and negative ROI. Sound AI decisions weigh both sides.
Worked Example: A Fraud-Detection Pipeline
Walk one realistic system through every stage to see the lifecycle as a whole. A bank wants to flag fraudulent card transactions in real time.
Data collection: the bank streams years of past transactions — amount, location, time, merchant — into Amazon S3, each labeled fraud or legitimate. Data preparation: the team removes duplicates and errors, fills gaps, and engineers features such as "distance from the last purchase" and "transactions in the past hour." Model training: using Amazon SageMaker AI, an algorithm learns the patterns that separate fraud from normal spending. Evaluation and tuning: because missing real fraud is dangerous, the team prioritizes recall, then checks precision so genuine customers are not constantly blocked, and settles on an F1 score that balances the two.
Deployment: the model is hosted behind an API so the payment system can score each transaction in milliseconds. Monitoring: dashboards track latency and accuracy — and months later, fraudsters change tactics, real transactions drift away from the training data, and recall starts to fall. Retraining: the pipeline automatically refreshes the model on recent transactions and redeploys it, closing the loop. Meanwhile the business checks ROI: fraud losses prevented versus the cost of running the system. Every Task 1.3 idea — pipeline stages, deployment method, MLOps monitoring and retraining, model metrics, and business metrics — appears in this one story.
Tip. Expect scenario questions that hand you a business situation and ask for the right metric, pipeline stage, or service. When false positives are costly — flagging a legitimate email as spam — the answer is precision; when you must catch every true case, such as a disease screen, the answer is recall. If a model's accuracy drops over time, the trigger points to data drift, monitoring, and retraining. And "use a foundation model without managing servers" points to a managed API service like Amazon Bedrock, not a self-hosted endpoint.
- The AI/ML pipeline runs in order and loops: collect data, prepare it, train, evaluate and tune, deploy, monitor, then retrain.
- Three ways to source a foundation model: use a provider's managed FM (Amazon Bedrock), adapt an open-source pre-trained model, or train a custom model — moving from least to most control, cost, and effort.
- A managed API service means low operational overhead but less control; a self-hosted API gives full control but you run the infrastructure.
- Amazon SageMaker AI builds, trains, and deploys ML models; Amazon Bedrock serves foundation models via API; Amazon Q is an AI assistant; Kiro helps developers build software; Amazon S3 stores the data.
- Precision matters when false positives are costly; recall matters when you must catch every true case; F1 score balances the two; accuracy alone misleads on imbalanced data.
- Models decay over time as real-world data drifts, so monitoring detects the drop and retraining restores performance.
- Business metrics — cost per user, development cost, customer feedback, and ROI — decide whether a model is worth running, not just whether it is accurate.
- MLOps makes ML repeatable, automated, scalable, and production-ready while managing technical debt.
Frequently asked questions
What are the stages of an AI/ML pipeline?
An AI/ML pipeline moves through data collection, data preparation (cleaning, labeling, and feature engineering), model training, model evaluation and tuning, deployment, monitoring, and retraining. The stages run in order because each depends on the output of the one before it, and the pipeline forms a loop: monitoring a live model reveals when its accuracy is dropping, which triggers retraining on newer data and a fresh trip through evaluation and deployment. For the AIF-C01 exam you need to recognize each stage and what it does, not build the pipeline yourself.
What is the difference between precision and recall?
Precision is the share of the items a model flagged that were truly positive, so it matters most when false positives are costly — for example, a spam filter that must not send real email to the junk folder. Recall is the share of all truly positive items that the model actually caught, so it matters most when you must catch every true case — for example, a cancer screening model where missing a sick patient is dangerous. The F1 score combines both into one balanced number for when both kinds of error hurt.
What is the difference between a managed API and a self-hosted model in production?
With a managed API service, the provider hosts the model and you simply call an endpoint; you get low operational overhead and fast time to value but less control over the infrastructure. Amazon Bedrock is the AWS example for foundation models. With a self-hosted API, you deploy the model onto infrastructure you manage, gaining full control and customization and the ability to keep data inside your own network, but you take on provisioning, scaling, patching, and monitoring. Choose managed for speed and low maintenance, self-hosted for maximum control.
Why do machine learning models need to be retrained?
Models are trained on a snapshot of past data, but the real world keeps changing — new fraud tactics, shifting customer behavior, new products. Over time the live data drifts away from the training data, and the model's accuracy quietly falls; this is called drift or model decay. Monitoring detects the decline, and retraining fixes it by refreshing the model on newer data and redeploying it. This is why the AI/ML lifecycle is a loop rather than a one-time build.
What is the difference between Amazon SageMaker AI and Amazon Bedrock?
Amazon SageMaker AI is the end-to-end service for the traditional machine learning lifecycle: you use it to build, train, tune, and deploy your own models, with features such as Ground Truth for data labeling, Data Wrangler for data preparation, and Feature Store for managing features. Amazon Bedrock is a managed service that gives you access to ready-trained foundation models from several providers through a single API, so you can use generative AI without training a model or running servers. Use SageMaker AI to build and train; use Bedrock to consume existing foundation models.
Sign up free to mark lessons complete, bookmark topics and track your exam readiness.