dsh-model-caps
其他 活跃维护

dsh-model-caps

qingshanjiluo/dsh-model-caps

自动拉取上游 /models 接口数据,以可视化表单展示上下文窗口、最大输出和图像支持项,支持手动修正后覆盖保存,配置持久化并内置校验机制。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
27 KB
仓库大小
1 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:qingshanjiluo/dsh-model-caps
git clone https://github.com/qingshanjiluo/dsh-model-caps.git
git clone git@github.com:qingshanjiluo/dsh-model-caps.git
README.md main

dsh-model-caps

Fetch a provider's real /models list, review the capability fields it exposes
(context window, max output, image input), edit them on one page, then save them
back into llm-pi-ai.

Unlike catalog lookups that match a model name against a static table, this
plugin asks the configured upstream and shows only what the upstream actually
returned. Missing fields stay blank instead of being guessed, and vision support
can be proven by a real image probe.

Why

llm-pi-ai accepts contextWindow, maxTokens and input per model, but most
OpenAI-compatible gateways return only an id from GET /models. Filling those
fields by hand is error-prone, and name-based catalogs are wrong for private
routes. This plugin keeps a human in the loop: fetch, inspect, edit, save.

Install

dsh plugin --profile web add github:qingshanjiluo/dsh-model-caps

Then restart the profile, or let dsh-hotswap mount it when it is already
installed.

Use

  1. Open http://127.0.0.1:3080/model-caps/ in the same browser session as the
    Web UI (the cookie authenticates the page).
  2. Pick a provider. The list comes from llm-pi-ai.providers.
  3. Click Fetch upstream. The plugin calls GET {baseURL}/models with that
    provider's key from apiKeyEnv -> the credential store.
  4. Review the table. Fields sourced from the upstream payload are marked in the
    notes column; blank means the upstream did not expose it.
  5. Optionally select rows and click Probe vision: a 32x32 red/blue PNG is
    sent and a model counts as image-capable only when it answers with a colour.
  6. Edit any cell, then click Save. The plugin writes
    llm-pi-ai.providers.<id>.models through settings.mutate, preserving
    fields it did not touch.

Page file\n\nThe editor UI lives in dsh/model-caps.html and is read from disk on every request, so a UI change takes effect on refresh without restarting DSH.\n\n## Editor\n\nThe editor is a standalone page at /model-caps/, served from dsh/model-caps.html and read from disk on every request, so UI edits apply on refresh without restarting DSH. It is paginated (80 rows per page) and filters are debounced, so a 50+ model provider stays responsive.\n\n## Endpoints

Method Path Purpose
GET /model-caps/ The editor page
GET /model-caps/providers Configured providers, apiKeyEnv, model counts
POST /model-caps/fetch { provider } -> upstream rows merged with current config
POST /model-caps/vision { provider, ids } -> per-model image support
POST /model-caps/save { provider, rows } -> write the model list back

Parsed capability fields

The reader accepts the common spellings gateways use:

  • context: context_length, context_window, max_context_length,
    max_input_tokens, max_model_len, top_provider.context_length,
    limits.context
  • output: max_tokens, max_output_tokens, max_completion_tokens,
    top_provider.max_completion_tokens, limits.output
  • image input: architecture.input_modalities, input_modalities,
    modalities.input, capabilities.vision, supports_vision, vision

Safety

  • The page and endpoints live behind the same authentication fence as the Web
    UI; a request without a valid session is rejected.
  • The upstream is only contacted for the provider you select, and only when you
    press a button.
  • Saving replaces the model list of that one provider. Entries that were not on
    the upstream are shown marked and are dropped unless you keep them.
  • The API key never leaves the host: the browser talks to DSH, DSH talks to the
    provider.

License

MIT