共享 endpoint 设置
本页面介绍了所有 endpoint 的共享配置设置。除非另有说明,否则此处突出显示的设置适用于 "Endpoints" 字段下的所有配置。
示例配置
重要提示: 当使用
all配置时,您定义的大多数共享属性将应用于所有 endpoint。在上面的示例中,all配置会将titleConvo、titleModel和titlePrompt应用于所有 endpoint,而各个 endpoint 的streamRate设置将被保留,因为它们未在all中定义。headers会被单独合并:来自endpoints.all.headers的值将全局应用,且在键冲突时,endpoint 级别的 header 优先级更高。
streamRate
键:
| Key | Type | Description | Example |
|---|---|---|---|
| streamRate | Number | 从 endpoint 流式传输数据的速率。用于控制流式数据的传输速度。 | streamRate: 25 |
默认值: 1
允许以尽可能快的速度流式传输数据,同时允许系统等待下一个时钟周期
titleConvo
键:
| Key | Type | Description | Example |
|---|---|---|---|
| titleConvo | Boolean | 为此 endpoint 启用自动对话标题生成。 | titleConvo: true |
默认值: false
注意:
- 启用后,将使用配置的标题设置自动生成标题。
- 必须与
titleModel结合使用,或者该 endpoint 必须具有可用的默认模型。
示例:
titleTiming
键:
| Key | Type | Description | Example |
|---|---|---|---|
| titleTiming | String | 控制何时生成对话标题。有效值为 "immediate" 或 "final"。 | titleTiming: "immediate" |
默认值: "immediate"
可用值:
"immediate"- 在请求开始时立即生成标题,与模型响应并行,使用用户的第一条消息。标题通常会在一两秒内出现。"final"- 将标题生成推迟到完整响应完成之后。这保留了旧有的行为。
示例:
titleModel
键:
| Key | Type | Description | Example |
|---|---|---|---|
| titleModel | String | 指定用于生成标题的模型。 | 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
键:
| Key | Type | Description | Example |
|---|---|---|---|
| titleMethod | String | 控制用于生成对话标题的方法。 | Valid values: "completion" (default), "structured", "functions" (legacy alias for "structured") |
默认值: "completion"
可用方法:
"completion"- 使用不带工具/函数的标准 completion API。兼容大多数 LLM。"structured"- 使用结构化输出进行标题生成。需要提供商/模型支持。"functions"- "structured" 的旧版别名。功能完全相同。
示例:
titlePrompt
键:
| Key | Type | Description | Example |
|---|---|---|---|
| titlePrompt | String | 用于生成标题的自定义提示词。必须包含 {convo} 占位符。 | Allows full control over how titles are generated. |
默认:
注意:
- 必须始终包含
{convo}占位符 {convo}占位符将被替换为格式化后的对话- 可以放置在提示词中的任何位置
示例:
titlePromptTemplate
键:
| Key | Type | Description | Example |
|---|---|---|---|
| titlePromptTemplate | String | 用于格式化对话内容并替换 titlePrompt 中 {convo} 的模板。 | Must include {input} and {output} placeholders. |
默认值: "User: {input}\nAI: {output}"
注意:
- 必须包含
{input}和{output}占位符 {input}会被替换为用户的初始消息{output}会被替换为 AI 的回复- 格式化后的结果会替换 titlePrompt 中的
{convo}
示例:
titleEndpoint
键:
| Key | Type | Description | Example |
|---|---|---|---|
| titleEndpoint | String | 指定用于生成标题的替代 endpoint。 | Allows using a different, potentially cheaper model/endpoint for titles. |
默认: 使用当前对话的 endpoint
接受的值:
openAIazureOpenAIgoogleanthropicbedrock- 对于自定义 endpoint:请使用确切的 自定义 endpoint 名称
示例:
maxToolResultChars
键:
| Key | Type | Description | Example |
|---|---|---|---|
| maxToolResultChars | Number | 限制发送给模型的工具调用结果的最大字符数。必须为正数。 | maxToolResultChars: 50000 |
默认: 无限制
注意:
- 有助于防止过大的工具输出消耗过多的 token
- 应用于该 endpoint 的所有工具调用结果
示例:
headers
键:
| Key | Type | Description | Example |
|---|---|---|---|
| headers | Object/Dictionary | 转发至受支持的内置提供商 endpoint 的自定义请求标头。 | Useful for AI gateways and reverse proxies that consume metadata headers while LibreChat keeps provider-native request formatting. |
支持的 endpoint: openAI、anthropic、google 和 all。
示例:
注意:
- 值支持
${ENV_VAR}、{{LIBRECHAT_USER_*}}以及请求体占位符,例如{{LIBRECHAT_BODY_CONVERSATIONID}}。 - Endpoint 级别的 headers 会在键冲突时覆盖
endpoints.all.headers。 - 由提供商管理的身份验证以及必需的 beta/protocol 标头仍然具有权威性。Anthropic beta 值会进行合并,因此自定义 beta 标志不会覆盖必需的提供商标志。
- 对于受支持的提供商模型列表请求,请求头也会被转发。
- 在网关或反向代理后使用元数据标头,并由其进行处理。原生提供商 API 通常会忽略未知的标头。
注意:
- 此页面上显示的所有设置都可以针对每个 endpoint 单独配置,也可以使用
all键进行全局配置。 - 当使用
all配置时,它将覆盖所有独立 endpoint 中的相应设置。 all键不支持baseURL- 未在
all中定义的设置将保留其各自的 endpoint 值 - 对于
streamRate:建议取值在 25-40 之间,以获得流畅的流式传输体验 - 当大规模向许多用户提供应用服务时,使用更高的流式传输速率是必须的。
覆盖行为示例:
Endpoint Settings
这篇指南怎么样?