AWS Bedrock provides managed access to foundation models via a unified API. Master InvokeModel, the Converse API, streaming, guardrails, and cross-region inference profiles for building production AI applications on AWS.
0 / 5 completed
1 / 5
A developer calls bedrock-runtime.invoke_model() with a request body. What format does the request body use for most Bedrock foundation models?
With the invoke_model API, the request body is model-specific JSON. Each model family (Anthropic Claude, Amazon Titan, Meta Llama, Mistral, etc.) has its own JSON schema. Developers must format the body according to the target model's documentation, then pass it as bytes in the body parameter.
2 / 5
AWS Bedrock's Converse API was introduced to solve which problem?
The Converse API (converse / converse_stream) provides a unified interface for conversational interactions across all Bedrock-supported models. Instead of writing model-specific JSON, developers use a standard messages array format and Bedrock handles the translation internally — simplifying multi-model applications.
3 / 5
Your Bedrock application needs to stream tokens as they are generated. Which API method enables this?
invoke_model_with_response_stream() returns an EventStream that yields chunks of the response as the model generates tokens. Each chunk contains a partial completion payload. For the Converse API, the equivalent is converse_stream(). Both enable low-latency streaming UX in applications.
4 / 5
A Bedrock guardrail is configured with a content filter policy. At which stage does the guardrail evaluate content?
Bedrock guardrails can be applied at both stages: input (evaluating the user prompt before the model sees it) and output (evaluating the model response before it's returned). Policies include content filters, topic denial, word filters, PII redaction, and grounding checks — each configurable independently for input and output.
5 / 5
A developer specifies modelId: "us.anthropic.claude-3-5-sonnet-20241022-v2:0" in a Bedrock call. The us. prefix indicates what?
The us. prefix denotes a cross-region inference profile. Instead of locking requests to one region, Bedrock intelligently routes to available capacity across US regions (us-east-1, us-west-2, etc.). This improves availability and throughput, especially during high-demand periods, without requiring the developer to manage multi-region logic.