SaveMyCert
Log in
5 of 5 free questions left today·for 10 a day
Foundation Model Integration, Data Management, and Compliance

AIP-C01 GenAI Solution Design: Architecture, Proofs of Concept and Standards

15 min readAIP-C01 · Foundation Model Integration, Data Management, and ComplianceUpdated

Designing a generative AI solution on AWS means turning business requirements and technical constraints into concrete choices: which customization technique, which hosting and invocation pattern, which integration or orchestration pattern, and how to prove the idea in a proof of concept before building it at scale. This lesson covers AIP-C01 Task 1.1 end to end: choosing between prompting, retrieval and fine-tuning, Amazon Bedrock versus SageMaker AI hosting, service tiers, asynchronous and workflow patterns, PoC measurement of performance, cost and business value, and standardising designs with the Well-Architected Generative AI Lens and reusable components. Model selection and configuration (Task 1.2), vector stores and retrieval (Tasks 1.4 and 1.5) and prompt governance (Task 1.6) have their own lessons.

What you’ll learn
  • Choose prompt engineering, RAG, fine-tuning or continued pre-training from the requirement, and combine them when one technique cannot meet every need.
  • Decide between Bedrock catalog models, Bedrock customization, Custom Model Import and SageMaker AI endpoints, and pick the right invocation pattern and Bedrock service tier for latency, payload and cost.
  • Design asynchronous integrations (SQS with a status store, WebSocket push, EventBridge into Step Functions Standard) for long or throttle-prone model calls.
  • Distinguish deterministic workflows from autonomous agents, and managed Bedrock Knowledge Bases from custom RAG pipelines.
  • Run a proof of concept that validates feasibility cheaply, compares models on your own data, measures latency, tokens and throughput correctly, attributes cost and proves business value.
  • Standardise GenAI workloads with the Generative AI Lens as a shared custom lens, review templates, and reusable components such as Service Catalog products, CDK construct libraries and StackSets.

Choosing the customization approach: prompt, retrieval, fine-tuning or continued pre-training

Pick the cheapest technique that fixes the actual gap: prompt engineering for output format and behaviour the model can already produce, retrieval-augmented generation (RAG) for facts that change or must be cited, fine-tuning for a style or behaviour that prompting cannot hold and for which you have labelled examples, and continued pre-training for deep domain vocabulary learned from large amounts of unlabelled text. Requirements decide this, not ambition: a design that trains a model to fix a layout problem, or bakes daily-changing prices into weights, fails a stated constraint.

TechniqueFixesNeedsCannot do
Prompt engineering (instructions, few-shot examples, templates)Output format, tone within reach, task framingNothing but prompt changes; live in minutesTeach knowledge the model lacks; hold a style that prompts have already failed to hold
RAG (retrieve at request time)Fresh, private or fast-changing facts; answers with citationsA retrieval source kept in sync (knowledge base, database, API)Change how the model writes
Fine-tuning (labelled prompt-response pairs)A consistent voice, style or task behaviourA labelled dataset and a training jobTrack facts that change daily; cite the source of an answer
Continued pre-training (unlabelled text)Domain language and background knowledgeLarge unlabelled corpus; the most expensive optionTeach an output structure; cite sources

Three reasoning rules follow from the table. First, fix format with the prompt: if the model understands the content but the layout varies, add the headings and a one-shot example to the template. Second, facts that change or must be cited belong in retrieval, because knowledge absorbed into weights is stale after the next edit and cannot point to the page it came from. Third, techniques combine: when one requirement is about current facts and another is about voice, the design retrieves the facts at request time and fine-tunes for the voice, because each technique fixes only its own gap. Relocating instructions from the prompt into a retrieval source does not change behaviour, because retrieved text reaches the model as prompt text too.

Where the model runs: Amazon Bedrock or a SageMaker AI endpoint

Host in Amazon Bedrock when a managed, serverless API is enough, and on an Amazon SageMaker AI endpoint when you need your own container, your own inference code or a chosen GPU instance type. Bedrock gives you three ways to run a model: catalog foundation models on demand, models customised inside Bedrock (fine-tuning or continued pre-training jobs that produce a Bedrock-managed custom model), and Custom Model Import for weights you trained elsewhere.

