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

Huggingface

Konfigurasikan Huggingface sebagai endpoint kustom di LibreChat.

Huggingface mengekspos model yang di-host melalui API inferensi yang kompatibel dengan OpenAI, yang dapat Anda tambahkan ke LibreChat sebagai custom endpoint.

Dapatkan API key

Buat token di huggingface.co/settings/tokens. Tambahkan ke file .env Anda:

HUGGINGFACE_TOKEN=your-api-key

Konfigurasi

Tambahkan endpoint di bawah endpoints.custom dalam librechat.yaml Anda:

    - name: 'HuggingFace'
      apiKey: '${HUGGINGFACE_TOKEN}'
      baseURL: 'https://api-inference.huggingface.co/v1'
      models:
        default: [
          "codellama/CodeLlama-34b-Instruct-hf",
          "google/gemma-1.1-2b-it",
          "google/gemma-1.1-7b-it",
          "HuggingFaceH4/starchat2-15b-v0.1",
          "HuggingFaceH4/zephyr-7b-beta",
          "meta-llama/Meta-Llama-3-8B-Instruct",
          "microsoft/Phi-3-mini-4k-instruct",
          "mistralai/Mistral-7B-Instruct-v0.1",
          "mistralai/Mistral-7B-Instruct-v0.2",
          "mistralai/Mixtral-8x7B-Instruct-v0.1",
          "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO",
        ]
        fetch: true
      titleConvo: true
      titleModel: "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO"
      dropParams: ["top_p"]
      modelDisplayLabel: "HuggingFace"

Daftar model di atas terakhir diperbarui pada 09 Mei 2024.

Catatan

  • Model yang tercantum gratis tetapi memiliki batasan kecepatan (rate limited), dan jawaban bisa sangat singkat pada paket gratis. Beberapa model bekerja lebih baik daripada yang lain.
  • Pengambilan daftar model tidak didukung, jadi atur array default secara mandiri.
  • dropParams: ["top_p"] diperlukan. Tanpanya, permintaan akan gagal karena Huggingface menolak parameter top_p. Lihat dropParams.

Bagaimana panduan ini?