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

共有エンドポイント設定

このページでは、すべての endpoint に共通する設定について説明します。ここで強調されている設定は、特に注記がない限り、"Endpoints" フィールド配下のすべての構成で利用可能です。

設定例

endpoints:
  # Individual endpoint configurations
  openAI:
    streamRate: 25
    titleModel: 'gpt-4o-mini'
    titleMethod: 'completion'
    titleTiming: 'immediate'
    titlePrompt: "Create a concise title for this conversation:\n\n{convo}"
    headers:
      X-Gateway-Metadata: '{"user_email":"{{LIBRECHAT_USER_EMAIL}}"}'
 
  azureOpenAI:
    streamRate: 35
    titleModel: 'grok-3'
    titleMethod: 'structured'
    titlePrompt: |
      Analyze this conversation and provide:
      1. A concise title in the detected language (5 words or less, no punctuation or quotation)
      2. Always provide a relevant emoji at the start of the title
 
      {convo}
    titleConvo: true
 
  anthropic:
    streamRate: 25
    titleModel: 'claude-3-5-haiku-20241022'
    titleMethod: 'completion'
    headers:
      X-Conversation-Id: '{{LIBRECHAT_BODY_CONVERSATIONID}}'
 
  bedrock:
    streamRate: 25
    titleModel: 'us.amazon.nova-lite-v1:0'
    titleEndpoint: 'anthropic'
 
  google:
    streamRate: 1
    titleModel: 'gemini-2.0-flash-lite'
    titlePromptTemplate: "Human: {input}\nAssistant: {output}"
    headers:
      X-Gateway-Metadata: '{"user_id":"{{LIBRECHAT_USER_ID}}"}'
 
  assistants:
    streamRate: 30
 
  azureAssistants:
    streamRate: 30
 
  # Global configuration using 'all' - this applies shared settings across endpoints.
  # Most defined values override endpoint defaults; headers are merged and endpoint values win on collisions.
  all:
    headers:
      X-App: 'librechat'
    titleConvo: true
    titleModel: 'gpt-4.1-nano'
    titleTiming: 'immediate'
    titlePrompt: |
      Analyze this conversation and provide:
      1. The detected language of the conversation
      2. A concise title in the detected language (5 words or less, no punctuation or quotation)
      3. Always provide a relevant emoji at the start of the title
      {convo}

重要: all 設定を使用する場合、定義した共有プロパティのほとんどがすべての endpoint に適用されます。上記の例では、all 設定によって titleConvotitleModel、および titlePrompt がすべての endpoint に適用されますが、streamRateall 内で定義されていないため、個別の設定が保持されます。headers は個別にマージされます。endpoints.all.headers の値はグローバルに適用され、キーが重複した場合は endpoint レベルのヘッダーが優先されます。

streamRate

キー:

KeyTypeDescriptionExample
streamRateNumberendpointからデータがストリーミングされる速度。ストリーミングデータのペースを制御するのに便利です。streamRate: 25

デフォルト: 1

システムが次のティックを待機できるようにしつつ、可能な限り最速のレートでデータをストリーミングできるようにします。

titleConvo

キー:

KeyTypeDescriptionExample
titleConvoBooleanこのendpointの会話タイトル自動生成を有効にします。titleConvo: true

デフォルト: false

注記:

  • 有効にすると、設定されたタイトル設定を使用してタイトルが自動的に生成されます。
  • titleModelと併用するか、endpointにデフォルトのモデルが設定されている必要があります。

例:

titleConvo: true

titleTiming

キー:

KeyTypeDescriptionExample
titleTimingString会話タイトルの生成タイミングを制御します。有効な値は "immediate" または "final" です。titleTiming: "immediate"

デフォルト: "immediate"

利用可能な値:

  • "immediate" - リクエスト開始直後に、ユーザーの最初のメッセージを使用して、モデルの応答と並行してタイトルを生成します。タイトルは通常1〜2秒以内に表示されます。
  • "final" - タイトルの生成を完全な応答が完了するまで延期します。これにより、従来の動作が維持されます。

例:

endpoints:
  all:
    titleTiming: 'immediate'

titleModel

キー:

KeyTypeDescriptionExample
titleModelStringタイトルに使用するモデルを指定します。Defaults to system default for the current endpoint if omitted. May cause issues if the system default model is not available. You can also dynamically use the current conversation model by setting it to "current_model".

デフォルト: 現在の endpoint のシステムデフォルト

titleMethod

キー:

KeyTypeDescriptionExample
titleMethodString会話タイトルの生成に使用されるメソッドを制御します。Valid values: "completion" (default), "structured", "functions" (legacy alias for "structured")

デフォルト: "completion"

