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

Model Specs 对象结构

概述

modelSpecs 对象可帮助您为应用程序中的 AI 模型提供更简洁的 UI 体验。

modelSpecs 下有 3 个主要字段:

  • enforce (可选;默认值:false)
  • prioritize (可选;默认值:true)
  • list (必填)
  • addedEndpoints (可选)

注意:

  • 如果 enforce 设置为 true,Model Specs 可能会与 modelSelectpresetsparameters 等其他界面设置发生冲突。
  • list 数组包含每个模型的详细配置,其中包括规定特定行为、外观和功能的预设。
  • 如果未在配置中指定 interface 字段,拥有 Model Specs 列表将禁用以下界面元素:
    • modelSelect
    • parameters
    • presets
  • 如果您希望在启用 Model Specs 的同时启用这些界面元素,可以将 interface 对象中的它们设置为 true

使用 Model Specs 管理用户提供的 API 密钥

当 Model Specs 禁用 modelSelect 时,端点下拉菜单以及用于打开 Set API Key 对话框的齿轮图标将被隐藏。用户仍然可以通过 Settings → Data controls → API keys 为任何配置了 apiKey: "user_provided" 的端点设置或轮换密钥。

该列表的作用域限定为用户实际可以访问的 endpoint:即您的 Model Specs 所引用的 endpoint,以及任何 addedEndpoints。当 agents endpoint 可达时,它还会包含 agent 的 allowedProviders(或者在未设置 allowedProviders 时包含所有已配置的提供商)。

示例

modelSpecs:
  enforce: true
  prioritize: true
  list:
    - name: 'meeting-notes-gpt4'
      label: 'Meeting Notes Assistant (GPT4)'
      softDefault: true
      description: 'Generate meeting notes by simply pasting in the transcript from a Teams recording.'
      iconURL: 'https://example.com/icon.png'
      showOnLanding: true
      conversation_starters:
        - 'Summarize this meeting transcript'
        - 'Extract action items and owners'
      hideBadgeRow: true
      skills:
        - 'brand-guidelines'
        - 'meeting-notes'
      subagents:
        enabled: true
        allowSelf: true
        agent_ids: []
      preset:
        endpoint: 'azureOpenAI'
        model: 'gpt-4-turbo-1106-preview'
        maxContextTokens: 128000 # Maximum context tokens
        max_tokens: 4096 # Maximum output tokens
        temperature: 0.2
        modelLabel: 'Meeting Summarizer'
        greeting: |
          This assistant creates meeting notes based on transcripts of Teams recordings.
          To start, simply paste the transcript into the chat box.
        promptPrefix: |
          Based on the transcript, create coherent meeting minutes for a business meeting. Include the following sections:
          - Date and Attendees
          - Agenda
          - Minutes
          - Action Items

          Focus on what items were discussed and/or resolved. List any open action items.
          The format should be a bulleted list of high level topics in chronological order, and then one or more concise sentences explaining the details.
          Each high level topic should have at least two sub topics listed, but add as many as necessary to support the high level topic. 

          - Do not start items with the same opening words.

          Take a deep breath and be sure to think step by step.

顶层字段

enforce

KeyTypeDescriptionExample
enforceBoolean确定模型规范是否应严格覆盖其他配置设置。Setting this to `true` can lead to conflicts with interface options if not managed carefully.

默认值: false

示例:

modelSpecs:
  enforce: true

prioritize

KeyTypeDescriptionExample
prioritizeBoolean指定当 Model Specs 和默认配置同时适用时,是否应优先使用 Model Specs。When set to `true`, it ensures that a modelSpec is always selected in the UI. Doing this may prevent users from selecting different endpoints for the selected spec.

默认值: true

示例:

modelSpecs:
  prioritize: false

addedEndpoints

KeyTypeDescriptionExample
addedEndpointsArray of Strings允许在 UI 中与定义的 Model Specs 一起选择特定的 endpoint(例如 "openAI"、"google")。Requires `interface.modelSelect` to be `true`. If this field is used and `interface.modelSelect` is not explicitly set, `modelSelect` will default to `true`.

默认值: [](空列表)

注意: 必须是以下选项之一:

  • openAI, azureOpenAI, google, anthropic, assistants, azureAssistants, bedrock, agents

