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

Perplexity

在 LibreChat 中将 Perplexity 配置为自定义 endpoint。

Perplexity 提供了 Sonar 系列的搜索增强模型,在 LibreChat 中作为自定义 endpoint 使用。

获取 API key

Perplexity API settings 创建一个密钥。将其添加到你的 .env 文件中:

PERPLEXITY_API_KEY=your-api-key

配置

在你的 librechat.yaml 中,将 endpoint 添加到 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"
      summarize: false
      summaryModel: "llama-3-sonar-small-32k-chat"
      dropParams: ["stop", "frequency_penalty"]
      modelDisplayLabel: "Perplexity"

注意事项

  • 不支持获取模型列表,因此请保持 fetch: false 并手动维护 default 列表。
  • 对于某些模型,API 的要求非常严格。当 stopfrequency_penalty 等字段设置为 0 时可能会导致错误,因此请使用 dropParams 将其移除。

这篇指南怎么样?