Configure models

This guide assumes you started the Web UI through the root README. Model changes take effect on the next request without restarting the server.

Configure DeepSeek

Open Settings → Models. The DeepSeek card exposes one API-key field; enter the key and save it.

The Models page: the DeepSeek card, with Add provider and Add a custom provider below it

Keys are write-only. The page receives a redacted descriptor after saving, never the literal secret. The key is stored in $DSH_HOME/.credentials.yaml, while settings retain only its credential reference.

Add a catalog provider

Choose Add provider, select a provider such as Anthropic or OpenAI, enter its API key, and save. The installed catalog supplies the endpoint, protocol, and model list.

Providers with native authentication need their native credentials instead. Bedrock, Vertex, Azure, and Codex use AWS credentials and a region, an ADC project, an api-version, and OAuth respectively; filling only the API-key field does not configure them.

Add a custom provider

Choose Add a custom provider for a company gateway, self-hosted server, or provider absent from the installed catalog. Supply a lowercase Provider ID, base URL, API protocol, credential, and at least one model.

The custom provider form: Provider ID, display name, base URL, API protocol, and API key

The Provider ID is permanent because requests, saved sessions, model defaults, and credential references use it. To rename a provider, add a new provider and delete the old one. The display name, base URL, protocol, credential, and models remain editable.

Under Model catalog, choose Fetch available models to query the base URL and credential currently shown in the form. Selecting candidates updates the draft; the provider is not stored until you save. Catalog providers use their installed catalog without a network request.

Image input

A model you enter by hand is treated as text-only until it says otherwise, because nothing can ask an endpoint which modalities it accepts. Attaching an image to such a model is refused before it is sent, naming the model.

A vision model on a custom provider therefore needs one line. The form has no field for it; add input to the model in $DSH_HOME/settings.yaml:

llm-pi-ai:
  providers:
    my-gateway:
      apiKeyEnv: GATEWAY_API_KEY
      api: openai-completions
      baseURL: https://gateway.example/v1
      models:
        - id: legacy-chat
        - id: vision-preview
          input: [text, image]

input accepts text and image, and applies to that model alone, so one route can serve both kinds. Omitting it — or writing an empty list, which means the same thing — keeps whatever the installed catalog records for that model, and falls back to the route's defaultInput for a model the catalog does not describe.

If every model you entered by hand takes images, set the fallback once on the route instead of on each of them:

llm-pi-ai:
  providers:
    vision-gateway:
      apiKeyEnv: GATEWAY_API_KEY
      api: openai-completions
      baseURL: https://vision.example/v1
      defaultInput: [text, image]
      models:
        - id: first-model
        - id: second-model

defaultInput is a fallback, not an override, and defaults to [text]: on a catalog provider it answers only for models the catalog does not describe, so it never removes images from a catalog model that has them. Narrow one of those with that model's own input. A catalog provider has no models list to put it in, so write it under modelOverrides, keyed by model id:

llm-pi-ai:
  providers:
    anthropic:
      modelOverrides:
        claude-sonnet-4-5:
          input: [text]

Every list must name at least one modality except a model's own, where an empty list means the same as omitting it. An unknown modality is refused wherever it is written.

Both fields state a claim about your endpoint rather than checking it. A model that declares images its endpoint does not serve is not caught here; the provider rejects the request instead.

Select a model

Configured providers appear in the model picker. Selecting a model also makes it the default for new sessions. A session that has already sent a request retains the model recorded in its own log.

If a saved default names a provider that was deleted, the composer displays Select model and blocks input until another model is selected.

Troubleshooting

  • MISSING_CREDENTIAL — Store the provider key through the Models page or supply the referenced environment variable.
  • UNKNOWN_MODEL — Select a configured model or add the missing model to the custom provider.
  • Fetching available models returns 401 — Check the key. Model discovery calls the OpenAI-compatible GET /models endpoint; enter models manually for endpoints that do not provide it.
  • An image is refused before sending — The model declares no image modality. Give a custom provider's model input: [text, image]; DeepSeek's own chat-completions route is text-only and cannot be configured otherwise.
  • The provider rejects a request carrying an image — The model declares images its endpoint does not actually serve. Remove image from whichever list granted it — the model's input, or the route's defaultInput — then start a new session: the attached image stays in the session log, so the same request repeats until the session moves off it.

Advanced configuration

The generated plugin configuration catalog lists every supported field and default. The dsh-llm-pi-ai and dsh-llm-deepseek references own direct settings.yaml configuration, catalog resolution, reasoning controls, credentials, and adapter errors.

配置模型

本指南假定你已按照根 README启动 Web UI。模型变更会在下一次请求时生效,不需要重启服务器。

配置 DeepSeek

打开设置 → 模型。DeepSeek 卡片提供一个 API 密钥字段;输入密钥并保存。

模型页:DeepSeek 卡片,以及添加提供方与添加自定义提供方两个入口

密钥是只写的。保存后,页面只会收到脱敏描述符,永远不会收到明文密钥。密钥存储在 $DSH_HOME/.credentials.yaml 中,settings 只保留它的凭据引用。

添加目录提供方

选择添加提供方,选取 Anthropic 或 OpenAI 等提供方,输入其 API 密钥并保存。已安装目录会提供端点、协议和模型列表。

使用原生认证的提供方需要各自的原生凭据。Bedrock、Vertex、Azure 和 Codex 分别使用 AWS 凭据与区域、ADC 项目、api-version 和 OAuth;只填写 API 密钥字段无法完成配置。

添加自定义提供方

对于公司网关、自建服务器或已安装目录中不存在的提供方,选择添加自定义提供方。提供小写 Provider ID、基础 URL、API 协议、凭据和至少一个模型。

自定义提供方表单:Provider ID、显示名称、API 地址、API 协议、API 密钥

Provider ID 是永久的,因为请求、已保存会话、模型默认值和凭据引用都会使用它。如需重命名提供方,请添加新提供方并删除旧提供方。显示名称、基础 URL、协议、凭据和模型仍可编辑。

模型目录中选择获取可用模型,可查询表单当前显示的基础 URL 和凭据。选择候选项只会更新草稿;保存前不会存储提供方。目录提供方使用已安装目录,不发起网络请求。

图片输入

手动输入的模型在自己声明之前一律按纯文本对待,因为没有任何环节能去询问端点接受哪些模态。给这类模型附加图片,会在发送前就被拒绝,并点名该模型。

因此自定义提供方下的视觉模型需要加一行。表单没有对应字段;请在 $DSH_HOME/settings.yaml 中给该模型加上 input

llm-pi-ai:
  providers:
    my-gateway:
      apiKeyEnv: GATEWAY_API_KEY
      api: openai-completions
      baseURL: https://gateway.example/v1
      models:
        - id: legacy-chat
        - id: vision-preview
          input: [text, image]

input 接受 textimage,且只作用于该模型,因此一条路由可以同时服务两类模型。省略它——或写成空列表,两者同义——则保留已安装目录为该模型记录的模态;目录未描述的模型则回退到该路由的 defaultInput

如果你手动录入的模型全都接受图片,可以在路由上设置一次回退值,不必逐个模型写:

llm-pi-ai:
  providers:
    vision-gateway:
      apiKeyEnv: GATEWAY_API_KEY
      api: openai-completions
      baseURL: https://vision.example/v1
      defaultInput: [text, image]
      models:
        - id: first-model
        - id: second-model

defaultInput 是回退值而不是覆盖值,默认为 [text]:在目录提供方上,它只为目录未描述的模型作答,因此绝不会把目录中本就具备图片能力的模型的该能力去掉。要收窄这类模型,请用它自己的 input。目录提供方没有可供填写的 models 列表,因此写在 modelOverrides 下,以模型 id 为键:

llm-pi-ai:
  providers:
    anthropic:
      modelOverrides:
        claude-sonnet-4-5:
          input: [text]

除模型自身的列表外,每个列表都至少要写一项模态;模型自身的空列表与省略它同义。未知模态在任何位置写入都会被拒绝。

这两个字段都是对你端点的断言,而不是对它的检查。声明了端点并不提供的图片能力的模型不会在这里被拦下,改由提供方拒绝该请求。

选择模型

已配置的提供方会出现在模型选择器中。选择模型也会将其设为新会话的默认值。已发送过请求的会话会保留自身日志中记录的模型。

如果已保存默认值指向已删除的提供方,输入框会显示选择模型,并在选择其他模型前阻止输入。

排错

  • MISSING_CREDENTIAL:通过模型页存储提供方密钥,或提供被引用的环境变量。
  • UNKNOWN_MODEL:选择已配置的模型,或向自定义提供方添加缺失的模型。
  • 获取可用模型返回 401:检查密钥。模型发现会调用 OpenAI 兼容的 GET /models 端点;对于不提供该端点的服务,请手动输入模型。
  • 图片在发送前被拒绝:该模型未声明图片模态。请给自定义提供方的模型加上 input: [text, image];DeepSeek 自身的 chat-completions 路由是纯文本的,且无法通过配置改变。
  • 提供方拒绝了带图片的请求:该模型声明了其端点实际并不提供的图片能力。请从授予它图片能力的那个列表中移除 image——可能是模型的 input,也可能是路由的 defaultInput——然后开启新会话:附加的图片会留在会话日志里,因此在会话离开它之前,同一个请求会不断重复。

进阶配置

自动生成的插件配置目录列出所有受支持的字段与默认值。dsh-llm-pi-aidsh-llm-deepseek 参考文档负责直接 settings.yaml 配置、目录解析、推理控制、凭据与适配器错误。