示例:

modelSpecs:
  # ... other modelSpecs fields
  addedEndpoints:
    - openAI
    - google

list

必需

KeyTypeDescriptionExample
listArray of Objects包含一系列详细说明各种配置和行为的独立 Model Specs 列表。Each object in the list details the configuration for a specific model, including its behaviors, appearance, and capabilities related to the application's functionality.

Model Spec (列表项)

在每个 Model Spec 或每个 list 项目中,您可以配置以下字段:


name

KeyTypeDescriptionExample
nameString模型的唯一标识符。No default. Must be specified.

描述: 模型的唯一标识符。


label

KeyTypeDescriptionExample
labelString模型的一个用户友好名称或标签,显示在页眉下拉菜单中。No default. Optional.

描述: 模型的用户友好名称或标签,显示在页眉下拉菜单中。


default

KeyTypeDescriptionExample
defaultBoolean指定此 Model Specs 是否为默认选项,以便在每次新建对话时自动选中。

描述:
指定此 Model Specs 是否为默认选项,以便在每次新建聊天时自动选中。


softDefault

KeyTypeDescriptionExample
softDefaultBoolean指定此 Model Specs 是否仅应为尚未选择模型、Model Specs 或智能体的首次使用用户进行选择。

描述:

指定首次运行时的默认值,且不会覆盖用户后续的选择。当您希望引导新用户使用精选的 Spec,同时在用户选择其他模型、Spec 或 Agent 后保留其选择时,请使用 softDefault

查看使用软默认(soft-default)Model Specs 的旧对话时,如果用户已经进行了其他选择,系统不会将该 Model Specs 重新设为用户的默认选项。

示例:

modelSpecs:
  list:
    - name: 'general-assistant'
      label: 'General Assistant'
      softDefault: true
      preset:
        endpoint: 'openAI'
        model: 'gpt-4o-mini'

iconURL

KeyTypeDescriptionExample
iconURLString用于选择器、页眉和对话品牌标识中模型图标的 URL 或预定义的 endpoint 名称。No default. Optional.

描述:
模型图标的 URL 或预定义的 endpoint 名称,用于选择器、页眉和对话品牌标识。使用 showIconInMenushowIconInHeader 来控制图标显示的具体位置。


description

KeyTypeDescriptionExample
descriptionString模型及其预期用途或角色的简要描述,显示在模型选择器中,也可选择显示在聊天着陆页上。No default. Optional.

Description: 该模型及其预期用途或角色的简要描述,显示在模型选择器中。如果 showOnLanding 为 true,则相同的描述也会显示在聊天着陆页的 spec 标签下方。

纯文本描述会以文本形式渲染。以 < 开头的描述会通过配置的 HTML 清理器进行渲染,从而允许使用安全的内联标记和媒体(例如小图标)。


conversation_starters

KeyTypeDescriptionExample
conversation_startersArray of Strings当选中此 Model Specs 时,在聊天着陆页上显示为可点击卡片的建议起始提示词。No default. Optional.

描述: 对话启动器(Conversation starters)为 Model Specs 提供精选的初始提示词。它们显示在所选 spec 的空聊天页面上,特别适用于 showOnLanding 品牌推广。点击启动器会将其作为新对话的第一条消息提交。

  • 最多显示 4 个启动项,与 agent/assistant 的限制相匹配。
  • 如果该 Model Specs 的预设指向了一个定义了自身对话启动器的 Agent 或 Assistant,则这些启动器具有优先权。

示例:

modelSpecs:
  list:
    - name: 'meeting-notes'
      label: 'Meeting Notes'
      showOnLanding: true
      conversation_starters:
        - 'Summarize this meeting transcript'
        - 'Create action items with owners and due dates'
      preset:
        endpoint: 'agents'
        model: 'gpt-4o'

showOnLanding

KeyTypeDescriptionExample
showOnLandingBoolean在聊天着陆页上显示此 Model Specs 的标签和描述,以代替默认问候语。showOnLanding: true

默认值: false

当需要通过精选的 Model Specs 来定制首次进入空聊天界面的显示效果时,请使用此项。除非将 showOnLanding 设置为 true,否则现有的 Model Specs 将保持不变。

示例:

modelSpecs:
  list:
    - name: 'branded-assistant'
      label: 'Acme Research'
      description: '<span><img src="/assets/acme.svg" alt="Acme" /> Research with approved sources</span>'
      showOnLanding: true
      iconURL: '/assets/acme.svg'
      preset:
        endpoint: 'openAI'
        model: 'gpt-4o'

group

KeyTypeDescriptionExample
groupString用于在 UI 选择器中组织 Model Specs 的可选组名。控制该规范在菜单层级中的显示位置。No default. Optional.
groupIconString自定义分组的可选图标。可以是 URL 或内置的 endpoint 键(例如 "openAI", "groq")。每个分组中仅使用第一个带有 groupIcon 的 spec。No default. Optional.

描述: 用于在 UI 选择器中组织 Model Specs 的可选组名。group 字段提供了对 Model Specs 组织方式的灵活控制:

  • 如果 group 与 endpoint 名称匹配(例如 "openAI""groq"):Model Specs 将显示在选择器菜单中该 endpoint 下方的嵌套位置。
  • 如果 group 是自定义名称(不匹配任何 endpoint):将创建一个带有该名称的独立可折叠部分。你可以选择使用 groupIcon 为该部分设置自定义图标(URL 或内置键,例如 "openAI")。
  • 如果省略 group:Model Specs 将作为顶级项目单独显示。

当您希望在不破坏选择器菜单组织结构的情况下为模型添加描述时,此功能特别有用。


hideBadgeRow

KeyTypeDescriptionExample
hideBadgeRowBoolean在聊天输入框中隐藏此 Model Specs 的工具徽章行。hideBadgeRow: true

默认值: false

当不希望在输入框下方显示工具/功能徽章行时,请使用此项。

示例:

modelSpecs:
  list:
    - name: 'general-assistant'
      label: 'General Assistant'
      hideBadgeRow: true
      preset:
        endpoint: 'openAI'
        model: 'gpt-4o-mini'

示例:

modelSpecs:
  list:
    # Example 1: Nested under an endpoint
    # When group matches an endpoint name, the spec appears under that endpoint
    - name: 'gpt-4o-optimized'
      label: 'GPT-4 Optimized'
      description: 'Most capable GPT-4 model with multimodal support'
      group: 'openAI' # Appears nested under the OpenAI endpoint
      preset:
        endpoint: 'openAI'
        model: 'gpt-4o'

    # Example 2: Custom group section with icon
    # When group is a custom name, it creates a separate collapsible section
    - name: 'coding-assistant'
      label: 'Coding Assistant'
      description: 'Specialized for coding tasks'
      group: 'My Assistants'
      groupIcon: 'https://example.com/icons/assistants.png' # Custom icon for the group
      preset:
        endpoint: 'openAI'
        model: 'gpt-4o'

    # Multiple specs with the same group name are grouped together
    - name: 'writing-assistant'
      label: 'Writing Assistant'
      description: 'Specialized for creative writing'
      group: 'My Assistants' # Grouped with coding-assistant, uses its icon
      preset:
        endpoint: 'anthropic'
        model: 'claude-sonnet-4'

    # Example 3: Custom group using built-in icon
    - name: 'fast-model'
      label: 'Fast Model'
      group: 'Fast Models'
      groupIcon: 'groq' # Uses built-in Groq icon
      preset:
        endpoint: 'groq'
        model: 'llama3-8b-8192'

    # Example 4: Standalone (no group)
    # When group is omitted, the spec appears at the top level
    - name: 'general-assistant'
      label: 'General Assistant'
      description: 'General purpose assistant'
      # No group field - appears as standalone item at top level
      preset:
        endpoint: 'openAI'
        model: 'gpt-4o-mini'

showIconInMenu

KeyTypeDescriptionExample
showIconInMenuBoolean控制模型图标是否显示在页眉下拉菜单中。

描述:
控制模型图标是否显示在页眉下拉菜单中。默认为 true


showIconInHeader

KeyTypeDescriptionExample
showIconInHeaderBoolean控制模型图标是否显示在标题下拉按钮中其名称的左侧。

描述:
控制模型图标是否显示在页眉下拉按钮中(位于名称左侧)。默认为 true


authType

