Skip to main content

Amazon Bedrock Model Provider

To use an embedding model deployed to AWS Bedrock service, specify the model endpoint name prefixed with bedrock: in the from field and include the required parameters in the params section.

Parameters​

AWS Parameters​

ParameterDescription
aws_regionAWS region. Default: us-east-1.
aws_profileOptional. AWS profile to load credentials.
aws_access_key_idOptional. AWS access key ID for authentication. If not provided, credentials will be loaded from environment variables or IAM roles
aws_secret_access_keyOptional. AWS secret access key for authentication. If not provided, credentials will be loaded from environment variables or IAM roles
aws_session_tokenOptional. AWS session token for authentication

AWS Titan Models​

These parameters are used for Amazon Titan Text embedding model

ParameterDescription
normalizeWhether or not to normalize the output embedding. Defaults to true.
dimensionsThe number of dimensions the output embedding should have. The following values are accepted: 1024 (default), 512, 256.

Cohere Models​

ParameterDescription
truncateSpecifies how the API handles inputs longer than the maximum token length. One of: START, END or NONE (default).
input_typeUse the Cohere embeddings model optimized for different types of inputs. One of: search_document (default), search_query, classification or clustering.

Example spicepod.yaml configuration, Cohere model​

embeddings:
- from: bedrock:cohere.embed-english-v3
name: cohere-embeddings
params:
aws_region: us-east-1
input_type: classification
truncate: END
aws_access_key_id: ${ secrets:AWS_ACCESS_KEY_ID }
aws_secret_access_key: ${ secrets:AWS_SECRET_ACCESS_KEY }

Example spicepod.yaml configuration, Titan model​

  - from: bedrock:amazon.titan-embed-text-v2:0
name: titan-embeddings
params:
dimensions: "256"

Additional Information​

Refer to the Amazon Bedrock documentation for more details on available models and configurations.