Cohere
Configure Cohere as a custom endpoint in LibreChat.
Archived documentation
You are reading the frozen documentation for v0.8.7, which is no longer maintained. Go to the latest docs.
Cohere provides the Command family of models, used in LibreChat as a custom endpoint. Its API does not follow the OpenAI spec, so it relies on a compatibility layer that maps a subset of parameters.
Get an API key
Create a key from the Cohere dashboard. Add it to your .env file:
COHERE_API_KEY=your-api-keyConfiguration
Add the endpoint under endpoints.custom in your librechat.yaml:
- name: "cohere"
apiKey: "${COHERE_API_KEY}"
baseURL: "https://api.cohere.ai/v1"
models:
default: ["command-r","command-r-plus","command-light","command-light-nightly","command","command-nightly"]
fetch: false
modelDisplayLabel: "cohere"
titleModel: "command"
dropParams: ["stop", "user", "frequency_penalty", "presence_penalty", "temperature", "top_p"]Notes
- Cohere does not follow the OpenAI spec. A compatibility layer maps a subset of OpenAI parameters to Cohere's equivalents:
stoptostopSequences,top_ptop,frequency_penaltytofrequencyPenalty, andpresence_penaltytopresencePenalty(each with different min/max ranges).modelandstreamare shared and sent by default;max_tokensmaps tomaxTokensbut is not sent by default. The example above usesdropParamsto remove most of these and fall back to Cohere's defaults. - For the full list of Cohere-specific parameters, see the Cohere API documentation.