

# Walkthrough

![A diagram of the end-to-end flow across Amazon Bedrock and SageMaker AI, from defining goals and evaluating, to optimizing data, benchmarking and improving, optimizing inference, and deploying and monitoring.](https://docs.aws.amazon.com/sagemaker/latest/dg/images/sagemaker-ai-optimizer/sagemaker-ai-optimizer-walkthrough-overview.png)


Most teams tuning models for agents in production have struggled getting their models to respond accurately within their budget at the latency needs. When tuning them, they enter what they feel is a time-consuming endless loop of trial-and-error across disconnected tools from preparing evaluation data to deployment then monitoring. After deployment they feel they could have built it faster with the right tools or tuned a less expensive open-weight model to do the job just as well. Then, after launch, the requests users send change over time, and quality can slip with no alert.

SageMaker AI now offers an end-to-end agent-guided experience that optimizes your models for agentic development. The experience accelerates model development from months to days by bringing together an agent, workspace, skills, APIs, and your data so you can create your own domain-specific model tuned to your business goals across quality, cost, and latency. You describe a task in plain language and set your business goals. The agent then builds an evaluation you can trust from your own data. It auto-labels records with a confidence score, routes uncertain ones to your experts, and checks quality before any model is scored. From there, the agent picks the next fix, whether that's a better prompt, better data, or fine-tuning, and ranks every candidate from Amazon Bedrock and SageMaker AI on one leaderboard. After deployment, SageMaker AI scores live traffic against the same bar, and the requests that miss it become the dataset for the next round. Every result links back to the data, evaluations, and configuration that produced it, and all the work runs in your own AWS account with your security and your data.

![The home page prompt "What do you want to build or improve?" next to a proposed plan panel.](https://docs.aws.amazon.com/sagemaker/latest/dg/images/sagemaker-ai-optimizer/sagemaker-ai-optimizer-walkthrough-plan.png)


Figure 1. Describe the task in plain language. The agent proposes an evaluate-first plan and waits for your approval.

"AI-driven business process automation is a high-ROI use case for Karini AI customers, and routing is the first decision in every ERP automation workflow. If one email lands in the wrong class, an invoice can stall or post to the wrong ledger. With SageMaker AI optimizer, we evaluated our router, which sorts inbound emails into expense, GL, vendor, and other classes, testing it on representative ground truth augmented with synthetic data. We compared Claude Haiku 5.5, Strands Decider v2, and Strands Decider 2B side by side, then used what we learned to improve our routing agent. Precision rose 4% over the previous version. Evaluation is now a repeatable step in how we ship every agent to our customers."

— Nitin Wagh, CEO, Karini AI

## Set the bar once
<a name="sagemaker-ai-optimizer-walkthrough-set-the-bar"></a>

Every project starts with your business criteria and your data. You first describe your use case and provide new data if you don't already have it. The agent then moves forward with planning, connecting to your existing Glue Data Catalog, S3, CloudWatch (logs, traces, and more), and Bedrock Knowledge Bases, and it starts planning. The agent drafts a first evaluation dataset from your task description.

The agent proposes criteria for quality, latency, and cost, and you set the threshold each one must clear. For each criterion, the agent writes a scorer, such as a code check, an LLM judge, or a built-in benchmark, and tests it on sample rows first.

## SageMaker AI guides the customer in model selection
<a name="sagemaker-ai-optimizer-walkthrough-compare-models"></a>

The agent then recommends a set of models from both Amazon Bedrock and SageMaker AI including Anthropic Claude and OpenAI GPT, and open-weight models such as Meta's Llama, Qwen, Google's Gemma, and OpenAI. The agent scores benchmarks candidate models against your criteria on a held-out test set and ranks them on one model leaderboard.

If a model already clears the bar at a cost you accept, you can deploy it and stop there. However, if models are not yet meeting your goals, the experience recommends customizing a set of open-weight models and those are the starting point for the optimization that follows.

![A baseline leaderboard ranking the current model and open-weight candidates against routing accuracy, missed escalations, latency, and cost.](https://docs.aws.amazon.com/sagemaker/latest/dg/images/sagemaker-ai-optimizer/sagemaker-ai-optimizer-walkthrough-leaderboard.png)


Figure 2. Example baseline leaderboard ranks proprietary and open-weight models against your criteria. The current model meets both quality bars and misses latency and cost. Qwen3 14B meets latency and cost and is the closest open-weight candidate to fine-tune.

## Build evaluation and training data you can trust
<a name="sagemaker-ai-optimizer-walkthrough-data"></a>

When starting the model customization steps, the agent prepares the data for evaluations. The SageMaker AI data preparation capabilities auto-label raw records and gives each record a confidence score. For records that need a human-in-the-loop labeling, it identifies the records that need human review in Label Studio and then generates synthetic data to fill the gaps. Along the way, data transformation and quality jobs are checking for duplicates, transforming it into training ready data for supervised fine tuning, and label noise before you even train. These time-consuming steps are purpose built for you, so you don't have to rely on third party technology to perform the job.

"For Splunk Agent Observability, our ability to train robust GenAI Eval models relies on access to high-quality, diverse datasets which are hard to curate for very specific tasks. Amazon SageMaker AI data preparation capabilities for synthetic data generation is meaningfully helping us scale these capabilities. We've been able to generate statistically representative synthetic datasets reliably and fast, while preserving the underlying patterns our models depend on. The seamless integration with the rest of our SageMaker workflow means our data scientists and customers spend less time wrangling data and more time building models that drive real enterprise value through Splunk."

— Yash Sheth, Director of Engineering, Splunk Agent Observability

## Find and reuse what your teams already built
<a name="sagemaker-ai-optimizer-walkthrough-reuse"></a>

Part of what a new project needs often exists already, such as a labeled dataset, a feature group, an evaluator, or a fine-tuned model from another team. We didn't want you to rebuild a dataset that another team already labeled.

SageMaker AI now registers your metadata from models, feature groups, evaluators, and datasets in AWS Glue Data Catalog automatically. You (and your agents) can search the catalog by name, owner, or glossary term, and follow lineage from a deployed model back to the source data that trained it. The agent can start a project from a cataloged asset, and each candidate model it produces registers back in the catalog with its lineage. Your datasets and models are versioned along the way so that you can reproduce your results or answer audit questions.

![Lineage from source columns through training to a deployed model.](https://docs.aws.amazon.com/sagemaker/latest/dg/images/sagemaker-ai-optimizer/sagemaker-ai-optimizer-walkthrough-lineage.png)


Figure 3. Lineage follows a deployed model back through training to the source columns. Asset names follow the examples in the catalog documentation.

"By moving our data science models from local laptops to a unified, cloud-based catalog, we ensure our research is repeatable, scientifically valid, and ready to scale. This system replaces manual data prep and technical debt, reducing compute waste by 70% and saving over 700 hours of developer time for every 10 models deployed. This efficiency allows our researchers to focus on creating proprietary IP that strengthens our agriculture research pipeline and delivers yield-saving solutions directly to farmers."

— Bayer Crop Science

## Fix what falls short, starting with the lowest-cost option
<a name="sagemaker-ai-optimizer-walkthrough-fix"></a>

Many tasks reach the bar with a better prompt or the right knowledge base. But, when no candidate clears the bar, the agent reviews the failing examples and lays out a model optimization approach.

![The fix ladder: prompt optimization, retrieval, supervised fine-tuning, then preference and RL training, ordered by what they cost to build and maintain.](https://docs.aws.amazon.com/sagemaker/latest/dg/images/sagemaker-ai-optimizer/sagemaker-ai-optimizer-walkthrough-fix-ladder.png)


Figure 4. The fix ladder. Rungs are ordered by what they cost to build and maintain.
+ When the model is missing knowledge, it connects to an existing Amazon Bedrock Knowledge Base or recommends supervised fine tuning on question-and-answer pairs.
+ When the format is wrong or the model ignores instructions, it uses Amazon Bedrock Prompt Optimization.
+ For reasoning errors and multi-step tasks, it recommends and builds your reinforcement learning with verifiable rewards (RLVR) or AI feedback (RLAIF) pipelines.
+ When a fine-tuned model falls just short of the bar, it tunes the hyperparameters and scores each run against your criteria

![Metric cards comparing accuracy, valid answers, missed contradictions, and response time before and after a prompt change.](https://docs.aws.amazon.com/sagemaker/latest/dg/images/sagemaker-ai-optimizer/sagemaker-ai-optimizer-walkthrough-prompt-results.png)


Figure 5. A prompt change closed most of the gap at no training cost.

When training is the right fix, the agent prepares the data and runs the jobs on SageMaker AI serverless model customization, which allocates the GPUs for you or serverful training on SageMaker Training Jobs. Each fine-tuned candidate lands on the same leaderboard.

## Stay above the bar in production, then start the next round
<a name="sagemaker-ai-optimizer-walkthrough-production"></a>

A model that meets your criteria at launch can drift below them as user requests change and new models arrive. SageMaker AI scores a share of live traffic against the same criteria you used to pick the model. When a score falls below its threshold, you get the alert you set up in Amazon CloudWatch. You can open the lowest-scoring requests to see the prompt, the response, and the scorer's explanation.

Those failures start the next round of optimization. Save them as a new dataset, and the agent uses it to recommend the next fix. When a new model launches, rerun your saved experiments on it.

Before you switch models, shadow test the candidate on a copy of live production traffic. Compare its results with the current model and promote it when it clears your bar.

![A chart of recall on live traffic over time, dropping below the threshold and recovering after the next round.](https://docs.aws.amazon.com/sagemaker/latest/dg/images/sagemaker-ai-optimizer/sagemaker-ai-optimizer-walkthrough-monitoring.png)


Figure 6. Live traffic is scored against your criteria. A drop below the threshold raises an alarm, and the failing requests start the next round.

## How it works at a glance
<a name="sagemaker-ai-optimizer-walkthrough-example"></a>

You decide what success means and approve resource creation, and the agent does the work in between. Take a payments company that uses a large general-purpose model to route support tickets to queues such as billing, fraud, or account access. The model is accurate, and at the company's ticket volume it costs too much. One round works like this:
+ Describe the goal. You type, "I want a cheaper ticket-triage model without losing accuracy." The agent proposes a plan and creates a project when you accept it.
+ Set the bar. The agent turns the goal into criteria such as routing accuracy per queue and missed escalations, and you set each threshold.
+ Compare models. The agent ranks the current model against other proprietary and open-weight candidates on held-out tickets.
+ Prepare data. The agent cleans the labeled tickets, generates synthetic tickets for thin queues, and sends low-confidence labels to your experts.
+ Improve. The agent optimizes the prompt. If escalations are still missed, you approve a training plan, and the agent fine-tunes the closest open-weight model.
+ Deploy and monitor. The agent shows the instance type and cost and deploys after you approve. SageMaker AI then scores production tickets against your criteria.

## Work the way you want
<a name="sagemaker-ai-optimizer-walkthrough-interfaces"></a>

The same agent and the same projects are available in every interface, all built on the SageMaker Python SDK.
+ In SageMaker Studio, open guided model customization from Applications and work in the leaderboard, datasets, experiments, and monitoring views next to the agent chat.
+ In your notebook or IDE, open the code the agent saves for every step in the project's Git repository and run it with the SDK.
+ In your own coding agent, load SageMaker Agent Skills into Kiro, Claude, or Codex.
+ With your own tools, extend the agent with your own skills and MCP servers.

## Keep control of your data and models
<a name="sagemaker-ai-optimizer-walkthrough-security"></a>

![Your data, jobs, and results stay within your AWS account and Region under the IAM controls you already use.](https://docs.aws.amazon.com/sagemaker/latest/dg/images/sagemaker-ai-optimizer/sagemaker-ai-optimizer-walkthrough-security.png)


Figure 7. Optimization runs under the AWS security controls you already use.

The end-to-end experience is built on IAM and uses the AWS security controls you already have. Your datasets, labels, models, traces, and evaluation results stay in your AWS account and the AWS Region you choose. Jobs run under AWS Identity and Access Management (IAM) roles that you control. Each user's agent runs in its own managed sandbox, which reaches only what your IAM role and network settings allow.

The agent saves every artifact in the project's Git repository. We don't use your data, conversations, or results to train models for other customers.

## Get started today
<a name="sagemaker-ai-optimizer-walkthrough-get-started"></a>

The experience is now generally available in the US East (N. Virginia) and US West (Oregon) AWS Regions.
+ In SageMaker Studio, click the Optimizer application, choose guided model customization, and describe your use case. If you don't have a SageMaker AI domain, a one-click setup creates one.
+ In your IDE, install the SageMaker Python SDK, load SageMaker Agent Skills into your coding agent, and describe your use case.

## Resources
<a name="sagemaker-ai-optimizer-walkthrough-resources"></a>
+ [Preparing Data with SageMaker AI Data Preparation](ai-data-preparation.md) – Announcing AI data preparation capabilities in Amazon SageMaker
+ [Catalog](sagemaker-ai-optimizer-catalog.md) – Find, reuse, and trace SageMaker AI assets in AWS Glue Data Catalog
+ [Skills for Agents](sagemaker-skills-for-agents.md) – SageMaker Agent Skills