Skip to content
TheChatArchiveThe Chat Archive
composer-2.5· unknownHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

/v1/models: return the full catalog with per-model availability + opt-in filter Split…

  1. User

    /v1/models: return the full catalog with per-model availability + opt-in filter Split out from #242.

    Current: `GET /v1/models` returns only models that are connected right now (enabled AND an enabled key can serve them).

    Wanted: by default return the whole catalog (one entry per model id), each annotated with whether it's usable, plus an opt-in filter to get just the connected ones.

    Per-model annotation:

    • `available`: boolean — enabled AND a matching enabled key exists.
    • `unavailable_reason`: `null` | `"no_key"` (enabled, no key) | `"disabled"` (catalog row disabled).

    Filter:

    • `?available=true` (alias `?connected=true`) → only connected models (the previous default behavior).

    Notes:

    • The extra fields are additive — OpenAI-compatible clients ignore unknown fields.
    • Dedup prefers an available instance of a model id over a disabled/keyless one.
    • The `auto` virtual model is always `available: true`.

    Interface

    No new interfaces are introduced.

  2. Assistant

    I'll locate the current /v1/models implementation and how model availability is determined.

  3. Assistant

    Implementing the endpoint change and tests.

  4. Assistant

    GET /v1/models now returns the full catalog with per-model availability, and connected-only listing is opt-in.

    Behavior

    Default — one entry per model_id (deduped), plus auto first:

    • available: true when the row is enabled and a matching enabled key exists
    • unavailable_reason: null | "no_key" | "disabled"
    • Dedup prefers an available row over disabled/keyless duplicates (same intelligence_rank tie-break as before)

    Filter — ?available=true or ?connected=true restores the old behavior (only connected models)

    auto — always available: true, unavailable_reason: null

    Changes

    1. server/src/routes/proxy.ts — rewrote the /models handler with a CTE-style query that annotates availability and supports the filter
    2. shared/types.ts — extended ModelListRow with available and unavailable_reason
    3. server/src/__tests__/routes/proxy-models-catalog.test.ts — tests for full catalog, filter/alias, dedup preference, and uniqueness

    All 10 related tests pass.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.