Amazon Bedrock

Generative-AI applications without owning a single GPU. One managed API in front of foundation models from several vendors, so choosing a model is a parameter, not a rewrite. Bedrock runs a private copy of the model for you: your prompts and your documents never train anyone's base model.

Xây ứng dụng Generative-AI mà không phải sở hữu GPU nào. Một API được quản lý đứng trước các foundation model của nhiều hãng, nên đổi model chỉ là đổi một tham số, không phải viết lại. Bedrock chạy một bản sao riêng của model cho bạn: prompt và tài liệu của bạn không bao giờ được dùng để train base model của ai cả.

Reach for it / not the right toolKhi nào dùng / khi nào không

Reach for BedrockChọn Bedrock

  • You want a chatbot, a summariser or a text/image generator this quarter, and nobody on the team trains models.Bạn cần chatbot, bộ tóm tắt hay bộ sinh văn bản/ảnh trong quý này, và không ai trong team biết train model.
  • Answers must be based on your own documents — contracts, runbooks, a product catalogue — without shipping them to a third party.Câu trả lời phải dựa trên tài liệu của chính bạn — hợp đồng, runbook, catalogue sản phẩm — mà không gửi chúng cho bên thứ ba.
  • You expect to compare models and switch later; the unified API means that's a config change.Bạn dự định so sánh nhiều model rồi đổi về sau; API chung khiến việc đó chỉ là đổi config.
  • Traffic is spiky or unknown — on-demand per-token billing beats sizing a GPU fleet you can't predict.Lưu lượng lên xuống thất thường hoặc chưa rõ — tính tiền theo token on-demand hơn hẳn việc phải ước lượng một dàn GPU.

Not the right toolKhông phải chỗ dùng

  • You're training a model from scratch, or need custom training loops and your own containers → SageMaker.Bạn train model từ đầu, hoặc cần vòng lặp huấn luyện riêng và container của mình → SageMaker.
  • The task is a solved, narrow one — transcription, translation, OCR, entity extraction. Use the purpose-built AI services; they're cheaper and deterministic to price.Bài toán đã hẹp và có sẵn lời giải — chuyển giọng nói thành văn bản, dịch, OCR, trích xuất thực thể. Dùng các AI service chuyên dụng; rẻ hơn và dễ tính chi phí hơn.
  • You need exact, auditable arithmetic or lookups. A language model is the wrong shape for that — query the database.Bạn cần tính toán hay tra cứu chính xác, kiểm toán được. Language model không hợp cho việc đó — hãy truy vấn database.
  • A model, region or context length you need isn't offered — availability varies by region, and access must be requested per model.Model, region hay độ dài ngữ cảnh bạn cần không có sẵn — mỗi region hỗ trợ khác nhau, và phải xin quyền truy cập cho từng model.

The shape of the serviceHình dạng của service

A foundation model (FM) is a large model somebody else already trained on a huge pile of text or images. You don't build it; you call it, and optionally adapt it. Bedrock's job is to put one managed door in front of a shelf of them. Foundation model (FM) là một model lớn mà người khác đã train sẵn trên khối lượng văn bản hoặc ảnh khổng lồ. Bạn không xây nó; bạn gọi nó, và có thể tinh chỉnh thêm. Việc của Bedrock là dựng một cánh cửa được quản lý trước cả kệ model đó.

Amazon Bedrock architecture. A user or application calls one unified API — the same InvokeModel and Converse calls for every model. Behind it sits a shelf of foundation models from AI21 Labs, Amazon, Anthropic, Cohere, Meta, Mistral AI and Stability AI, each run as a private copy for your account. An interactive playground lets you try models before building. Alongside sit Guardrails, Knowledge Bases for retrieval-augmented generation which read your documents from a vector store, and fine-tuning which reads labelled training data from Amazon S3. AMAZON BEDROCK user / app SDK · CLI UNIFIED API InvokeModel Converse playground try before build FOUNDATION MODELS (FMs) AI21 Labs Amazon Anthropic Cohere Meta Mistral AI Stability AI …and more ids carry a provider prefix a private copy runs for you Guardrails topics · PII harmful content Knowledge Base (RAG) looks up your docs at query time Fine-tuning trains the private copy new weights, yours only your documents + a vector store Amazon S3 labelled training data

Everything above the dashed line is Bedrock's problem, not yours. The only things you own are the two boxes at the bottom — your documents and your training data — and both stay in your account.

Mọi thứ bên trong đường nét đứt là việc của Bedrock, không phải của bạn. Bạn chỉ sở hữu hai hộp dưới cùng — tài liệu và dữ liệu huấn luyện — và cả hai đều nằm lại trong tài khoản của bạn.

Why the unified API mattersVì sao API chung lại quan trọng Every provider ships a different native request format. Bedrock puts one call in front of all of them, so the model becomes a value in a config file. In an exam answer, "we must be able to change model provider later without re-writing the application" is Bedrock, every time. Mỗi nhà cung cấp có một định dạng request riêng. Bedrock đặt một lệnh gọi chung trước tất cả, nên model trở thành một giá trị trong file config. Trong đề thi, "phải đổi được nhà cung cấp model sau này mà không viết lại ứng dụng" luôn luôn là Bedrock.

Your copy, your dataBản sao của bạn, dữ liệu của bạn

This is the sentence that wins the legal argument: Bedrock runs a copy of the foundation model that only you can reach. Prompts, completions and anything you fine-tune on are not used to train the base model and are not shared with the model provider. Đây là câu chốt để thắng phần tranh luận pháp lý: Bedrock chạy một bản sao của foundation model mà chỉ bạn truy cập được. Prompt, câu trả lời và mọi dữ liệu bạn dùng để fine-tune không được dùng để train base model và không được chia sẻ với nhà cung cấp model.

Private copyBản sao riêng Fine-tune it and the result is a custom model in your account — nobody else's traffic touches it.Fine-tune nó và kết quả là custom model trong tài khoản bạn — không traffic của ai khác chạm vào.
Stays in-regionỞ lại trong region Data doesn't leave the region you called, unless you switch on a cross-region feature yourself.Dữ liệu không rời region bạn gọi, trừ khi chính bạn bật một tính năng chạy chéo region.
KMS + PrivateLinkKMS + PrivateLink Custom models encrypt with KMS; a VPC endpoint keeps calls off the public internet.Custom model mã hoá bằng KMS; VPC endpoint giữ lệnh gọi không đi qua internet công cộng.
IAM + CloudTrailIAM + CloudTrail Access is plain IAM per model id; invocations are auditable, and prompt/response logs go where you choose.Quyền truy cập là IAM thuần theo từng model id; lệnh gọi được ghi lại, và log prompt/response đi tới nơi bạn chọn.
"Not used for training" ≠ "not logged""Không dùng để train" ≠ "không được ghi log" Model invocation logging is something you turn on, pointing at your own S3 bucket or CloudWatch log group. That's the copy of the prompts that will leak if the bucket is public — the risk moved to your side of the line, so treat those logs as sensitive data. Model invocation logging là thứ bạn tự bật, trỏ vào bucket S3 hoặc log group CloudWatch của mình. Đó mới là bản sao prompt sẽ rò rỉ nếu bucket bị công khai — rủi ro đã chuyển sang phía bạn, nên hãy coi log đó là dữ liệu nhạy cảm.

RAG vs fine-tuning — the decisionRAG hay fine-tuning — quyết định

Both are "put my data into the answer", and they are not interchangeable. RAG changes what the model knows right now; fine-tuning changes how it behaves. If the requirement contains the words up to date, internal documents or cite the source, it's RAG. Cả hai đều là "đưa dữ liệu của tôi vào câu trả lời", và chúng không thay thế nhau được. RAG thay đổi những gì model biết ngay lúc này; fine-tuning thay đổi cách model hành xử. Nếu yêu cầu có chữ mới nhất, tài liệu nội bộ hay trích dẫn nguồn, đó là RAG.

Two paths for getting your own data into an answer. The RAG path: your documents are chunked and embedded once into a vector store; at query time the question retrieves the top matching passages, which are handed to an unchanged foundation model, producing an answer grounded in your documents with citations. The fine-tuning path: labelled prompt and answer pairs go through a training job that produces a custom model with new weights, which then requires Provisioned Throughput to serve. RAG · KNOWLEDGE BASE — changes what the model KNOWS your documents S3 · wiki · tickets chunk + embed once, then on change vector store OpenSearch / pgvector question at query time retrieve top-k passages pasted into the prompt FM · unchanged answer + citations no weights move FINE-TUNING — changes how the model BEHAVES labelled examples prompt → answer pairs training job hours · costs money custom model new weights, private Provisioned Throughput needed new facts arrive → you train again; there is no incremental edit worth it for: tone, output format, a domain vocabulary the model fumbles wrong for: facts that change, per-customer data, anything needing a citation