OptionYou supplyYou controlFits when
Bedrock catalog modelPromptsInference parameters and service tierA catalog model meets the need
Bedrock model customizationTraining dataThe training job; the result stays Bedrock-managedYou want a tuned catalog model behind Bedrock APIs
Bedrock Custom Model ImportWeights of a supported architecture (for example Llama, Mistral or Qwen families) in Hugging Face format in S3Nothing about instances or scalingYou own the weights and want serverless, on-demand Bedrock runtime APIs
SageMaker AI endpointA container with your model and codeInstance type (including GPU), scaling, inference codeCustom pre/post-processing in the container, a non-standard architecture, or a mandated GPU type

Custom Model Import bills per active model copy in five-minute windows, scales copies to zero when idle and leaves only a small monthly storage charge, so it suits bursty or idle-prone traffic. Its limits are what push a design to SageMaker AI: you hand over weights, not container code, so a proprietary library that must run beside the model has no place to live; an architecture outside the supported list (for example custom attention layers) cannot be imported; imported models are invoked on demand rather than through batch inference; and an import job cannot be declared in AWS CloudFormation, so it is scripted with the API or CLI. Custom Model Import reuses weights you already have, whereas a Bedrock customization job trains again from a catalog base model. SageMaker JumpStart can deploy open-weight models to an endpoint quickly, but every endpoint is billed infrastructure you must delete when the test ends.

Matching the invocation pattern to latency, payload and volume

Choose the invocation pattern from three facts: whether someone is waiting for the answer, how large and slow each request is, and how traffic arrives. Synchronous calls serve users in the request; batch processing serves files of work nobody waits on; asynchronous endpoints sit between the two.

PatternResponseScale to zeroGPUUse for
Bedrock runtime (InvokeModel, Converse, streaming variants)SynchronousServerless, pay per tokenManagedInteractive features
Bedrock batch inferenceJob reads prompts from S3, writes results to S3ServerlessManagedLarge overnight jobs at a discount to on-demand for supported models
SageMaker AI real-time endpointSynchronous, small payloads, short callsNot with a standard production variant; with inference components it can, but waking takes minutesYesSteady traffic, low latency, your own container
SageMaker AI serverless inferenceSynchronous, small payloadsYes, with cold startsNo (CPU only)Sporadic traffic for CPU-sized models
SageMaker AI asynchronous inferenceQueued; result written to S3, optional Amazon SNS notificationYesYesPayloads up to 1 GB and processing up to an hour, arriving sporadically
SageMaker AI batch transformOffline job over a datasetRuns only during the jobYesScheduled bulk scoring with no per-request result

Two near-twin traps recur. Serverless inference scales to zero but has no GPU, so it cannot host a typical LLM; asynchronous inference scales to zero and supports GPUs but cannot return the answer inside the caller's request. And a real-time endpoint with target-tracking auto scaling keeps at least one instance running, so it pays through every idle night.

Bedrock service tiers and provisioned throughput

Amazon Bedrock lets you trade price against speed and assurance per request with the service tier (the service_tier setting), plus capacity commitments for workloads that must not throttle.

OptionWhat you getCommitmentTypical fit
StandardThe default on-demand behaviourNoneMost traffic
PriorityRequests prioritised ahead of Standard and Flex, at a premium per-token priceNone; shares the on-demand quotaSpiky, latency-sensitive customer traffic
FlexDiscounted per-token price; requests may take longerNone; shares the on-demand quotaLatency-tolerant requests that must still be individual API calls
ReservedReserved input and output tokens-per-minute capacity, separate from the on-demand quota; demand above it overflows to StandardOne- or three-month reservationA predictable baseline that must not throttle, for a season or longer
Provisioned throughputDedicated model units billed whether used or notHourly or term commitmentConsistent capacity; required for some custom models

Read the requirement carefully: fastest without a reservation points to Priority; assured capacity for a known baseline over a few months points to Reserved; cheapest per token, per-request points to Flex, while cheapest for files of prompts points to batch inference. Only a reservation assures capacity: a quota is a ceiling, not a guarantee, and retry logic recovers from throttling rather than preventing it.