KeyTypeDescriptionExample
authTypeString模型规格所需的身份验证类型。Optional. Possible values: "override_auth", "user_provided", "system_defined"

描述:
Model Specs 所需的身份验证类型。决定了身份验证是被覆盖、由用户提供,还是由系统定义。


webSearch

KeyTypeDescriptionExample
webSearchBoolean为此 Model Specs 启用网络搜索功能。When true, the model can perform web searches.

描述:
为此 Model Specs 启用网页搜索功能。当设置为 true 时,模型可以执行网页搜索以检索最新信息。

示例:

modelSpecs:
  list:
    - name: 'research-assistant'
      label: 'Research Assistant'
      webSearch: true
      preset:
        endpoint: 'openAI'
        model: 'gpt-4o'

fileSearch

KeyTypeDescriptionExample
fileSearchBoolean为此 Model Specs 启用文件搜索功能。When true, the model can search through uploaded files.

描述:
为此 Model Specs 启用文件搜索功能。当设置为 true 时,模型可以搜索并引用已上传的文件。

示例:

modelSpecs:
  list:
    - name: 'document-analyst'
      label: 'Document Analyst'
      fileSearch: true
      preset:
        endpoint: 'openAI'
        model: 'gpt-4o'

executeCode

KeyTypeDescriptionExample
executeCodeBoolean为此 Model Specs 启用代码执行功能。When true, the model can execute code.

描述:
为该 Model Specs 启用代码执行功能。当设置为 true 时,模型可以在沙盒环境中执行代码。

示例:

modelSpecs:
  list:
    - name: 'code-assistant'
      label: 'Code Assistant'
      executeCode: true
      preset:
        endpoint: 'openAI'
        model: 'gpt-4o'

mcpServers

KeyTypeDescriptionExample
mcpServersArray of Strings为此 Model Specs 启用的 Model Context Protocol (MCP) 服务器名称列表。Each string should match a configured MCP server name.

描述:
为此 Model Specs 启用的 Model Context Protocol (MCP) 服务器名称列表。MCP 服务器通过自定义工具和资源扩展模型的功能。

示例:

modelSpecs:
  list:
    - name: 'enhanced-assistant'
      label: 'Enhanced Assistant'
      mcpServers:
        - 'filesystem'
        - 'sequential-thinking'
        - 'fetch'
      preset:
        endpoint: 'openAI'
        model: 'gpt-4o'

skills

KeyTypeDescriptionExample
skillsBoolean or Array of Strings控制此 Model Specs 的 Skills。使用 true 表示启用用户当前可访问的目录,false 表示强制关闭 Skills,或使用 Skill 名称数组作为严格的允许列表。skills: ["brand-guidelines", "code-review"]

描述:

当 Agents endpoint 的 Skills 功能可用时,控制此 Model Specs 的技能。

  • true:启用用户当前可访问的 Skill 目录。
  • false:禁用此 Model Specs 的 Skills。
  • Skill 名称数组:缩小目录范围、手动调用,以及对指定 Skill 的强制应用解析。

示例:

modelSpecs:
  list:
    - name: 'brand-assistant'
      label: 'Brand Assistant'
      skills:
        - 'brand-guidelines'
        - 'approved-claims'
      preset:
        endpoint: 'agents'
        model: 'gpt-4o'

subagents

KeyTypeDescriptionExample
subagents.enabledBoolean为从此 Model Specs 创建的临时智能体启用 Subagents 功能。enabled: true
subagents.allowSelfBoolean允许临时智能体生成一个自身的隔离副本,以进行专注的工作。allowSelf: true
subagents.agent_idsArray of Strings此模型规范可生成的其他 Agent ID 的私有服务器端允许列表。agent_ids: []

描述:

控制为此 Model Specs 创建的临时智能体的子智能体(Subagents)。当你希望一个精心配置的 Model Specs 在无需用户创建或选择持久化父智能体的情况下,即可展示委派行为时,请使用此功能。

  • enabled:为该 Model Specs 添加子代理(subagent)生成工具。
  • allowSelf: 允许临时智能体生成一个全新的、隔离的自身副本。
  • agent_ids:允许将特定的持久化 agent 作为额外的子 agent。此列表受 MAX_SUBAGENTS 限制并保留在服务器端;发送给客户端的启动配置仅包含公共的 enabledallowSelf 标志。

当启用 Model Specs 时,Model Specs 的 subagents 设置将优先于请求负载中的值。

示例:

modelSpecs:
  list:
    - name: 'research-assistant'
      label: 'Research Assistant'
      subagents:
        enabled: true
        allowSelf: true
        agent_ids: []
      preset:
        endpoint: 'agents'
        model: 'gpt-4o'

artifacts

KeyTypeDescriptionExample
artifactsString | Boolean为该 Model Specs 启用 Artifacts 功能,并可选择设置 artifact 模式。Set to `true` to enable with the default mode, `false` or omit to disable, or a specific mode string (e.g., `"default"`) to enable with that mode.

描述:
为该 Model Specs 启用 Artifacts 功能,允许模型生成并显示交互式工件,例如 React 组件、HTML 和 Mermaid 图表。当设置为 true 时,将使用默认的 artifact 模式。你也可以直接指定模式字符串。

示例:

modelSpecs:
  list:
    - name: 'artifact-assistant'
      label: 'Artifact Assistant'
      artifacts: true
      preset:
        endpoint: 'openAI'
        model: 'gpt-4o'

preset

KeyTypeDescriptionExample
presetObject定义模型行为和能力的详细预设配置。See "Preset Object Structure" below.

描述:
定义模型行为和能力的详细预设配置(请参阅下方的 Preset Object Structure)。


预设字段

modelSpecs.list 项目中的 preset 字段由系统内 AI 模型的一套综合配置蓝图组成。它旨在指定 AI 模型的运行设置,从而调整其行为、输出以及与其他系统组件和 endpoint 的交互方式。

系统选项

endpoint

必需

接受的值:

  • openAI
  • azureOpenAI
  • google
  • anthropic
  • assistants
  • azureAssistants
  • bedrock
  • agents

注意: 如果您正在使用自定义 endpoint,则 endpoint 的值必须与定义的 自定义 endpoint 名称 完全一致。

KeyTypeDescriptionExample
endpointEnum (EModelEndpoint) or String (nullable)指定模型用于执行操作的 endpoint。此设置决定了模型所对接的外部或内部服务。

示例:

preset:
  endpoint: 'openAI'

modelLabel

KeyTypeDescriptionExample
modelLabelString (nullable)用于在用户界面或日志中标识模型的标签。它为模型提供了一个人类可读的名称,该名称不仅会显示在 UI 中,还会被 AI 所知晓。None

默认值: None

示例:

preset:
  modelLabel: 'Customer Support Bot'

greeting

KeyTypeDescriptionExample
greetingString在开始新聊天之前显示在 UI 中的预定义消息。这是向用户提供说明,或使界面看起来更友好、更易于使用的好方法。

默认值: None

示例:

preset:
  greeting: 'This assistant creates meeting notes based on transcripts of Teams recordings. To start, simply paste the transcript into the chat box.'

promptPrefix

KeyTypeDescriptionExample
promptPrefixString (nullable)在发送给模型的每个提示词前添加的静态文本,为响应设置一致的上下文。When using "assistants" as the endpoint, this becomes the OpenAI field `additional_instructions`.

默认值: None

示例 1:

preset:
  promptPrefix: 'As a financial advisor, ...'

示例 2:

preset:
  promptPrefix: |
    Based on the transcript, create coherent meeting minutes for a business meeting. Include the following sections:
    - Date and Attendees
    - Agenda
    - Minutes
    - Action Items

    Focus on what items were discussed and/or resolved. List any open action items.
    The format should be a bulleted list of high level topics in chronological order, and then one or more concise sentences explaining the details.
    Each high level topic should have at least two sub topics listed, but add as many as necessary to support the high level topic. 

    - Do not start items with the same opening words.

    Take a deep breath and be sure to think step by step.

resendFiles

KeyTypeDescriptionExample
resendFilesBoolean指示在未维护持久会话的情况下,是否应重新发送文件。

默认值: true

示例:

preset:
  resendFiles: true

imageDetail

接受的值:

  • 自动
KeyTypeDescriptionExample
imageDetailEnum (eImageDetailSchema)指定图像分析任务所需的详细程度,适用于具有视觉能力的模型(OpenAI 规范)。

默认值: "auto"

