AWS Bedrock embedder
Embeds through AWS Bedrock using Cohere Embed English v3. Selected via EMBEDDING_PROVIDER=bedrock.
Enable it
bash
EMBEDDING_PROVIDER=bedrock
BEDROCK_EMBEDDING_MODEL=cohere.embed-english-v3
BEDROCK_REGION=ap-south-1
EMBEDDING_DIMS=1024pip install boto3 (imported lazily only when this provider is selected).
Configuration
| Variable | Default | Description |
|---|---|---|
EMBEDDING_PROVIDER | openai | Set to bedrock. |
BEDROCK_EMBEDDING_MODEL | cohere.embed-english-v3 | Bedrock embedding model id. |
BEDROCK_REGION | ap-south-1 | AWS region for the bedrock-runtime client. |
EMBEDDING_DIMS | 1024 | Vector dimension; must match the embedding model. |
Notes
- Credentials come from the ambient AWS role (the ECS task role in staging and prod, or the local AWS profile in dev), so there is no API key to fund or rotate.
- Cohere v3 uses the query and document distinction:
search_queryon search,search_documentotherwise. - Texts are truncated client side to 2000 characters because Bedrock rejects inputs over 2048 characters before token truncation; batches are capped at 96 texts per request.
- Bedrock returns no token count, so usage is estimated at roughly 4 characters per token; failures raise so callers surface a clean 503.