Integration patterns: decoupling long and throttle-prone model calls

When a model call can take minutes or be throttled, take it out of the client's request: accept the work, put it in a durable buffer, process it in the background and tell the client when it is done. Longer timeouts only keep connections open longer; a throttled synchronous call still fails with nothing holding the work for a retry.

  • Queue plus status store. Amazon API Gateway writes each job to Amazon SQS and returns a job ID; a Lambda consumer calls the model, retries through throttling and records status and result (for example in DynamoDB). Nothing is lost during throttling peaks, and the queue smooths bursts.
  • Push the result instead of polling. An API Gateway WebSocket API keeps a connection open so the back end can post the finished result to that connection the moment it exists. Amazon SNS delivers to subscribed endpoints such as email, SMS, HTTP(S) endpoints, SQS queues and Lambda functions, so it has no way to address one client's open session.
  • Long, multi-step jobs. An Amazon EventBridge rule on S3 object creation starts an AWS Step Functions Standard workflow, a Map state fans out over chunks (chapters, pages), each Bedrock task has its own retry policy, and a final step publishes to SNS. Standard workflows run for up to a year; Express workflows stop at five minutes and a Lambda function at 15 minutes, so neither can carry a job that takes most of an hour.

Provisioned or reserved capacity can remove throttling, but it does not make a multi-minute call suitable for a synchronous web request, and it adds standing cost.

Deterministic workflows versus autonomous agents

Use a workflow when you can draw the path in advance and an agent when the path must be decided at run time. Regulated processes with fixed, audited steps belong in an AWS Step Functions Standard workflow: it runs steps in a defined order, records every state's input and output in its execution history, calls Bedrock through a service integration and pauses for a human with a task token (.waitForTaskToken). Express workflows suit short, high-volume runs and cannot wait days for an approver.

OptionWho decides the pathFits
Step Functions Standard + BedrockYou, at design timeFixed, auditable, long-running or human-approved processes
Amazon Bedrock FlowsYou: a predefined sequence of prompt and other nodesRepeatable prompt pipelines, not run-time tool choice
Amazon Bedrock AgentsThe model, at run time, from action groups (APIs backed by Lambda) and the conversationMulti-turn requests where which APIs to call, and in what order, depends on the user
Amazon Bedrock AgentCore RuntimeYour agent code (any framework, such as LangGraph or Strands Agents)Managed serverless hosting of an existing framework agent with per-session isolation and long sessions

The strongest designs are often hybrids: a workflow fixes and records the audited path, and one task inside it calls an agent for the single open-ended step (for example, a research step in which each lookup depends on what the previous one found). Encoding every combination with Choice states is brittle; handing the whole process to one agent loses the enforced order auditors need. A knowledge base retrieves text but does not act; a chain of Lambda functions makes ordering, retries and audit records custom code. Building agents in detail is Task 2.1; here the decision is which pattern the requirements call for.

Managed RAG with Bedrock Knowledge Bases or a custom pipeline

Start with an Amazon Bedrock knowledge base when the goal is the least operational overhead: it manages ingestion from sources such as S3, chunking, embedding, the vector index and retrieval, and its RetrieveAndGenerate API returns answers with citations. Build your own chunking, embedding and vector store pipeline (for example Lambda plus Amazon OpenSearch Service, or a framework on Amazon ECS) only when a requirement the managed service cannot meet justifies owning that code and infrastructure.

Not every question is a similarity search. When answers must be computed from warehouse tables (totals, rankings, period-over-period changes), a knowledge base connected to a structured data store such as Amazon Redshift turns the natural-language question into SQL (the GenerateQuery capability), runs it against the current tables and generates the answer from the results. Embedding table rows as text chunks retrieves similar passages but cannot aggregate, and prompting a model with the schema and running its SQL yourself is the custom code the managed feature removes. Vector store and retrieval design in depth belong to Tasks 1.4 and 1.5.

Proofs of concept: validating feasibility and comparing models