示例:

preset:
  imageDetail: 'high'

maxContextTokens

KeyTypeDescriptionExample
maxContextTokensNumber提供给模型的最大上下文 token 数量。Useful if you want to limit the maximum context for this preset.

示例:

preset:
  maxContextTokens: 4096

Agent 选项

请注意,这些选项仅在使用 agents endpoint 时适用。

您应该排除任何模型选项,并遵循 UI 中定义的智能体配置。

智能体访问过滤 (v0.8.0+)

从 v0.8.0 版本开始,LibreChat 为 Agent 使用了基于 ACL(访问控制列表)的权限系统。当 Model Specs 被配置为使用 Agent 时,即使用户在 Model Specs 中配置了某些 Agent,只要用户没有访问权限,这些 Agent 也会被自动过滤掉。这确保了用户只能看到并使用他们拥有相应权限的 Agent。

有关 ACL 权限系统的更多信息,请参阅 Agents 文档


agent_id

KeyTypeDescriptionExample
agent_idString助手的标识。

示例:

preset:
  agent_id: 'agent_someUniqueId'

助手选项

请注意,这些选项仅在使用 assistantsazureAssistants endpoint 时适用。

Agents 类似,您应该排除任何模型选项,并遵循 assistant 的配置。


assistant_id

KeyTypeDescriptionExample
assistant_idString助手的标识。

示例:

preset:
  assistant_id: 'asst_someUniqueId'

instructions

**注意:**这与 promptPrefix 不同,因为它会覆盖当前运行中现有的助手指令。

仅在你想覆盖助手的核心指令时才使用此项。

使用 promptPrefix 来设置 additional_instructions

更多信息:

KeyTypeDescriptionExample
instructionsString覆盖助手的默认指令。

示例:

preset:
  instructions: 'Please handle customer queries regarding order status.'

append_current_datetime

将当前日期和时间添加到每次运行的 additional_instructions 中。不会覆盖 promptPrefix,而是将其附加到后面。

KeyTypeDescriptionExample
append_current_datetimeBoolean将当前日期和时间添加到 `promptPrefix` 定义的 `additional_instructions` 中

示例:

preset:
  append_current_datetime: true

模型选项

注意: 下方的每个参数都包含有关哪些 endpoint 支持它的说明。
OpenAI / AzureOpenAI / Custom 通常支持 temperaturepresence_penaltyfrequency_penaltystoptop_pmax_tokens
Google / Anthropic 通常支持 topPtopKmaxOutputTokens;Google 在受支持的 Gemini 文本模型上还支持 url_contextAnthropic / OpenRouter / Bedrock (Anthropic 和 Nova 模型) 支持 promptCachepromptCacheTtlBedrock 支持 regionmaxTokens 以及其他少数参数。

model

支持情况: 所有 endpoint(agents 除外)

KeyTypeDescriptionExample
modelString (nullable)预设所使用的模型名称,需与所选 endpoint 下配置的模型相匹配。None

默认值: None

示例:

preset:
  model: 'gpt-4-turbo'

temperature

支持的平台: openAIazureOpenAIgoogle(作为 temperature)、anthropic(作为 temperature)以及自定义(类 OpenAI)

KeyTypeDescriptionExample
temperatureNumber控制模型响应的确定性或“创造性”。

示例:

preset:
  temperature: 0.7

presence_penalty

支持的端点: openAI, azureOpenAI, custom (OpenAI-like)
通常不被 Google/Anthropic/Bedrock 使用

KeyTypeDescriptionExample
presence_penaltyNumber重复标记惩罚,鼓励探索新主题。

示例:

preset:
  presence_penalty: 0.3

frequency_penalty

支持的端点: openAI, azureOpenAI, custom (OpenAI-like)
通常不被 Google/Anthropic/Bedrock 使用

KeyTypeDescriptionExample
frequency_penaltyNumber重复 token 的惩罚,用于减少回复中的冗余。

示例:

preset:
  frequency_penalty: 0.5

stop

支持的端点: openAI, azureOpenAI, custom (OpenAI-like)
通常不被 Google/Anthropic/Bedrock 使用

KeyTypeDescriptionExample
stopArray of Strings模型的停止词(Stop tokens),用于指示模型在遇到这些词时结束响应。

