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

Perplexity

Configure Perplexity 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.

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 under endpoints.custom in your librechat.yaml:

    - 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"
      summarize: false
      summaryModel: "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.