A proof of concept (PoC) answers one question cheaply before money goes into a production build: can this work, how well does it perform, and is it worth it? The fastest feasibility checks create nothing that must be cleaned up.

  • Bedrock console playgrounds let anyone, including non-coders, try prompts and inference parameters such as temperature against catalog models with nothing deployed.
  • Querying one document without a knowledge base: RetrieveAndGenerate with an external source accepts a single document from S3 or as bytes (up to 10 MB) and returns cited answers, with no vector store or sync job.
  • Avoid PoC paths that leave billed resources behind (a quick-created vector store, a JumpStart endpoint, a notebook) or take far longer than the question deserves (fine-tuning).

To choose between models, test them on your own data at scale, not on public benchmarks or a handful of playground prompts. Amazon Bedrock model evaluation offers three job types:

Evaluation jobHow it scoresNeeds
LLM-as-a-judgeA judge model rates each response on built-in quality metrics (such as correctness, helpfulness, faithfulness) and responsible-AI metrics (such as harmfulness), with an explanation per scoreA prompt dataset; reference answers are optional for many metrics
Automatic (programmatic)Algorithmic metrics such as accuracy, robustness and toxicityReference answers for accuracy; gives no per-score explanation
HumanA work team rates or compares responsesPeople available to do the rating

An LLM-as-a-judge job evaluates one generator model, so comparing two candidates means one job per model on the same dataset. Live A/B tests on customers are production experiments, not PoC evidence. Building full evaluation systems is Task 5.1.

Measuring PoC performance, throughput, cost and business value

A PoC must report measured numbers, and each number has a specific source. Use the wrong one and the report overstates latency, cost or capacity.

NeedRight sourceCommon wrong source
How soon users see the first words of a streamed answerCloudWatch TimeToFirstToken (streaming APIs only: ConverseStream, InvokeModelWithResponseStream)InvocationLatency, which runs to the last token
Tokens and latency of each individual callThe Converse response's usage (inputTokens, outputTokens, totalTokens) and metrics.latencyMsCloudWatch token metrics (aggregated per model over time); model invocation logs (off by default)
Billed tokens for cost projectionInput and output token counts (InputTokenCount, OutputTokenCount or per-response usage)EstimatedTPMQuotaUsage, an approximation of quota consumption, not billing
Input size before a callThe CountTokens API (input side only)CloudTrail, which records who called which API, not tokens

Throughput validation. Bedrock deducts input tokens plus max_tokens from the tokens-per-minute quota when a request starts and returns the unused part when it ends (some models also apply an output-token burndown multiplier); billing follows the tokens actually used. A load test that throttles while measured usage sits well below quota usually means max_tokens is set far above real output. Right-size it, re-run the test at projected peak and compare InvocationThrottles before asking for a quota increase sized to real demand. Streaming does not change the reservation, and more Lambda concurrency only reaches the quota sooner.

Cost attribution. Create an application inference profile per team or PoC, tag it, invoke through its ARN and activate the tags as cost allocation tags; Cost Explorer then splits model spend. Base foundation models are AWS-owned and cannot be tagged. Bedrock can also allocate cost by tags on IAM principals (users and roles), but that cannot separate teams that share one execution role.

Business value. Feasibility and latency are not value. Prove value with a business KPI against a baseline, ideally a pilot group compared with a control group on the same work, measured in the unit the business already tracks (time or cost per case, cases completed per day). Opinions and usage counts show adoption, not outcome. Project cost as billed tokens per transaction from a production-like run, times volume, times price; a PoC's total bill mixes in exploratory traffic that production will not have, so it is a poor basis for projection.

Promoting to production. Rebuild console-made PoC resources (knowledge base, guardrail, prompts) as infrastructure as code (AWS CloudFormation or the AWS CDK) and deploy them through the pipeline; there is no console export that moves them between accounts. Resources CloudFormation does not support, such as a Custom Model Import job, are scripted with the API or CLI in the same pipeline. Model availability and Bedrock quotas are set per account and per Region, so a quota raised in the sandbox says nothing about the production account in another Region: check availability and request increases there.

Standardising with the Well-Architected Generative AI Lens and reusable components

Standardised components make every team build and review GenAI workloads the same way: shared review content in the AWS Well-Architected Tool, and reusable, versioned infrastructure for building.

The Generative AI Lens

The Generative AI Lens extends the Well-Architected Framework for foundation-model applications across lifecycle stages from scoping and model selection through customization, development, deployment and continuous improvement. Its six pillars include, for example: Security (protecting endpoints, mitigating harmful outputs and excessive agency, auditing, securing prompts); Reliability (throughput, failure handling, versioned artifacts, distributed inference); Operational excellence (output quality, operational health, traceability, lifecycle automation); Performance efficiency (capturing and maintaining model performance); Cost optimization (cost-optimized models, prompts engineered for cost, efficient vector stores and agent workflows); and Sustainability. Traditional ML that trains its own models with no foundation model is reviewed with the Machine Learning Lens instead.

AWS distributes the Generative AI Lens as a JSON file in its public custom-lens GitHub repository, so it does not appear in the tool's built-in lens catalog: you import it as a custom lens, publish it, then share it. Custom lenses are shared through the Well-Architected Tool's own sharing (not AWS RAM) with accounts, IAM users, an organization or OUs; sharing with the organization requires enabling AWS Organizations access in the tool first. When you change a custom lens, a major version notifies workloads and waits for owners to upgrade, while a minor version applies automatically without notification.

Well-Architected Tool featureWhat it does
Custom lensAdds your own questions and improvement guidance (company GenAI standards)
Review templatePre-fills answers and notes for shared platform controls; shareable; new workloads can be defined from it
ProfileCaptures business context to prioritise questions; answers nothing
MilestoneSnapshots one workload's review at a point in time for before-and-after comparison

Reusable building blocks

MechanismStrengthLimit
AWS Service Catalog product with a launch constraint, portfolio shared to an OUDevelopers self-serve without permissions to create the underlying resources; central team publishes new product versionsEach account must launch it
Versioned CDK construct library in an internal package repository (for example AWS CodeArtifact)Every service imports the approved setup and picks up fixes through dependency upgradesDeploying roles still need create permissions
CloudFormation StackSet, service-managed permissions, automatic deployment to an OUBaseline in every current and future account of the OU, updated from one place, no team actionNot self-service
CloudFormation StackSet, self-managed permissionsWorks without AWS Organizations; you name the target accountsAdministration and execution IAM roles must exist in each account, and accounts created later get nothing until someone adds them
AWS Config conformance packDetects whether resources complyDoes not create anything

The deciding phrase is often accounts created later: only service-managed StackSets with automatic deployment cover them without further action. Copying a reference stack into each repository starts correct but drifts, with no upgrade path. Pair building and reviewing: reusable versioned code for what teams deploy, and a shared custom lens or review template for how they are assessed.

Tip. Task 1.1 questions are long scenarios about a company's GenAI application that state several requirements at once, such as a freshness rule plus a citation rule plus a ban on training, or a hardware need plus a limit on idle cost plus a required API. Every option is a real AWS pattern, and the wrong ones miss exactly one stated constraint: fine-tuning where retrieval fits, serverless inference where a GPU is needed, a reservation where none is allowed, an Express workflow for a job that runs most of an hour, or an agent where auditors need a fixed order. Proof-of-concept questions ask which measurement source answers the committee's question (first-token latency, per-call usage, billed tokens, a KPI against a control group) and how to validate quota and cost attribution before scaling. Standardisation questions contrast Well-Architected Tool features (custom lens, versions, review templates, profiles, milestones) and reusable components (Service Catalog launch constraints, CDK construct libraries, StackSets, conformance packs). Expect multiple-response items where two different techniques together meet the requirements.

