Skip to main content
You are currently on a page documenting the use of Cohere models as text completion models. Many popular Cohere models are chat completion models.You may be looking for this page instead.
Cohere is a Canadian startup that provides natural language processing models that help companies improve human-machine interactions.
Head to the API reference for detailed documentation of all attributes and methods.

Setup

The integration lives in the langchain-community package. We also need to install the cohere package itself. We can install these with:
The langchain-community package is no longer maintained. Examples that import from langchain_community may be outdated or broken. Use with caution.

Credentials

We’ll need to get a Cohere API key and set the COHERE_API_KEY environment variable:

Installation

It’s also helpful (but not needed) to set up LangSmith for best-in-class observability

Invocation

Cohere supports all LLM functionality:

API reference

For detailed documentation of all Cohere llm features and configurations head to the API reference