Same goal, two very different cost curves. The top path is an index you re-run when a document changes; the bottom path is a training job you re-run and then keep paying to host.

Cùng mục tiêu, hai đường chi phí rất khác nhau. Đường trên là một index chạy lại khi tài liệu đổi; đường dưới là một training job phải chạy lại rồi còn phải trả tiền để host tiếp.

Knowledge Base (RAG)Knowledge Base (RAG) Fine-tuningFine-tuning
ChangesThay đổi cái gì what the model knows right now — weights untouchednhững gì model biết ngay lúc này — không đụng tới weights how the model behaves — the weights themselves movecách model hành xử — chính weights bị thay đổi
Updating itCập nhật re-index the changed document — minutesindex lại tài liệu vừa đổi — vài phút run the training job again — hours, and a new model versionchạy lại training job — hàng giờ, và ra một phiên bản model mới
NeedsCần gì a vector store (OpenSearch Serverless, Aurora pgvector…) + your documentsmột vector store (OpenSearch Serverless, Aurora pgvector…) + tài liệu của bạn labelled prompt/answer pairs in S3 — someone has to write themcác cặp prompt/answer đã gán nhãn trong S3 — phải có người viết ra
Serving costChi phí phục vụ on-demand tokens; prompts get longer, so cost per call rises a bittoken on-demand; prompt dài ra nên chi phí mỗi lần gọi nhích lên Provisioned Throughput — a committed hourly charge whether you call it or notProvisioned Throughput — trả theo giờ đã cam kết, dùng hay không cũng trả
CitationsTrích dẫn nguồn yes — the retrieved passage is the sourcecó — đoạn văn được truy xuất chính là nguồn no — the knowledge is dissolved into the weightskhông — kiến thức đã tan vào trong weights

Agents, Guardrails, and the billAgents, Guardrails và hoá đơn

Agents — the model is allowed to actAgents — cho model được phép hành động

A plain model can only produce text. An Agent is that model plus a list of tools you registered — typically Lambda functions or an API described by an OpenAPI schema. The model decides which one to call, Bedrock invokes it with your IAM role, feeds the result back, and loops until it can answer. "Check stock, then place the order" becomes possible; so does "delete the order", which is why the role matters more than the prompt. Model thuần chỉ sinh ra văn bản. Agent là model đó cộng với danh sách công cụ bạn đăng ký — thường là hàm Lambda hoặc một API mô tả bằng OpenAPI schema. Model tự chọn gọi cái nào, Bedrock gọi nó bằng IAM role của bạn, đưa kết quả về, rồi lặp cho tới khi trả lời được. "Kiểm tra tồn kho rồi đặt hàng" trở nên khả thi; "xoá đơn hàng" cũng vậy, nên cái role quan trọng hơn cái prompt.

Guardrails — a filter that isn't the modelGuardrails — bộ lọc nằm ngoài model

Denied topicsChủ đề bị cấm Describe a subject in a sentence — investment advice, competitors — and requests about it get refused.Mô tả một chủ đề bằng một câu — tư vấn đầu tư, đối thủ — và mọi yêu cầu về nó sẽ bị từ chối.
Harmful contentNội dung độc hại Threshold sliders per category, applied to both the prompt and the response.Ngưỡng riêng cho từng nhóm, áp dụng cho cả prompt lẫn câu trả lời.
PII redactionChe PII Block or mask emails, card numbers, national ids — plus your own regex patterns.Chặn hoặc che email, số thẻ, số định danh — cùng các regex do bạn tự định nghĩa.
Model-independentĐộc lập với model One guardrail is versioned and attached to many models and Agents — swap the FM, the policy survives.Một guardrail được đánh version và gắn cho nhiều model, nhiều Agent — đổi FM thì chính sách vẫn còn.

On-demand vs Provisioned ThroughputOn-demand và Provisioned Throughput

On-demandOn-demand Provisioned ThroughputProvisioned Throughput
You pay forTrả tiền cho tokens in + tokens out, per call — a token is roughly ¾ of a wordtoken vào + token ra, theo từng lệnh gọi — một token xấp xỉ ¾ từ model units by the hour, reserved for you — idle time still billsmodel unit theo giờ, giữ riêng cho bạn — để không vẫn tính tiền
Use it whenDùng khi default; spiky or unknown traffic, prototypes, anything burstymặc định; traffic thất thường hoặc chưa rõ, prototype, mọi thứ giật cục steady high volume, or a guaranteed throughput requirement — and it is mandatory for a fine-tuned modeltải cao đều đặn, hoặc yêu cầu đảm bảo throughput — và là bắt buộc với model đã fine-tune
Watch outChú ý throttling under load; quotas are per model, per regionbị throttle khi tải cao; quota tính theo từng model, từng region commitment terms cut the rate but lock you in — the classic surprise line itemcam kết dài hạn giảm giá nhưng khoá bạn lại — khoản bất ngờ kinh điển trên hoá đơn