Key takeaways
  • Fix format with the prompt, put changing or citable facts in retrieval, fine-tune for a voice prompting cannot hold, and combine techniques when needs differ.
  • Bedrock for managed serverless APIs; Custom Model Import for your own supported-architecture weights; a SageMaker AI endpoint for your own container, code or GPU type.
  • Serverless inference has no GPU; asynchronous inference scales to zero but returns results later; batch inference and batch transform are for work nobody waits on.
  • Priority is fastest without a reservation, Flex is cheapest per request, Reserved assures a baseline for one or three months with overflow to Standard.
  • Take long or throttle-prone model calls out of the request: queue the work, store status, and push the result; use Step Functions Standard for jobs beyond Express or Lambda limits.
  • Workflows for paths you can draw in advance, agents for paths decided at run time, and a workflow that calls an agent for one open-ended step.
  • Measure PoCs with the right source: TimeToFirstToken for streaming, response usage and metrics per call, billed tokens for cost, and a KPI against a control group for value.
  • Bedrock reserves input plus max_tokens against the quota at request start; quotas and model availability are per account and per Region.
  • The Generative AI Lens is imported, published and shared as a custom lens; major versions wait for owners, minor versions apply automatically.

Frequently asked questions

When should a GenAI design use RAG instead of fine-tuning?

Use retrieval-augmented generation when the model needs facts that change, are private, or must be cited, because RAG reads the current source at request time and returns where the passage came from. Fine-tuning changes how a model writes or behaves and needs labelled examples and a training job; it cannot keep up with facts that change daily and cannot cite a source. Many designs use both: retrieval for current facts and fine-tuning for a consistent voice.

When should I host a model on SageMaker AI rather than Amazon Bedrock?

Host on a SageMaker AI endpoint when you need your own container or inference code beside the model, a model architecture Bedrock Custom Model Import does not support, or a specific GPU instance type. If you only need serverless, on-demand access to a catalog model or to your own weights in a supported architecture, Amazon Bedrock (including Custom Model Import) avoids managing instances and scaling.

What is the difference between the Bedrock Priority, Flex and Reserved tiers?

All three are Amazon Bedrock service tiers alongside the default Standard tier. Priority processes requests ahead of Standard and Flex for a premium per-token price with no reservation. Flex gives a discounted price for requests that can take longer. Reserved reserves tokens-per-minute capacity for one or three months, separate from the on-demand quota, and overflows extra demand to Standard.

Why does Bedrock throttle requests when token usage is below the quota?

Amazon Bedrock deducts the input tokens plus the request's max_tokens from the tokens-per-minute quota when each request starts, and returns the unused part only when it finishes. If max_tokens is set far above the real output length, each request reserves much more quota than it uses, so requests throttle while measured usage stays low. Right-size max_tokens and re-test before requesting a quota increase.

Which metric shows how fast a streaming Bedrock response feels to users?

TimeToFirstToken, which Amazon Bedrock publishes to CloudWatch for streaming APIs such as ConverseStream, measures the time until the first token arrives. InvocationLatency measures until the last token, so it overstates the wait users perceive when answers stream. For per-call figures, the Converse response itself returns token usage and metrics.latencyMs.

How do I track Bedrock model cost per team or proof of concept?

Create an application inference profile for each team or PoC, tag it, invoke the model through that profile's ARN, and activate the tags as cost allocation tags so AWS Cost Explorer splits the spend. Base foundation models cannot be tagged. Cost allocation by IAM principal tags also exists, but it cannot separate teams that call through one shared role.

How do I use the Well-Architected Generative AI Lens in the Well-Architected Tool?

AWS publishes the Generative AI Lens as a JSON custom lens in its public GitHub custom-lens repository rather than in the tool's built-in lens catalog. Import it as a custom lens, publish it, and share it with accounts, users, an organization or OUs; sharing with an organization requires enabling AWS Organizations access in the Well-Architected Tool. Use the Machine Learning Lens instead for traditional ML workloads with no foundation model.

What makes a GenAI proof of concept show business value?

A proof of concept shows business value when it measures a business outcome against a baseline, ideally a pilot group compared with a control group doing the same work, measured in the unit the business already tracks, such as time or cost per case. Latency, benchmark scores, user opinions and usage counts show feasibility or adoption, not value. Pair the measured saving with a cost projection built from billed tokens per transaction at production volume.

Sign up free to mark lessons complete, bookmark topics and track your exam readiness.

Spotted a mistake in this lesson?