Lab 2a: Introduction to Amazon Bedrock#

Amazon Bedrock is a fully managed service that makes foundation models (FMs) from Amazon and third-party model providers easily accessible through an API. This notebook covers the Amazon Bedrock API using SDK for Python (Boto3).

In this lab, we will cover topics such as:

  • Setting up and accessing the Bedrock service using Boto3

  • Exploring available Large Language Models (LLMs) in Bedrock

  • Performing Bedrock API calls with various customization options

  • Understanding and manipulating model parameters for text generation

About This Lab#

Throughout this lab, you will encounter two types of interactive elements:

            ![Activity](../mlu_utils/activity.png)

            ![Challenge](../mlu_utils/challenge.png)

            No coding is needed for an activity. You try to understand a concept,

answer questions, or run a code cell.

            Challenges are where you test your understanding by implementing something new or taking a short quiz.

Please work through this notebook from top to bottom to avoid errors due to missing code or context.

Table of Contents#

1. Installation and API calls#

We first install recent versions of boto3 and botocore (defined in a file called requirements.txt).

!pip install --no-deps -q -r ../requirements.txt

We can access the Bedrock service through boto3 by providing the service name, region name and endpoint URL.

2. Accessing the Bedrock service using the SDK for Python#

import json, boto3

session = boto3.session.Session()

bedrock = session.client(
    service_name="bedrock",
    region_name=session.region_name,
)

Let’s take a look at the available Large Language Models (LLMs) in Bedrock.