Things that catch you outNhững chỗ dễ vấp

  • Model access is a request, not a right. A fresh account sees the model list but can't invoke anything until access is enabled per model, and the catalogue differs by region. First AccessDeniedException is usually this, not IAM. Quyền dùng model phải xin, không mặc định có. Tài khoản mới thấy danh sách model nhưng không gọi được cho tới khi bật quyền cho từng model, và danh mục khác nhau theo region. Lần AccessDeniedException đầu tiên thường là lỗi này, không phải IAM.
  • "Unified API" unifies the call, not the behaviour. Prompt formats, context limits, tool-calling quirks and pricing all differ per model — switching provider is a config change plus an evaluation pass, not a free lunch. "Unified API" thống nhất cách gọi, không thống nhất hành vi. Định dạng prompt, giới hạn ngữ cảnh, cách gọi tool và giá đều khác nhau theo model — đổi nhà cung cấp là đổi config cộng thêm một vòng đánh giá lại, không phải miễn phí.
  • A Knowledge Base is not free storage. The vector store behind it is a real resource you provision and pay for, and re-indexing after a document changes is your job to schedule. Knowledge Base không phải kho lưu trữ miễn phí. Vector store phía sau là tài nguyên thật, bạn phải tạo và trả tiền, còn việc index lại sau khi tài liệu đổi là do bạn lên lịch.
  • Fine-tuning is the expensive answer given for the wrong reason. Teams reach for it to add facts; it adds style. Cost is training + mandatory Provisioned Throughput afterwards, and every refresh repeats both. Fine-tuning là câu trả lời đắt tiền thường được chọn vì lý do sai. Nhiều team dùng nó để thêm dữ kiện; thực ra nó thêm phong cách. Chi phí là training cộng Provisioned Throughput bắt buộc sau đó, và mỗi lần làm mới lại tốn cả hai.
  • Guardrails and Agent action groups are versioned. Editing a draft changes nothing in production until you publish a version and point the alias at it — the same trap as a Lambda alias. Guardrails và action group của Agent đều có version. Sửa bản nháp không đổi gì trên production cho tới khi bạn publish version và trỏ alias vào — đúng cái bẫy như alias của Lambda.
  • Agents act with an IAM role you gave them. Scope that role to exactly the functions it needs; a prompt is not an authorisation boundary. Agent hành động bằng IAM role bạn cấp cho nó. Hãy giới hạn role đúng những hàm nó cần; prompt không phải là ranh giới phân quyền.

Exam reflexesPhản xạ khi thi

The question says…Đề nói… AnswerTrả lời
"Gen-AI app, no infrastructure to manage, must be able to change model later""Ứng dụng Gen-AI, không phải quản hạ tầng, sau này phải đổi được model" Bedrock — the unified API is the whole pointBedrock — API chung chính là điểm mấu chốt
"Answers must reflect internal documents that change weekly, with sources""Câu trả lời phải bám tài liệu nội bộ thay đổi hàng tuần, kèm nguồn" Knowledge Base (RAG) — never fine-tuningKnowledge Base (RAG) — tuyệt đối không phải fine-tuning
"Model must adopt our tone and output format consistently""Model phải giữ đúng giọng văn và định dạng đầu ra của công ty" Fine-tune the private copy — and budget Provisioned ThroughputFine-tune bản sao riêng — và dự trù Provisioned Throughput
"Legal asks: will our prompts train the vendor's model?""Bên pháp chế hỏi: prompt của mình có train model của hãng không?" No — private copy, none of your data trains the base FMKhông — bản sao riêng, không dữ liệu nào của bạn train base FM
"Must block certain topics and redact PII across several models""Phải chặn một số chủ đề và che PII trên nhiều model" Guardrails — one policy, attached to many models and AgentsGuardrails — một chính sách, gắn cho nhiều model và Agent
"The assistant must take an action — look up an order, then refund it""Trợ lý phải thực hiện hành động — tra đơn hàng rồi hoàn tiền" Agents calling Lambda / an API, under a tightly scoped IAM roleAgents gọi Lambda / một API, dưới IAM role bị giới hạn chặt