利用可能なメソッド:

  • "completion" - ツールや関数を使用しない標準の completion API を使用します。ほとんどの LLM と互換性があります。
  • "structured" - タイトル生成に構造化出力を使用します。プロバイダー/モデルによるサポートが必要です。
  • "functions" - "structured" のレガシーエイリアスです。機能的には同一です。

例:

titleMethod: 'completion'

titlePrompt

キー:

KeyTypeDescriptionExample
titlePromptStringタイトル生成用のカスタムプロンプト。{convo} プレースホルダーを含める必要があります。Allows full control over how titles are generated.

デフォルト:

Analyze this conversation and provide:
1. The detected language of the conversation
2. A concise title in the detected language (5 words or less, no punctuation or quotation)

{convo}

注記:

  • 常に {convo} プレースホルダーを含める必要があります
  • {convo} プレースホルダーは、フォーマットされた会話に置き換えられます。
  • プロンプト内のどこにでも配置できます

例:

titlePrompt: "Create a brief, descriptive title for the following conversation:\n\n{convo}\n\nTitle:"

titlePromptTemplate

キー:

KeyTypeDescriptionExample
titlePromptTemplateStringtitlePrompt内の {convo} を置き換える、会話コンテンツのフォーマット用テンプレート。Must include {input} and {output} placeholders.

デフォルト: "User: {input}\nAI: {output}"

注記:

  • {input}{output} の両方のプレースホルダーを含める必要があります
  • {input} はユーザーの最初のメッセージに置き換えられます
  • {output} はAIの応答に置き換えられます
  • フォーマットされた結果は、titlePrompt内の {convo} を置き換えます。

例:

titlePromptTemplate: "Human: {input}\n\nAssistant: {output}"

titleEndpoint

キー:

KeyTypeDescriptionExample
titleEndpointStringタイトル生成に使用する代替のendpointを指定します。Allows using a different, potentially cheaper model/endpoint for titles.

デフォルト: 現在の会話のendpointを使用します

許容値:

例:

# Use Anthropic for titles even when chatting with OpenAI
endpoints:
  openAI:
    titleEndpoint: 'anthropic'
    # Will use anthropic's configuration for title generation

maxToolResultChars

キー:

KeyTypeDescriptionExample
maxToolResultCharsNumberモデルに送信されるツール呼び出し結果の最大文字数を制限します。正の数である必要があります。maxToolResultChars: 50000

デフォルト: 制限なし

注記:

  • 過度に大きなツール出力がトークンを過剰に消費するのを防ぐのに役立ちます
  • エンドポイントのすべてのツール呼び出し結果に適用されます

例:

endpoints:
  all:
    maxToolResultChars: 50000

headers

キー:

KeyTypeDescriptionExample
headersObject/Dictionaryサポートされている組み込みプロバイダーのendpointに転送されるカスタムリクエストヘッダー。Useful for AI gateways and reverse proxies that consume metadata headers while LibreChat keeps provider-native request formatting.

サポートされているendpoint: openAIanthropicgoogle、および all

例:

endpoints:
  all:
    headers:
      X-App: 'librechat'
  anthropic:
    headers:
      X-Conversation-Id: '{{LIBRECHAT_BODY_CONVERSATIONID}}'

注記:

  • 値は ${ENV_VAR}{{LIBRECHAT_USER_*}}、および {{LIBRECHAT_BODY_CONVERSATIONID}} のようなリクエストボディのプレースホルダーをサポートしています。
  • エンドポイントレベルのヘッダーは、キーが競合した場合に endpoints.all.headers を上書きします。
  • プロバイダー管理の認証および必須のベータ/プロトコルヘッダーが優先されます。Anthropicのベータ値はマージされるため、カスタムのベータフラグが必須のプロバイダーフラグを上書きすることはありません。
  • サポートされているプロバイダーのモデル一覧リクエストに対しても、ヘッダーが転送されます。
  • ゲートウェイやリバースプロキシの背後でメタデータヘッダーを使用し、それらを消費するようにします。ネイティブプロバイダーのAPIは通常、不明なヘッダーを無視します。

注記:

  • このページに表示されているすべての設定は、各 endpoint ごとに個別に、または all キーを使用してグローバルに構成できます。
  • all 設定を使用する場合、すべての個別の endpoint における対応する設定が上書きされます。
  • all キーは baseURL を受け付けません
  • all で定義されていない設定は、それぞれの endpoint の値を保持します。
  • streamRate について: スムーズなストリーミング体験のためには、25〜40の値を推奨します。
  • 多くのユーザーに大規模にアプリを提供する場合は、より高いストリームレートを使用することが必須です。

オーバーライド動作の例:

endpoints:
  openAI:
    streamRate: 25 # This will be preserved
    titleModel: 'gpt-4' # This will be overridden
    titleConvo: false # This will be overridden
 
  all:
    titleConvo: true
    titleModel: 'gpt-3.5-turbo'
    # streamRate not defined here, so individual values are kept

Endpoint Settings

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