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

Hugging Face

LibreChatでHuggingfaceをカスタムendpointとして設定する。

Huggingfaceは、OpenAI互換の推論APIを通じてホストされたモデルを公開しており、これをカスタムendpointとしてLibreChatに追加することができます。

APIキーを取得する

huggingface.co/settings/tokens でトークンを作成します。それを .env ファイルに追加してください:

HUGGINGFACE_TOKEN=your-api-key

設定

librechat.yamlendpoints.custom の下にエンドポイントを追加します:

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

上記のモデルリストは、2024年5月9日に最終更新されました。

注記

  • リストされているモデルは無料ですがレート制限があり、無料ティアでは回答が非常に短くなる場合があります。モデルによって性能に差があります。
  • モデルリストの取得はサポートされていないため、default 配列を自身で設定してください。
  • dropParams: ["top_p"] が必要です。これがないと、Huggingfaceが top_p パラメータを拒否するため、リクエストは失敗します。dropParams を参照してください。

このガイドはいかがでしたか?