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

Perplexity

Cấu hình Perplexity làm endpoint tùy chỉnh trong LibreChat.

Perplexity cung cấp dòng mô hình Sonar dựa trên tìm kiếm, được sử dụng trong LibreChat như một endpoint tùy chỉnh.

Nhận API key

Tạo một khóa từ Perplexity API settings. Thêm nó vào tệp .env của bạn:

PERPLEXITY_API_KEY=your-api-key

Cấu hình

Thêm endpoint vào dưới endpoints.custom trong tệp librechat.yaml của bạn:

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

Ghi chú

  • Việc lấy danh sách model không được hỗ trợ, vì vậy hãy giữ fetch: false và duy trì danh sách default theo cách thủ công.
  • API này rất nghiêm ngặt đối với một số model. Các trường như stopfrequency_penalty có thể gây ra lỗi khi được đặt thành 0, vì vậy hãy loại bỏ chúng bằng dropParams.

Hướng dẫn này thế nào?