Lesson 1 of 3 Selecting Foundation Models

Accessing Foundation Models on Amazon Bedrock

This lesson explains the Amazon Bedrock model catalogue, which offers foundation models from Amazon and other providers through one API, and how models are accessed and configured, the starting point for selecting one.

Learning outcomes

After completing this lesson, you will be able to:

  • Identify the model families in the Bedrock catalogue.
  • Choose between InvokeModel and the Converse API.
  • Set inference parameters such as temperature and maximum tokens.

The model catalogue

Bedrock offers models from Amazon (the Amazon Nova family for text, multimodal understanding, image and video generation, and Amazon Titan embedding models) and from providers such as Anthropic, Meta, Mistral AI, Cohere, AI21 Labs, DeepSeek, OpenAI open-weight models, Qwen and Stability AI. Models differ in modality (text in and out, image input, image generation, embeddings), context window, languages, reasoning and tool-use ability, speed and price. Bedrock Marketplace adds many more models deployed on managed endpoints.

Access and invocation

Applications call models with InvokeModel (model-specific request body) or the Converse API, which uses one message format for all chat models and supports tool use, system prompts and streaming (ConverseStream). Models are addressed by model ID or by an inference profile: cross-Region inference profiles route requests across Regions in a geography (or globally) for higher throughput, and application inference profiles track usage and cost per application. Serverless models are available on first use for most providers; some require a short use-case form or acceptance of the provider's terms.

True or false

Calling Bedrock

Exam skills 2.1.1 · 3.1.4

Check how applications call foundation models on Amazon Bedrock.

Log in to try this activity Interactive activities are free with an account.

Inference parameters

Inference parameters shape the outputs a foundation model produces. Temperature controls randomness: low values give factual, consistent output suited to extraction and question answering, and high values give creative variety suited to brainstorming. Top P limits sampling to the most likely tokens whose probabilities sum to P, and Top K limits it to the K most likely tokens; both remove unlikely words.

Maximum tokens caps the length of the response, and therefore its cost and latency, and stop sequences end generation when a given marker appears. The following table summarises them.

ParameterLower valueHigher value
TemperatureDeterministic, focusedCreative, varied
Top POnly the most likely tokensWider token choice
Top KFewer candidate tokensMore candidate tokens
Max tokensShorter, cheaper responses (may truncate)Longer responses

The following diagram shows how Top K and Top P select the candidate tokens.

How Top K and Top P narrow the next-token choice for “My … isn't connecting”. Top K = 3 keeps only the three most likely tokens. Top P = 0.8 keeps the most likely tokens until their probabilities add up to 80%, here four tokens, so the number kept adapts to how confident the model is. Temperature then sharpens (low) or flattens (high) the remaining probabilities.
The token probabilities are illustrative.
Match the pairs

Inference parameters

Exam skills 2.1.1 · 2.2.8

Match each Bedrock inference parameter with its effect.

Log in to try this activity Interactive activities are free with an account.
Worked example

One API across models

A team wants to compare two models from different providers without rewriting request formats.

import boto3
brt = boto3.client("bedrock-runtime")
for model in ["us.amazon.nova-lite-v1:0", "openai.gpt-oss-20b-1:0"]:   # Amazon and OpenAI open-weight
    resp = brt.converse(
        modelId=model,
        system=[{"text": "Answer in one sentence."}],
        messages=[{"role": "user", "content": [{"text": "What is model drift?"}]}],
        inferenceConfig={"temperature": 0.2, "maxTokens": 100},
    )
    print(model, resp["usage"], resp["output"]["message"]["content"][0]["text"])

The Converse API keeps the request identical while the model ID changes, and the response reports token usage for cost comparison. Using InvokeModel would have required a different body for each provider.

Check yourself

How can Bedrock costs be tracked per application?

Show answer

With application inference profiles.

Exam Tips

Remember for the exam

  • One request format for all chat models with tool use: Converse API.
  • Higher throughput across Regions: cross-Region inference profiles.
  • Cost tracking per application: application inference profiles.
  • Low temperature for factual, consistent output.
  • Max tokens caps length and cost but can truncate answers.