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 đó.
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.
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.
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.
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
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
AccessDeniedExceptionis 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ầnAccessDeniedExceptionđầ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 |