bedrock.list_foundation_models()["modelSummaries"]
# uncomment the command below to display only model IDs instead
# [m["modelId"] for m in bedrock.list_foundation_models()["modelSummaries"][0:]]
[{'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/nvidia.nemotron-nano-12b-v2',
  'modelId': 'nvidia.nemotron-nano-12b-v2',
  'modelName': 'NVIDIA Nemotron Nano 12B v2 VL BF16',
  'providerName': 'NVIDIA',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/qwen.qwen3-coder-next',
  'modelId': 'qwen.qwen3-coder-next',
  'modelName': 'Qwen3 Coder Next',
  'providerName': 'Qwen',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-sonnet-4-20250514-v1:0',
  'modelId': 'anthropic.claude-sonnet-4-20250514-v1:0',
  'modelName': 'Claude Sonnet 4',
  'providerName': 'Anthropic',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-haiku-4-5-20251001-v1:0',
  'modelId': 'anthropic.claude-haiku-4-5-20251001-v1:0',
  'modelName': 'Claude Haiku 4.5',
  'providerName': 'Anthropic',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/moonshotai.kimi-k2.5',
  'modelId': 'moonshotai.kimi-k2.5',
  'modelName': 'Kimi K2.5',
  'providerName': 'Moonshot AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/openai.gpt-oss-120b-1:0',
  'modelId': 'openai.gpt-oss-120b-1:0',
  'modelName': 'gpt-oss-120b',
  'providerName': 'OpenAI',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/stability.stable-creative-upscale-v1:0',
  'modelId': 'stability.stable-creative-upscale-v1:0',
  'modelName': 'Stable Image Creative Upscale',
  'providerName': 'Stability AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['IMAGE'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/qwen.qwen3-next-80b-a3b',
  'modelId': 'qwen.qwen3-next-80b-a3b',
  'modelName': 'Qwen3 Next 80B A3B',
  'providerName': 'Qwen',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-fable-5',
  'modelId': 'anthropic.claude-fable-5',
  'modelName': 'Claude Fable 5',
  'providerName': 'Anthropic',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/deepseek.v3.2',
  'modelId': 'deepseek.v3.2',
  'modelName': 'DeepSeek V3.2',
  'providerName': 'DeepSeek',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-2-multimodal-embeddings-v1:0',
  'modelId': 'amazon.nova-2-multimodal-embeddings-v1:0',
  'modelName': 'Amazon Nova Multimodal Embeddings',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE', 'AUDIO', 'VIDEO'],
  'outputModalities': ['EMBEDDING'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/nvidia.nemotron-nano-3-30b',
  'modelId': 'nvidia.nemotron-nano-3-30b',
  'modelName': 'Nemotron Nano 3 30B',
  'providerName': 'NVIDIA',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-sonnet-4-6',
  'modelId': 'anthropic.claude-sonnet-4-6',
  'modelName': 'Claude Sonnet 4.6',
  'providerName': 'Anthropic',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/minimax.minimax-m2',
  'modelId': 'minimax.minimax-m2',
  'modelName': 'MiniMax M2',
  'providerName': 'MiniMax',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/zai.glm-4.7-flash',
  'modelId': 'zai.glm-4.7-flash',
  'modelName': 'GLM 4.7 Flash',
  'providerName': 'Z.AI',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/mistral.voxtral-mini-3b-2507',
  'modelId': 'mistral.voxtral-mini-3b-2507',
  'modelName': 'Voxtral Mini 3B 2507',
  'providerName': 'Mistral AI',
  'inputModalities': ['SPEECH', 'TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-pro-v1:0',
  'modelId': 'amazon.nova-pro-v1:0',
  'modelName': 'Nova Pro',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE', 'VIDEO'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND', 'INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-pro-v1:0:24k',
  'modelId': 'amazon.nova-pro-v1:0:24k',
  'modelName': 'Nova Pro',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE', 'VIDEO'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['PROVISIONED'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-pro-v1:0:300k',
  'modelId': 'amazon.nova-pro-v1:0:300k',
  'modelName': 'Nova Pro',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE', 'VIDEO'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': ['FINE_TUNING',
   'DISTILLATION',
   'PREFERENCE_FINE_TUNING'],
  'inferenceTypesSupported': ['PROVISIONED'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/stability.stable-image-remove-background-v1:0',
  'modelId': 'stability.stable-image-remove-background-v1:0',
  'modelName': 'Stable Image Remove Background',
  'providerName': 'Stability AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['IMAGE'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/stability.stable-image-control-sketch-v1:0',
  'modelId': 'stability.stable-image-control-sketch-v1:0',
  'modelName': 'Stable Image Control Sketch',
  'providerName': 'Stability AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['IMAGE'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-2-lite-v1:0',
  'modelId': 'amazon.nova-2-lite-v1:0',
  'modelName': 'Nova 2 Lite',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE', 'VIDEO'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-2-lite-v1:0:256k',
  'modelId': 'amazon.nova-2-lite-v1:0:256k',
  'modelName': 'Nova 2 Lite',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE', 'VIDEO'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': ['FINE_TUNING'],
  'inferenceTypesSupported': ['PROVISIONED'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/stability.stable-conservative-upscale-v1:0',
  'modelId': 'stability.stable-conservative-upscale-v1:0',
  'modelName': 'Stable Image Conservative Upscale',
  'providerName': 'Stability AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['IMAGE'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/minimax.minimax-m2.5',
  'modelId': 'minimax.minimax-m2.5',
  'modelName': 'MiniMax M2.5',
  'providerName': 'MiniMax',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/google.gemma-3-12b-it',
  'modelId': 'google.gemma-3-12b-it',
  'modelName': 'Gemma 3 12B IT',
  'providerName': 'Google',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/stability.stable-image-search-recolor-v1:0',
  'modelId': 'stability.stable-image-search-recolor-v1:0',
  'modelName': 'Stable Image Search and Recolor',
  'providerName': 'Stability AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['IMAGE'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/moonshot.kimi-k2-thinking',
  'modelId': 'moonshot.kimi-k2-thinking',
  'modelName': 'Kimi K2 Thinking',
  'providerName': 'Moonshot AI',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/mistral.mistral-large-3-675b-instruct',
  'modelId': 'mistral.mistral-large-3-675b-instruct',
  'modelName': 'Mistral Large 3',
  'providerName': 'Mistral AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/twelvelabs.pegasus-1-2-v1:0',
  'modelId': 'twelvelabs.pegasus-1-2-v1:0',
  'modelName': 'Pegasus v1.2',
  'providerName': 'TwelveLabs',
  'inputModalities': ['TEXT', 'VIDEO'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE', 'ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-2-sonic-v1:0',
  'modelId': 'amazon.nova-2-sonic-v1:0',
  'modelName': 'Nova 2 Sonic',
  'providerName': 'Amazon',
  'inputModalities': ['SPEECH'],
  'outputModalities': ['SPEECH', 'TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/mistral.devstral-2-123b',
  'modelId': 'mistral.devstral-2-123b',
  'modelName': 'Devstral 2 123B',
  'providerName': 'Mistral AI',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/minimax.minimax-m2.1',
  'modelId': 'minimax.minimax-m2.1',
  'modelName': 'MiniMax M2.1',
  'providerName': 'MiniMax',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/nvidia.nemotron-super-3-120b',
  'modelId': 'nvidia.nemotron-super-3-120b',
  'modelName': 'NVIDIA Nemotron 3 Super 120B A12B',
  'providerName': 'NVIDIA',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/qwen.qwen3-32b-v1:0',
  'modelId': 'qwen.qwen3-32b-v1:0',
  'modelName': 'Qwen3 32B (dense)',
  'providerName': 'Qwen',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/mistral.ministral-3-14b-instruct',
  'modelId': 'mistral.ministral-3-14b-instruct',
  'modelName': 'Ministral 14B 3.0',
  'providerName': 'Mistral AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-opus-4-6-v1',
  'modelId': 'anthropic.claude-opus-4-6-v1',
  'modelName': 'Claude Opus 4.6',
  'providerName': 'Anthropic',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/writer.palmyra-x5-v1:0',
  'modelId': 'writer.palmyra-x5-v1:0',
  'modelName': 'Palmyra X5',
  'providerName': 'Writer',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/nvidia.nemotron-nano-9b-v2',
  'modelId': 'nvidia.nemotron-nano-9b-v2',
  'modelName': 'NVIDIA Nemotron Nano 9B v2',
  'providerName': 'NVIDIA',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/mistral.ministral-3-8b-instruct',
  'modelId': 'mistral.ministral-3-8b-instruct',
  'modelName': 'Ministral 3 8B',
  'providerName': 'Mistral AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/mistral.voxtral-small-24b-2507',
  'modelId': 'mistral.voxtral-small-24b-2507',
  'modelName': 'Voxtral Small 24B 2507',
  'providerName': 'Mistral AI',
  'inputModalities': ['SPEECH', 'TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/zai.glm-5',
  'modelId': 'zai.glm-5',
  'modelName': 'GLM 5',
  'providerName': 'Z.AI',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/openai.gpt-oss-20b-1:0',
  'modelId': 'openai.gpt-oss-20b-1:0',
  'modelName': 'gpt-oss-20b',
  'providerName': 'OpenAI',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/google.gemma-3-4b-it',
  'modelId': 'google.gemma-3-4b-it',
  'modelName': 'Gemma 3 4B IT',
  'providerName': 'Google',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/stability.stable-fast-upscale-v1:0',
  'modelId': 'stability.stable-fast-upscale-v1:0',
  'modelName': 'Stable Image Fast Upscale',
  'providerName': 'Stability AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['IMAGE'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-opus-4-8',
  'modelId': 'anthropic.claude-opus-4-8',
  'modelName': 'Claude Opus 4.8',
  'providerName': 'Anthropic',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-opus-4-7',
  'modelId': 'anthropic.claude-opus-4-7',
  'modelName': 'Claude Opus 4.7',
  'providerName': 'Anthropic',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/stability.stable-image-erase-object-v1:0',
  'modelId': 'stability.stable-image-erase-object-v1:0',
  'modelName': 'Stable Image Erase Object',
  'providerName': 'Stability AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['IMAGE'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/openai.gpt-oss-safeguard-120b',
  'modelId': 'openai.gpt-oss-safeguard-120b',
  'modelName': 'GPT OSS Safeguard 120B',
  'providerName': 'OpenAI',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/google.gemma-3-27b-it',
  'modelId': 'google.gemma-3-27b-it',
  'modelName': 'Gemma 3 27B PT',
  'providerName': 'Google',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/stability.stable-image-control-structure-v1:0',
  'modelId': 'stability.stable-image-control-structure-v1:0',
  'modelName': 'Stable Image Control Structure',
  'providerName': 'Stability AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['IMAGE'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/twelvelabs.marengo-embed-3-0-v1:0',
  'modelId': 'twelvelabs.marengo-embed-3-0-v1:0',
  'modelName': 'Marengo Embed 3.0',
  'providerName': 'TwelveLabs',
  'inputModalities': ['TEXT', 'IMAGE', 'SPEECH', 'VIDEO'],
  'outputModalities': ['EMBEDDING'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE', 'ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/writer.palmyra-x4-v1:0',
  'modelId': 'writer.palmyra-x4-v1:0',
  'modelName': 'Palmyra X4',
  'providerName': 'Writer',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-sonnet-4-5-20250929-v1:0',
  'modelId': 'anthropic.claude-sonnet-4-5-20250929-v1:0',
  'modelName': 'Claude Sonnet 4.5',
  'providerName': 'Anthropic',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/twelvelabs.marengo-embed-2-7-v1:0',
  'modelId': 'twelvelabs.marengo-embed-2-7-v1:0',
  'modelName': 'Marengo Embed v2.7',
  'providerName': 'TwelveLabs',
  'inputModalities': ['TEXT', 'IMAGE', 'SPEECH', 'VIDEO'],
  'outputModalities': ['EMBEDDING'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/qwen.qwen3-vl-235b-a22b',
  'modelId': 'qwen.qwen3-vl-235b-a22b',
  'modelName': 'Qwen3 VL 235B A22B',
  'providerName': 'Qwen',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/zai.glm-4.7',
  'modelId': 'zai.glm-4.7',
  'modelName': 'GLM 4.7',
  'providerName': 'Z.AI',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/writer.palmyra-vision-7b',
  'modelId': 'writer.palmyra-vision-7b',
  'modelName': 'Writer Palmyra Vision 7B',
  'providerName': 'Writer',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/stability.stable-outpaint-v1:0',
  'modelId': 'stability.stable-outpaint-v1:0',
  'modelName': 'Stable Image Outpaint',
  'providerName': 'Stability AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['IMAGE'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/stability.stable-image-inpaint-v1:0',
  'modelId': 'stability.stable-image-inpaint-v1:0',
  'modelName': 'Stable Image Inpaint',
  'providerName': 'Stability AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['IMAGE'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-opus-4-1-20250805-v1:0',
  'modelId': 'anthropic.claude-opus-4-1-20250805-v1:0',
  'modelName': 'Claude Opus 4.1',
  'providerName': 'Anthropic',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/stability.stable-image-style-guide-v1:0',
  'modelId': 'stability.stable-image-style-guide-v1:0',
  'modelName': 'Stable Image Style Guide',
  'providerName': 'Stability AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['IMAGE'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/mistral.magistral-small-2509',
  'modelId': 'mistral.magistral-small-2509',
  'modelName': 'Magistral Small 2509',
  'providerName': 'Mistral AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/stability.stable-style-transfer-v1:0',
  'modelId': 'stability.stable-style-transfer-v1:0',
  'modelName': 'Stable Image Style Transfer',
  'providerName': 'Stability AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['IMAGE'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/cohere.embed-v4:0',
  'modelId': 'cohere.embed-v4:0',
  'modelName': 'Embed v4',
  'providerName': 'Cohere',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['EMBEDDING'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND', 'INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/mistral.ministral-3-3b-instruct',
  'modelId': 'mistral.ministral-3-3b-instruct',
  'modelName': 'Ministral 3B',
  'providerName': 'Mistral AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-opus-4-5-20251101-v1:0',
  'modelId': 'anthropic.claude-opus-4-5-20251101-v1:0',
  'modelName': 'Claude Opus 4.5',
  'providerName': 'Anthropic',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/stability.stable-image-search-replace-v1:0',
  'modelId': 'stability.stable-image-search-replace-v1:0',
  'modelName': 'Stable Image Search and Replace',
  'providerName': 'Stability AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['IMAGE'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/qwen.qwen3-coder-30b-a3b-v1:0',
  'modelId': 'qwen.qwen3-coder-30b-a3b-v1:0',
  'modelName': 'Qwen3-Coder-30B-A3B-Instruct',
  'providerName': 'Qwen',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/openai.gpt-oss-safeguard-20b',
  'modelId': 'openai.gpt-oss-safeguard-20b',
  'modelName': 'GPT OSS Safeguard 20B',
  'providerName': 'OpenAI',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-image-generator-v2:0',
  'modelId': 'amazon.titan-image-generator-v2:0',
  'modelName': 'Titan Image Generator G1 v2',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['IMAGE'],
  'customizationsSupported': ['FINE_TUNING'],
  'inferenceTypesSupported': ['PROVISIONED', 'ON_DEMAND'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-premier-v1:0:8k',
  'modelId': 'amazon.nova-premier-v1:0:8k',
  'modelName': 'Nova Premier',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE', 'VIDEO'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': [],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-premier-v1:0:20k',
  'modelId': 'amazon.nova-premier-v1:0:20k',
  'modelName': 'Nova Premier',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE', 'VIDEO'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': [],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-premier-v1:0:1000k',
  'modelId': 'amazon.nova-premier-v1:0:1000k',
  'modelName': 'Nova Premier',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE', 'VIDEO'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': [],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-premier-v1:0:mm',
  'modelId': 'amazon.nova-premier-v1:0:mm',
  'modelName': 'Nova Premier',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE', 'VIDEO'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': [],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-premier-v1:0',
  'modelId': 'amazon.nova-premier-v1:0',
  'modelName': 'Nova Premier',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE', 'VIDEO'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-lite-v1:0:24k',
  'modelId': 'amazon.nova-lite-v1:0:24k',
  'modelName': 'Nova Lite',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE', 'VIDEO'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['PROVISIONED'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-lite-v1:0:300k',
  'modelId': 'amazon.nova-lite-v1:0:300k',
  'modelName': 'Nova Lite',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE', 'VIDEO'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': ['FINE_TUNING', 'DISTILLATION'],
  'inferenceTypesSupported': ['PROVISIONED'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-lite-v1:0',
  'modelId': 'amazon.nova-lite-v1:0',
  'modelName': 'Nova Lite',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE', 'VIDEO'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND', 'INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-canvas-v1:0',
  'modelId': 'amazon.nova-canvas-v1:0',
  'modelName': 'Nova Canvas',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['IMAGE'],
  'responseStreamingSupported': False,
  'customizationsSupported': ['FINE_TUNING'],
  'inferenceTypesSupported': ['ON_DEMAND', 'PROVISIONED'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-reel-v1:0',
  'modelId': 'amazon.nova-reel-v1:0',
  'modelName': 'Nova Reel',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['VIDEO'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-reel-v1:1',
  'modelId': 'amazon.nova-reel-v1:1',
  'modelName': 'Nova Reel',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['VIDEO'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-micro-v1:0:24k',
  'modelId': 'amazon.nova-micro-v1:0:24k',
  'modelName': 'Nova Micro',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['PROVISIONED'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-micro-v1:0:128k',
  'modelId': 'amazon.nova-micro-v1:0:128k',
  'modelName': 'Nova Micro',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': ['FINE_TUNING', 'DISTILLATION'],
  'inferenceTypesSupported': ['PROVISIONED'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-micro-v1:0',
  'modelId': 'amazon.nova-micro-v1:0',
  'modelName': 'Nova Micro',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND', 'INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-sonic-v1:0',
  'modelId': 'amazon.nova-sonic-v1:0',
  'modelName': 'Nova Sonic',
  'providerName': 'Amazon',
  'inputModalities': ['SPEECH'],
  'outputModalities': ['SPEECH', 'TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-embed-g1-text-02',
  'modelId': 'amazon.titan-embed-g1-text-02',
  'modelName': 'Titan Text Embeddings v2',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT'],
  'outputModalities': ['EMBEDDING'],
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-embed-text-v1:2:8k',
  'modelId': 'amazon.titan-embed-text-v1:2:8k',
  'modelName': 'Titan Embeddings G1 - Text',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT'],
  'outputModalities': ['EMBEDDING'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['PROVISIONED'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-embed-text-v1',
  'modelId': 'amazon.titan-embed-text-v1',
  'modelName': 'Titan Embeddings G1 - Text',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT'],
  'outputModalities': ['EMBEDDING'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-embed-text-v2:0:8k',
  'modelId': 'amazon.titan-embed-text-v2:0:8k',
  'modelName': 'Titan Text Embeddings V2',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT'],
  'outputModalities': ['EMBEDDING'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': [],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-embed-text-v2:0',
  'modelId': 'amazon.titan-embed-text-v2:0',
  'modelName': 'Titan Text Embeddings V2',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT'],
  'outputModalities': ['EMBEDDING'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-embed-image-v1:0',
  'modelId': 'amazon.titan-embed-image-v1:0',
  'modelName': 'Titan Multimodal Embeddings G1',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['EMBEDDING'],
  'customizationsSupported': ['FINE_TUNING'],
  'inferenceTypesSupported': ['PROVISIONED'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-embed-image-v1',
  'modelId': 'amazon.titan-embed-image-v1',
  'modelName': 'Titan Multimodal Embeddings G1',
  'providerName': 'Amazon',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['EMBEDDING'],
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/ai21.jamba-1-5-large-v1:0',
  'modelId': 'ai21.jamba-1-5-large-v1:0',
  'modelName': 'Jamba 1.5 Large',
  'providerName': 'AI21 Labs',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/ai21.jamba-1-5-mini-v1:0',
  'modelId': 'ai21.jamba-1-5-mini-v1:0',
  'modelName': 'Jamba 1.5 Mini',
  'providerName': 'AI21 Labs',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-sonnet-20240229-v1:0:28k',
  'modelId': 'anthropic.claude-3-sonnet-20240229-v1:0:28k',
  'modelName': 'Claude 3 Sonnet',
  'providerName': 'Anthropic',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['PROVISIONED'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-sonnet-20240229-v1:0:200k',
  'modelId': 'anthropic.claude-3-sonnet-20240229-v1:0:200k',
  'modelName': 'Claude 3 Sonnet',
  'providerName': 'Anthropic',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['PROVISIONED'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-sonnet-20240229-v1:0',
  'modelId': 'anthropic.claude-3-sonnet-20240229-v1:0',
  'modelName': 'Claude 3 Sonnet',
  'providerName': 'Anthropic',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-haiku-20240307-v1:0:48k',
  'modelId': 'anthropic.claude-3-haiku-20240307-v1:0:48k',
  'modelName': 'Claude 3 Haiku',
  'providerName': 'Anthropic',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['PROVISIONED'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-haiku-20240307-v1:0:200k',
  'modelId': 'anthropic.claude-3-haiku-20240307-v1:0:200k',
  'modelName': 'Claude 3 Haiku',
  'providerName': 'Anthropic',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['PROVISIONED'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-haiku-20240307-v1:0',
  'modelId': 'anthropic.claude-3-haiku-20240307-v1:0',
  'modelName': 'Claude 3 Haiku',
  'providerName': 'Anthropic',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-5-haiku-20241022-v1:0',
  'modelId': 'anthropic.claude-3-5-haiku-20241022-v1:0',
  'modelName': 'Claude 3.5 Haiku',
  'providerName': 'Anthropic',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/cohere.command-r-v1:0',
  'modelId': 'cohere.command-r-v1:0',
  'modelName': 'Command R',
  'providerName': 'Cohere',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/cohere.command-r-plus-v1:0',
  'modelId': 'cohere.command-r-plus-v1:0',
  'modelName': 'Command R+',
  'providerName': 'Cohere',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/cohere.embed-english-v3:0:512',
  'modelId': 'cohere.embed-english-v3:0:512',
  'modelName': 'Embed English',
  'providerName': 'Cohere',
  'inputModalities': ['TEXT'],
  'outputModalities': ['EMBEDDING'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['PROVISIONED'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/cohere.embed-english-v3',
  'modelId': 'cohere.embed-english-v3',
  'modelName': 'Embed English',
  'providerName': 'Cohere',
  'inputModalities': ['TEXT'],
  'outputModalities': ['EMBEDDING'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/cohere.embed-multilingual-v3:0:512',
  'modelId': 'cohere.embed-multilingual-v3:0:512',
  'modelName': 'Embed Multilingual',
  'providerName': 'Cohere',
  'inputModalities': ['TEXT'],
  'outputModalities': ['EMBEDDING'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['PROVISIONED'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/cohere.embed-multilingual-v3',
  'modelId': 'cohere.embed-multilingual-v3',
  'modelName': 'Embed Multilingual',
  'providerName': 'Cohere',
  'inputModalities': ['TEXT'],
  'outputModalities': ['EMBEDDING'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/cohere.rerank-v3-5:0',
  'modelId': 'cohere.rerank-v3-5:0',
  'modelName': 'Rerank 3.5',
  'providerName': 'Cohere',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': False,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/deepseek.r1-v1:0',
  'modelId': 'deepseek.r1-v1:0',
  'modelName': 'DeepSeek-R1',
  'providerName': 'DeepSeek',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/meta.llama3-8b-instruct-v1:0',
  'modelId': 'meta.llama3-8b-instruct-v1:0',
  'modelName': 'Llama 3 8B Instruct',
  'providerName': 'Meta',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/meta.llama3-70b-instruct-v1:0',
  'modelId': 'meta.llama3-70b-instruct-v1:0',
  'modelName': 'Llama 3 70B Instruct',
  'providerName': 'Meta',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/meta.llama3-1-8b-instruct-v1:0',
  'modelId': 'meta.llama3-1-8b-instruct-v1:0',
  'modelName': 'Llama 3.1 8B Instruct',
  'providerName': 'Meta',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/meta.llama3-1-70b-instruct-v1:0',
  'modelId': 'meta.llama3-1-70b-instruct-v1:0',
  'modelName': 'Llama 3.1 70B Instruct',
  'providerName': 'Meta',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/meta.llama3-2-11b-instruct-v1:0',
  'modelId': 'meta.llama3-2-11b-instruct-v1:0',
  'modelName': 'Llama 3.2 11B Instruct',
  'providerName': 'Meta',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/meta.llama3-2-90b-instruct-v1:0',
  'modelId': 'meta.llama3-2-90b-instruct-v1:0',
  'modelName': 'Llama 3.2 90B Instruct',
  'providerName': 'Meta',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/meta.llama3-2-1b-instruct-v1:0',
  'modelId': 'meta.llama3-2-1b-instruct-v1:0',
  'modelName': 'Llama 3.2 1B Instruct',
  'providerName': 'Meta',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/meta.llama3-2-3b-instruct-v1:0',
  'modelId': 'meta.llama3-2-3b-instruct-v1:0',
  'modelName': 'Llama 3.2 3B Instruct',
  'providerName': 'Meta',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'LEGACY'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/meta.llama3-3-70b-instruct-v1:0',
  'modelId': 'meta.llama3-3-70b-instruct-v1:0',
  'modelName': 'Llama 3.3 70B Instruct',
  'providerName': 'Meta',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/meta.llama4-scout-17b-instruct-v1:0',
  'modelId': 'meta.llama4-scout-17b-instruct-v1:0',
  'modelName': 'Llama 4 Scout 17B Instruct',
  'providerName': 'Meta',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/meta.llama4-maverick-17b-instruct-v1:0',
  'modelId': 'meta.llama4-maverick-17b-instruct-v1:0',
  'modelName': 'Llama 4 Maverick 17B Instruct',
  'providerName': 'Meta',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/mistral.mistral-7b-instruct-v0:2',
  'modelId': 'mistral.mistral-7b-instruct-v0:2',
  'modelName': 'Mistral 7B Instruct',
  'providerName': 'Mistral AI',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/mistral.mixtral-8x7b-instruct-v0:1',
  'modelId': 'mistral.mixtral-8x7b-instruct-v0:1',
  'modelName': 'Mixtral 8x7B Instruct',
  'providerName': 'Mistral AI',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/mistral.mistral-large-2402-v1:0',
  'modelId': 'mistral.mistral-large-2402-v1:0',
  'modelName': 'Mistral Large (24.02)',
  'providerName': 'Mistral AI',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/mistral.mistral-small-2402-v1:0',
  'modelId': 'mistral.mistral-small-2402-v1:0',
  'modelName': 'Mistral Small (24.02)',
  'providerName': 'Mistral AI',
  'inputModalities': ['TEXT'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['ON_DEMAND'],
  'modelLifecycle': {'status': 'ACTIVE'}},
 {'modelArn': 'arn:aws:bedrock:us-east-1::foundation-model/mistral.pixtral-large-2502-v1:0',
  'modelId': 'mistral.pixtral-large-2502-v1:0',
  'modelName': 'Pixtral Large (25.02)',
  'providerName': 'Mistral AI',
  'inputModalities': ['TEXT', 'IMAGE'],
  'outputModalities': ['TEXT'],
  'responseStreamingSupported': True,
  'customizationsSupported': [],
  'inferenceTypesSupported': ['INFERENCE_PROFILE'],
  'modelLifecycle': {'status': 'ACTIVE'}}]

We use the service name ‘bedrock-runtime’ for inference.

# For inference
bedrock_inference = session.client(
    service_name="bedrock-runtime",
)

Model IDs can be used to select a specific model in the API calls.

This demo is focusing on the Nova Micro model from Amazon. We will use the model with id: amazon.nova-micro-v1:0

3. Bedrock API Call#

Bedrock API has the following parameters:

  • body: The message body that includes the input text and model parameters. Model parameters help customize the models and the generated outputs.

  • modelId: Identifier of the model. We can pick a model from the list of models printed in the previous code block.

  • accept: The desired type of the inference body in the response.

  • contentType: The type of the input data in the request body.

Model parameters:

These parameters are provided within the body of the API call. Basically, we can control the randomness and the length of the generated sequences.

Randomness:

  • temperature: Controls the randomness of the generated sequences. This parameter is between zero and one. When set closer to zero, the model tends to select higher probability words. When set further away from zero, the model may select lower-probability words. Temperature of zero gives the same output for the same input at every run.

  • topP: Top P defines a cut-off based on the sum of probabilities of the potential choices. With this cut-off, the model only selects from the most probable words whose probabilities sum up to the topP value.

Length:

  • maxTokens: Controls the maximum number of tokens in the generated response.

  • stopSequences: A sequence of characters to stop the model from generating its output.

Let’s define a function that will build our prompt as well as pass some model parameters to Bedrock. Once the call parameters are ready, we can use the converse() function to send the data and collect the response from the model. Then, we return the response at the end.

Note: Different models may have different model parameters. Please refer to the documentation for more details.

def send_prompt(prompt_data, temperature=0.0, top_p=1.0, max_token_count=1000):

    # select model
    model_id = "amazon.nova-micro-v1:0"
    
    # Build the message to call Converse API
    message_content = []
    message_content.append({"text": prompt_data})

    messages = [
            {
                "role": "user",
                "content": message_content,
            }
      ]
    inf_params = {"maxTokens": max_token_count, "topP": top_p, "temperature": temperature}
    response = bedrock_inference.converse(
            modelId=model_id, messages=messages, inferenceConfig=inf_params
    )
    # Process and return the response

    return response["output"]["message"]["content"][0]["text"]

Let’s construct a simple API call and run it.

As a sample text input, we use the following: “Can you name a few real-life applications of natural language processing?”.

For inference parameters, we set the temperature to 0.

from IPython.display import Markdown, display

prompt_data = (
    """Can you name a few real-life applications of natural language processing?"""
)

display(Markdown(prompt_data))
display(Markdown(send_prompt(prompt_data, temperature=0.0)))

Can you name a few real-life applications of natural language processing?

Certainly! Natural Language Processing (NLP) has a wide range of real-life applications across various industries. Here are a few notable examples:

  1. Virtual Assistants and Chatbots:

    • Siri, Alexa, and Google Assistant: These voice-activated virtual assistants use NLP to understand and respond to user queries in natural language.

    • Customer Support Chatbots: Many companies use chatbots to handle customer inquiries, providing instant responses to common questions and issues.

  2. Translation Services:

    • Google Translate: This service uses NLP to translate text and speech from one language to another with increasing accuracy.

    • Microsoft Translator: Similar to Google Translate, it offers real-time translation for various languages.

  3. Sentiment Analysis:

    • Social Media Monitoring: Companies use NLP to analyze social media posts and reviews to gauge public sentiment about their products or brand.

    • Market Research: Businesses analyze customer feedback and reviews to understand market trends and improve their offerings.

  4. Document and Text Analysis:

    • Legal Document Review: NLP tools help lawyers and legal professionals review and summarize lengthy legal documents.

    • Email Filtering: Spam filters use NLP to identify and filter out unwanted emails by analyzing the content.

  5. Speech Recognition:

    • Transcription Services: Tools like Otter.ai and Rev.com use NLP to convert spoken language into written text.

    • Dictation Software: Applications like Dragon NaturallySpeaking allow users to dictate text to their computers.

  6. Content Generation:

    • Automated News Writing: Companies like Automated Insights and Narrative Science use NLP to generate news articles on various topics.

    • Creative Writing Assistance: Tools like Grammarly and Writesonic provide suggestions and help in generating creative content.

  7. Healthcare:

    • Medical Record Analysis: NLP helps in extracting and analyzing information from unstructured clinical notes and reports.

    • Patient Interaction: Virtual health assistants that provide medical advice and information based on user queries.

  8. E-commerce:

    • Product Recommendation Systems: NLP helps in understanding customer reviews and preferences to provide personalized product recommendations.

    • Search and Filtering: Enhanced search capabilities in e-commerce platforms using NLP to understand and match user queries with products.

  9. Education:

    • Tutoring Systems: Platforms like Duolingo use NLP to provide language learning assistance and feedback.

    • Automated Grading: Tools that use NLP to grade essays and assignments by analyzing the content and structure.

These applications demonstrate the versatility and transformative impact of NLP across different sectors.

This provides a list of real-life NLP applications.

If we want to generate slightly different looking outputs, we can increase the temperature value. Let’s also set the maxTokens parameter this time.

Changing the temperature parameter will create a slightly different looking list.

prompt_data = (
    """Can you name a few real-life applications of natural language processing?"""
)

display(Markdown(prompt_data))
display(Markdown(send_prompt(prompt_data, temperature=0.5, max_token_count=450)))

Can you name a few real-life applications of natural language processing?

Certainly! Natural Language Processing (NLP) has a wide range of real-life applications across various industries. Here are a few notable examples:

  1. Virtual Assistants and Chatbots:

    • Siri, Alexa, and Google Assistant: These digital assistants use NLP to understand and respond to voice commands, providing information, controlling smart home devices, and performing various tasks.

    • Customer Support Chatbots: Many companies deploy chatbots on their websites to handle customer inquiries, providing instant responses to frequently asked questions and improving customer service efficiency.

  2. Translation Services:

    • Google Translate: This service uses NLP to translate text and spoken language between different languages, helping bridge communication gaps across linguistic boundaries.

  3. Sentiment Analysis:

    • Social Media Monitoring: Brands and researchers use NLP to analyze social media posts to gauge public sentiment towards products, services, or events.

    • Customer Feedback Analysis: Companies analyze customer reviews and feedback from various platforms to understand customer satisfaction and identify areas for improvement.

  4. Healthcare:

    • Medical Record Analysis: NLP is used to extract relevant information from unstructured clinical notes, aiding in diagnosis, treatment planning, and research.

    • Virtual Health Assistants: These systems help patients by answering medical questions, providing medication reminders, and scheduling appointments.

  5. Content Recommendation Systems:

    • Netflix, Amazon, and Spotify: These platforms use NLP to analyze user behavior and preferences to recommend movies, books, and music tailored to individual tastes.

  6. Automated Writing for Summarization and Generation:

    • News Summarization: Services like Automated Insights use NLP to generate summaries of lengthy news articles.

    • Content Creation: Tools such as Jasper and Writesonic use NLP to create blog posts, marketing copy, and other written content.

  7. Legal Document Analysis:

    • Contract Review: NLP tools can analyze and summarize legal documents, helping lawyers to identify key clauses and potential issues.

    • Case Law Research: Legal NLP systems help in finding relevant case precedents by parsing and understanding legal texts.

  8. Fraud Detection:

    • Banking and Financial Services: NLP is used

In addition to the temperature and maxTokens parameters, we can also add in the topP parameter to set a cut-off for the sum of the probabilities of the potential words.

prompt_data = (
    """Can you name a few real-life applications of natural language processing?"""
)

display(Markdown(prompt_data))
display(
    Markdown(send_prompt(prompt_data, max_token_count=450, temperature=0.5, top_p=0.7))
)

Can you name a few real-life applications of natural language processing?

Certainly! Natural Language Processing (NLP) has a wide range of real-life applications across various industries. Here are a few notable examples:

  1. Virtual Assistants and Chatbots:

    • Siri, Alexa, and Google Assistant: These digital assistants use NLP to understand and respond to voice commands, providing information, controlling smart home devices, and performing tasks.

    • Customer Service Chatbots: Many companies deploy chatbots to handle customer inquiries, providing 24/7 support and reducing the workload on human agents.

  2. Translation Services:

    • Google Translate: This service uses NLP to translate text and speech between different languages, making communication across linguistic barriers more accessible.

  3. Sentiment Analysis:

    • Social Media Monitoring: Brands use NLP to analyze customer feedback and social media posts to gauge public sentiment and improve their products and services.

    • Market Research: Companies analyze reviews and surveys to understand customer satisfaction and identify areas for improvement.

  4. Document Analysis and Summarization:

    • Legal Document Review: NLP tools can read and summarize lengthy legal documents, helping lawyers to quickly identify relevant information.

    • News Summarization: Automated summarization tools generate concise summaries of news articles, making it easier for readers to get the gist of the information.

  5. Speech Recognition:

    • Transcription Services: Tools like Otter.ai and Rev.com use NLP to convert spoken language into written text, which is useful for meeting notes, interviews, and lectures.

    • Voice-to-Text Applications: Applications like Microsoft’s Dictate or Apple’s built-in dictation feature convert spoken words into text for emails, documents, and more.

  6. Healthcare:

    • Medical Record Analysis: NLP can help in extracting relevant information from unstructured clinical notes to support diagnosis and treatment.

    • Patient Interaction: Virtual health assistants provide information and support to patients, helping them navigate healthcare services.

  7. E-commerce:

    • Product Recommendations: NLP helps in understanding customer reviews and preferences to provide personalized product recommendations.

    • Search Optimization: E-commerce platforms use NLP to improve search

4. Quiz Questions#

Well done on completing the lab! Now, it’s time for a brief knowledge assessment.

    ![Challenge](../mlu_utils/challenge.png)

Try it Yourself!#

    Answer the following questions to test your understanding of using LLMs for inference.
import sys
sys.path.append('..')
from mlu_utils.quiz_questions import *

lab2a_question1.display()

Thank you!#