示例:

preset:
  stop:
    - 'END'
    - 'STOP'

top_p

支持的端点: openAIazureOpenAI,自定义(类 OpenAI)
Google/Anthropic 通常使用 topP(大写“P”)而不是 top_p

KeyTypeDescriptionExample
top_pNumber核采样参数 (0-1),用于控制 token 的随机性。

示例:

preset:
  top_p: 0.9

topP

支持的平台: google & anthropic
(用途与 top_p 类似,但在这些 API 中命名不同)

KeyTypeDescriptionExample
topPNumber用于 Google/Anthropic endpoint 的核采样(Nucleus sampling)参数。

示例:

preset:
  topP: 0.8

topK

支持: google & anthropic
(对下一个 token 分布的 k-采样限制)

KeyTypeDescriptionExample
topKNumber将下一个 token 的选择限制在前 K 个 token 以内。

示例:

preset:
  topK: 40

max_tokens

支持的端点: openAIazureOpenAI,自定义(类 OpenAI)
对于 Google/Anthropic,请使用 maxOutputTokensmaxTokens(取决于具体的 endpoint)。

KeyTypeDescriptionExample
max_tokensNumber模型响应中的最大 token 数量。

示例:

preset:
  max_tokens: 4096

maxOutputTokens

支持的提供商: google, anthropic
对于这些提供商,等同于 max_tokens

KeyTypeDescriptionExample
maxOutputTokensNumber响应中的最大 token 数量 (Google/Anthropic)。

示例:

preset:
  maxOutputTokens: 2048

promptCache

支持的提供商: anthropic,OpenRouter 自定义端点,bedrock(Anthropic 和 Nova 模型) (切换提供商提示词缓存)

KeyTypeDescriptionExample
promptCacheBoolean启用或禁用提供商提示词缓存。

默认值: true

示例:

preset:
  promptCache: true

注意: 对于 Bedrock endpoint,Claude 和 Nova 模型会自动启用提示词缓存(prompt caching)。设置 promptCache: false 可显式禁用此功能。


promptCacheTtl

支持的端点: anthropic,OpenRouter 自定义端点,bedrock(Anthropic 和 Nova 模型) (当启用提示词缓存时,设置提示词缓存的生命周期)

KeyTypeDescriptionExample
promptCacheTtlEnum设置 prompt-cache 的生命周期。支持的值为 `5m` 和 `1h`。Provider or SDK default

接受的值:

  • 5m
  • 1h

示例:

preset:
  promptCache: true
  promptCacheTtl: '1h'

注意: 当禁用 prompt caching 时,promptCacheTtl 将被忽略。如果省略此项,提供商集成将使用其默认的 prompt-cache 生命周期。


reasoning_effort

接受的值:

  • ""(空字符串 — 未设置,使用 API 默认值)
  • "none"
  • "minimal"
  • "low"
  • "medium"
  • "high"
  • "xhigh" (超高)

支持的平台: openAI, azureOpenAI, 自定义 (OpenAI-like), bedrock (ZAI, MoonshotAI 模型)

KeyTypeDescriptionExample
reasoning_effortString控制模型的推理努力程度。降低推理努力可以加快响应速度并减少推理所使用的 token 数量。`xhigh` 选项为复杂问题提供最大的推理能力。对于 Bedrock,接受的值为 `low`、`medium`、`high`。

默认值: "" (未设置)

示例:

preset:
  reasoning_effort: 'low'

reasoning_summary

接受的值:

  • ""(空字符串 — 禁用推理摘要)
  • "auto"
  • "concise"
  • "detailed"

支持: openAI, azureOpenAI, 自定义 (OpenAI-like)

KeyTypeDescriptionExample
reasoning_summaryString为模型设置推理摘要偏好。

默认值: "" (已禁用)

示例:

preset:
  reasoning_summary: 'detailed'

useResponsesApi

支持: openAI, azureOpenAI, 自定义 (OpenAI-like)

KeyTypeDescriptionExample
useResponsesApiBoolean启用或禁用该模型的响应 API。

默认值: false

示例:

preset:
  useResponsesApi: true

verbosity

接受的值:

  • ""(空字符串 — 未设置,使用 API 默认值)
  • "low"
  • "medium"
  • "high"

