From 200c02c0663b4f25e4d4bd423f99a08bc8d888bb Mon Sep 17 00:00:00 2001 From: Albert-Atomic Date: Mon, 22 Jun 2026 16:46:46 +0500 Subject: [PATCH] feat(providers): add optional supports_model_listing flag --- README.md | 21 +++++++++++++++++++++ providers/schema.json | 5 +++++ 2 files changed, 26 insertions(+) diff --git a/README.md b/README.md index 6428936..2e139ad 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,27 @@ The same as above, but you add a whole provider object to the top-level If your provider needs extra HTTP headers (Anthropic does, for example), use the optional `custom_header` array. +### Controlling live model listing (`supports_model_listing`) + +The client's **Refresh (↻)** button on a provider page is hybrid: it merges +this curated registry list with whatever the provider returns from a live +`GET /v1/models`, deduped by id. This is what lets custom / self-hosted +providers (vLLM, llama.cpp, LM Studio, …) surface their real model ids. + +For a few clouds the live `/v1/models` endpoint returns hundreds of +junk/internal ids that would pollute the picker. To opt such a provider out of +the live probe, set the optional boolean: + +```json +"supports_model_listing": false +``` + +- `true` (or the field omitted) → registry list ∪ live `/v1/models` (default). +- `false` → curated registry list only; the client never calls `/v1/models`. + +This is backwards-compatible — older clients simply ignore the field — so it +does **not** require a `schema_version` bump. + ## Capabilities The `capabilities` array on each model uses these values: diff --git a/providers/schema.json b/providers/schema.json index 59ecaa4..f03aaf3 100644 --- a/providers/schema.json +++ b/providers/schema.json @@ -41,6 +41,11 @@ "pattern": "^[a-z0-9_-]+$", "description": "Stable, unique provider id. Lowercase, no spaces." }, + "supports_model_listing": { + "type": "boolean", + "default": true, + "description": "Controls the client's Refresh (\u21bb) button. true or absent: show the curated registry list UNION the provider's live GET /v1/models. false: show the curated registry list only and skip the live probe (use when /v1/models returns hundreds of junk/internal model ids)." + }, "settings": { "type": "array", "items": { "$ref": "#/definitions/providerSetting" }