Skip to main content

LibreChat is joining ClickHouse. Learn more

LibreChat

Perplexity

Configure Perplexity as a custom endpoint in LibreChat.

Perplexity provides the Sonar family of search-grounded models, used in LibreChat as a custom endpoint.

Get an API key

Create a key from the Perplexity API settings. Add it to your .env file:

PERPLEXITY_API_KEY=your-api-key

Configuration

Add the endpoint to the custom list under endpoints in your librechat.yaml. If your file already has an endpoints.custom list, paste only the - name: entry into it, keeping the same indentation:

endpoints:
  custom:
    - name: "Perplexity"
      apiKey: "${PERPLEXITY_API_KEY}"
      baseURL: "https://api.perplexity.ai/"
      models:
        default: [
          "sonar-deep-research",
          "sonar-reasoning-pro",
          "sonar-reasoning",
          "sonar-pro",
          "sonar",
          "r1-1776"
          ]
        fetch: false
      titleConvo: true
      titleModel: "llama-3-sonar-small-32k-chat"
      dropParams: ["stop", "frequency_penalty"]
      modelDisplayLabel: "Perplexity"

Notes

  • Fetching the model list is not supported, so keep fetch: false and maintain the default list manually.
  • The API is strict for some models. Fields like stop and frequency_penalty can cause an error when set to 0, so drop them with dropParams.

How is this guide?