支持: openAI, azureOpenAI, 自定义 (OpenAI-like)

KeyTypeDescriptionExample
verbosityString控制模型响应的详细程度。

默认值: "" (未设置)

示例:

preset:
  verbosity: 'low'

支持的端点: openAI, azureOpenAI, 自定义 (类 OpenAI), google, anthropic

KeyTypeDescriptionExample
web_searchBoolean启用或禁用模型的网络搜索功能。

默认值: false

注意: 对于 Google endpoint,此参数在实际面板中显示为 Grounding with Google Search,但在实现中控制的是 web_search

示例:

preset:
  web_search: true

url_context

支持情况: google 在受支持的 Gemini 文本模型上,包括 Gemini 2.5+ 和 Gemini 3.x

KeyTypeDescriptionExample
url_contextBoolean启用 Google URL Context,以便模型能够读取用户消息中包含的 URL。YouTube 链接在可能的情况下会被转换为原生视频理解输入。

默认值: false

示例:

preset:
  url_context: true

disableStreaming

支持: openAI, azureOpenAI, 自定义 (OpenAI-like)

KeyTypeDescriptionExample
disableStreamingBoolean禁用来自模型的流式响应。

默认值: false

示例:

preset:
  disableStreaming: true

thinkingBudget

支持的平台: google, anthropic, bedrock (Anthropic 模型)

KeyTypeDescriptionExample
thinkingBudgetNumber or String控制模型可用于内部推理的思维 token 数量。更大的预算可以提高复杂问题的响应质量。

默认值: "Auto (-1)" (Google), 2000 (Anthropic, Bedrock (Anthropic models))

示例:

preset:
  thinkingBudget: '2000'

thinkingLevel

支持: google (Gemini 3+ 模型)

KeyTypeDescriptionExample
thinkingLevelString控制 Gemini 3+ 模型的思维努力程度。Gemini 2.5 模型则使用 `thinkingBudget`。

接受的值:

  • "" (未设置/自动)
  • "minimal"
  • "low"
  • "medium"
  • "high"

默认值: "" (未设置 — 由模型决定)

示例:

preset:
  thinkingLevel: 'medium'

effort

支持: anthropic, bedrock (Anthropic 模型)

KeyTypeDescriptionExample
effortString控制受支持的 Anthropic 模型(例如 Claude Opus 4.6+ 和 Claude Fable/Mythos 类模型)的自适应思维(Adaptive Thinking)努力程度。更高的努力程度会为复杂问题分配更多的思维 token。

选项: "" (未设置/自动), "low", "medium", "high", "xhigh", "max"

默认值: "" (未设置 — 由模型决定)

示例:

preset:
  effort: 'high'

thinkingDisplay

支持: anthropic, bedrock (Anthropic 模型)

KeyTypeDescriptionExample
thinkingDisplayString控制是否在模型响应中返回推理内容。Claude Opus 4.7+ 及 Claude Fable/Mythos 类模型默认省略思考内容;此设置允许您选择加入推理摘要或显式禁止它们。

选项: "auto"(默认)、"summarized""omitted"

  • "auto" — LibreChat 决定:对于默认省略思考过程的模型(Opus 4.7+ 和 Fable/Mythos 级别),选择 "summarized",对于旧模型则不设置该字段。
  • "summarized" — 始终请求对推理过程进行事后总结
  • "omitted" — 始终抑制推理内容(延迟略低)

默认值: "auto"

示例:

preset:
  thinkingDisplay: 'summarized'

thinking

支持的平台: google, anthropic, bedrock (Anthropic 模型)

KeyTypeDescriptionExample
thinkingBoolean指示模型在生成响应前是否应花费时间进行思考。

默认值: true

示例:

preset:
  thinking: true

region

支持: bedrock
(用于指定 Amazon Bedrock 的 AWS 区域)

KeyTypeDescriptionExample
regionStringAmazon Bedrock endpoint 的 AWS 区域。

示例:

preset:
  region: 'us-east-1'

maxTokens

支持的端点: bedrock
(用于替代 max_tokens)

KeyTypeDescriptionExample
maxTokensNumberAmazon Bedrock endpoint 的最大输出 token 数。

示例:

preset:
  maxTokens: 1024

这篇指南怎么样?