dsh-model-meta-autofill: Automatically Completing Metadata for DSH Custom Vendor Models

Preface

In DSH’s plugin-based extension approach, when integrating custom providers, model entries often only have an ID. Without context length, output limits, display names, and input modalities, both UI presentation and capacity determination lack a proper foundation. dsh-model-meta-autofill addresses this scenario by filling known model metadata from the catalog into the llm-pi-ai settings section.

What This Is

dsh-model-meta-autofill is a DSH plugin that automatically pre-fills contextWindow, maxTokens, name, and input for custom provider models in the llm-pi-ai settings section. The default data source is the Model Metadata Registry from models.dev, and it also supports merging other catalog sources via sources.

The repository address is https://github.com/QJAG1024/dsh-model-meta-autofill. The owner clue in the materials is QJAG1024, with no explicitly declared maintainer. The license is MIT.

Data and Matching

  • Fetches catalog data from the models.dev Model Metadata Registry by default.
  • Bundles an offline index at build time, making it available offline.
  • Can refresh models.dev/api.json in real-time at startup; real-time refresh is enabled by default.
  • Each data source has independent failure isolation—a failure in one source does not affect other sources or the offline index.
  • Supports merging multiple catalog sources via sources, compatible with models.dev, PublicProviderConf names, or http(s) URLs.
  • Compatible with numeric or K/M suffix capacity field formats.
  • Compatible with model ID aliases such as exact match, lowercase, provider/ prefix stripping, and ~ variants.
  • Newly released or niche models not present in the catalog will not be guessed; only fields with catalog evidence are filled.

Write Behavior

  • The target settings section is fixed to llm-pi-ai.
  • The plugin listens for changes in the llm-pi-ai settings section and generates patches for missing fields.
  • Only fills missing fields without overwriting existing settings.
  • User-provided values always take priority, including modelOverrides.
  • Only processes provider routes that exist in the user settings layer; base-only providers are not materialized into user documents.
  • When the models list changes, the entire table is rewritten idempotently.
  • fillReasoning is a reserved toggle, disabled by default, and is currently always false.

Host Interface and Operation Entry Points

The plugin exposes host interfaces via ctx.modelMeta, including lookup, stats, refresh, and buildSectionPatch.

The settings page provides a “Model Metadata” section that supports:

  • Single-model “Fill”
  • “Fill All” entry point
  • “Display Name with Vendor Name” toggle
  • “Refresh”
  • “Fetch Gateway Models”

The plugin also provides a local loopback HTTP API:

GET /model-meta-autofill/api/status
GET /model-meta-autofill/api/models
POST /model-meta-autofill/api/apply
POST /model-meta-autofill/api/apply-all
POST /model-meta-autofill/api/discover
POST /model-meta-autofill/api/discover/add

“Fetch Gateway Models” uses the gateway’s OpenAI-compatible /models list endpoint; it is a separate path from llm-pi-ai’s discoverModels.

Installation and Activation

The plugin needs to be installed into the profile running dsh web, for example ~/.dsh/profiles/web. The runtime requires Node >=22.0.0.

Install using the plugin command:

dsh plugin --profile web add dsh-model-meta-autofill

When installing from source, first build locally, then install the tarball:

pnpm install
pnpm build
npm pack
dsh plugin --profile web add dsh-model-meta-autofill@<tarball path>

After installation, restart dsh web or reload the plugin on the corresponding management plane. On first run, if llm-pi-ai already has providers with models, the initial scan will perform a one-time fill.

Typical Usage

Operating from the Settings Page

After restarting, the “Model Metadata” section in the settings page provides:

  • “Fill”: Performs a fill for a single model.
  • “Fill All”: The batch entry point listed on the settings page.
  • “Display Name with Vendor Name”: Affects the formatting of filled display names.
  • “Refresh”: Refreshes catalog data.
  • “Fetch Gateway Models”: Fetches the gateway model list and adds them.

Using the Local Loopback API

The HTTP endpoints run on the local loopback and can be called directly with curl or from the browser console. Available endpoints are:

GET /model-meta-autofill/api/status
GET /model-meta-autofill/api/models
POST /model-meta-autofill/api/apply
POST /model-meta-autofill/api/apply-all
POST /model-meta-autofill/api/discover
POST /model-meta-autofill/api/discover/add

Maintaining Catalog Sources

sources supports merging multiple catalog sources and can include models.dev, PublicProviderConf names, or http(s) URLs.

If you need PublicProviderConf gateway spelling fallback:

pnpm gen:data aihubmix

And add aihubmix to sources.

To update the default bundled source:

pnpm gen:data
pnpm build

pnpm gen:data fetches the default source and normalizes it into src/data/{source}.json, while pnpm build repacks everything.

Applicable Scenarios and Considerations

Suitable for developers using custom provider models in DSH: when model entries only have IDs and need contextWindow, maxTokens, name, and input supplemented from catalogs like models.dev, this plugin reduces manual maintenance effort.

Before use, note:

  • The plugin runs with the current dsh process permissions; review the source code and license before installation.
  • The target settings section is fixed to llm-pi-ai.
  • Only fields with catalog evidence are filled; newly released or niche models not present in the catalog will not be guessed.
  • User-provided values take priority, including modelOverrides.
  • fillReasoning is currently always false and should not be treated as a usable toggle.
  • Do not treat the plugin directory as an official app store; installation objects are determined by the repository and the packages pointed to by commands.

Related Links

  • GitHub: https://github.com/QJAG1024/dsh-model-meta-autofill
  • models.dev: https://models.dev/
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye