sub2api icon indicating copy to clipboard operation
sub2api copied to clipboard

[Feature] Group-level "additional listed models" so all-passthrough groups can advertise models newer than the built-in list

Open HuntercodeT opened this issue 2 months ago • 0 comments

Summary

Add a group-level "additional listed models" setting: a list of model IDs that is merged into the group's model-listing source for GET /v1/models and the generated Codex catalog. Admins could then advertise a newly released model without waiting for openai.DefaultModels to be updated in a release.

Motivation: groups whose OpenAI accounts are all passthrough

With #7526, a group that mixes passthrough and ordinary accounts can advertise a new model by mapping it on an ordinary account: the mapping keys are merged with the default set. One case is still left uncovered: every OpenAI account in the group has openai_passthrough=true.

  • Passthrough routing ignores model_mapping, so there is nothing account-side that can declare an extra model. GetAvailableModels falls back to nil, and the listing is exactly the compiled-in openai.DefaultModels.
  • The group model_allowlist can't help either: FilterForListing only filters the source and never adds to it. That is intentional, because allowlists are usually much broader than what the pool can serve (see the correction in #7517).
  • Meanwhile these groups can already serve the new model: passthrough forwards any model name upstream.

This is common in practice. In our deployment, 15 of 44 groups that contain OpenAI accounts are all-passthrough (24 accounts in total).

Surfaces affected, based on reading v0.2.7 / main:

Surface All-passthrough openai group All-passthrough composite group
GET /v1/models (Cherry Studio, OpenCode, generic OpenAI SDK clients, …) ❌ defaults only ❌ defaults only for the OpenAI part
Codex catalog GET /v1/models?client_version=… ✅ uses the live upstream manifest (OpenAIGatewayHandler.CodexModels) ❌ generated from the static source (GatewayHandler.CodexModels)

Concrete case: gpt-6-sol / gpt-6-luna became routable on 2026-09-23, but in these groups they stay invisible to non-Codex clients until #7509 is released and deployed.

Proposal

A new group field, e.g. extra_listed_models: string[] (name open to suggestions):

  1. Listing only. Merge it into the listing source used by /v1/models and the generated Codex catalog (codexModelIDsForGroup / compositeAvailableModels / modelListingSource), before the allowlist filter. The allowlist keeps its current role: if it is enabled, extra models must also pass it.
  2. No routing or admission change. It does not make a model routable. Admission still goes through the allowlist and IsModelSupported as today; for passthrough accounts, that already accepts any name.
  3. Codex catalog constraints still apply. FilterCodexModelIDsForGroup still strips media-generation models and wildcards. Unknown slugs get the existing fail-closed text-only descriptor, so no capabilities are invented.
  4. Validation. Exact IDs only (no *), trimmed and deduped case-insensitively, capped at a reasonable length.
  5. Admin UI. A tag input next to the model allowlist in the group editor, e.g. "Additional models to advertise (not in the built-in list)".

Alternative considered

Have plain /v1/models for OpenAI groups reuse the live upstream catalog, the same way the Codex path already does. This is what #6647 asks for. It needs no new field, but it makes every listing call depend on an upstream round-trip (see #5252 for the failure modes). It also doesn't help composite groups or upstreams without a usable /models. An explicit field is simpler and predictable, and the two approaches aren't mutually exclusive.

Related

  • #7526: passthrough accounts no longer hide ordinary accounts' mappings (covers mixed groups)
  • #6647: passthrough /v1/models falls back to built-in defaults
  • #7517: allowlist exact entries are not listed (withdrawn in favor of #7526; shows why the allowlist shouldn't be the source)
  • #1867: request for a model template so new models don't require per-account updates
  • #7509: adds gpt-6-sol / gpt-6-luna to openai.DefaultModels

If this direction looks acceptable, I'm happy to implement it (migration + DTO + service merge + group editor UI + tests).

HuntercodeT avatar Sep 23 '26 05:09 HuntercodeT