Amazon Bedrock
Note
The code examples in this section use the Cohere v1 API. The v2 API is not yet supported for cloud deployments and will be coming soon.
In an effort to make our language-model capabilities more widely available, we’ve partnered with a few major platforms to create hosted versions of our offerings.
Here, you’ll learn how to use Amazon Bedrock to deploy both the Cohere Command and the Cohere Embed models on the AWS cloud computing platform. The following models are available on Bedrock:
- Command R
- Command R+
- Command Light
- Command
- Embed - English
- Embed - Multilingual
Prerequisites
Here are the steps you’ll need to get set up in advance of running Cohere models on Amazon Bedrock.
- Subscribe to Cohere’s models on Amazon Bedrock. For more details, see here.
- You’ll also need to install the AWS Python SDK and some related tooling. Run:
pip install cohere-aws
(orpip install --upgrade cohere-aws
if you need to upgrade). You can also install from source withpython setup.py install
.- For more details, see this GitHub repo and related notebooks.
- Finally, you’ll have to configure your authentication credentials for AWS. This document has more information.
Embeddings
You can use this code to invoke Cohere’s Embed English v3 model (cohere.embed-english-v3
) or Embed Multilingual v3 model (cohere.embed-multilingual-v3
) on Amazon Bedrock:
Text Generation
You can use this code to invoke either Command R (cohere.command-r-v1:0
), Command R+ (cohere.command-r-plus-v1:0
), Command (cohere.command-text-v14
), or Command light (cohere.command-light-text-v14
) on Amazon Bedrock: