
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
llama-index-embeddings-bedrock
Advanced tools
This integration provides support for AWS Bedrock embedding models through LlamaIndex.
pip install llama-index-embeddings-bedrock
from llama_index.embeddings.bedrock import BedrockEmbedding
# Initialize the embedding model
embed_model = BedrockEmbedding(
model_name="cohere.embed-english-v3",
region_name="us-east-1",
)
# Get a single embedding
embedding = embed_model.get_text_embedding("Hello world")
# Get batch embeddings
embeddings = embed_model.get_text_embedding_batch(["Hello", "World"])
amazon.titan-embed-text-v1amazon.titan-embed-text-v2:0amazon.titan-embed-g1-text-02cohere.embed-english-v3cohere.embed-multilingual-v3cohere.embed-v4:0 (multimodal, supports text and images)To list all supported models:
from llama_index.embeddings.bedrock import BedrockEmbedding
supported_models = BedrockEmbedding.list_supported_models()
print(supported_models)
You can configure AWS credentials in several ways:
# Option 1: Pass credentials directly
embed_model = BedrockEmbedding(
model_name="cohere.embed-english-v3",
aws_access_key_id="YOUR_ACCESS_KEY",
aws_secret_access_key="YOUR_SECRET_KEY",
region_name="us-east-1",
)
# Option 2: Use AWS profile
embed_model = BedrockEmbedding(
model_name="cohere.embed-english-v3",
profile_name="your-aws-profile",
region_name="us-east-1",
)
# Option 3: Use environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION)
embed_model = BedrockEmbedding(
model_name="cohere.embed-english-v3",
)
This integration supports both Cohere v3 and v4 embedding models, including the new multimodal cohere.embed-v4:0 model. The integration automatically detects and handles different response formats (v3 and v4), maintaining full backward compatibility.
# Using Cohere v4 model
embed_model = BedrockEmbedding(
model_name="cohere.embed-v4:0",
region_name="us-east-1",
)
# Text embeddings work seamlessly
embeddings = embed_model.get_text_embedding_batch(
["Hello world", "Another document"]
)
Note: Cohere v4 introduces a new response format that wraps embeddings in a float key when multiple embedding types are requested. This integration handles both the v3 format ({"embeddings": [[...]]}) and v4 formats ({"embeddings": {"float": [[...]]}} or {"float": [[...]]}) automatically.
For more examples, see the Bedrock Embeddings notebook.
FAQs
llama-index embeddings bedrock integration
We found that llama-index-embeddings-bedrock demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.