Skip to main content
LibreChat is joining ClickHouse to power the open-source Agentic Data Stack 🎉 Learn more
LibreChat

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-key

Configuration

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: stop to stopSequences, top_p to p, frequency_penalty to frequencyPenalty, and presence_penalty to presencePenalty (each with different min/max ranges). model and stream are shared and sent by default; max_tokens maps to maxTokens but is not sent by default. The example above uses dropParams to remove most of these and fall back to Cohere's defaults.
  • For the full list of Cohere-specific parameters, see the Cohere API documentation.