Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-sonnet-5· anthropicHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION /v1/models: return the full catalog with per-model availability +…

  1. User

    ISSUE DESCRIPTION

    /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.

    ADDITIONAL ADVICE

    Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use git checkout <file> to restore the file to its original state. You can also reset all changes in the repository using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to get the changes that need to be submitted.

    CHECKLIST

    Before submitting your solution, please go over the following checklist and make sure you've done everything:

    • If an error was reported in the issue description, I have successfully reproduced it.
    • If an error was reported in the issue description, I have confirmed that my fix resolves the error.
    • I have thought about edge cases and made sure my fix handles them as well.
    • I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.

    Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!

    (Current directory: /freellmapi, current file: none) bash-$

  2. Claude Assistant

    Now let's check the existing test file for the proxy models endpoint to understand expected format conventions.

  3. Claude Assistant

    Now let's update the shared types and the route.

  4. Claude Assistant

    Let's use the replace command instead.

  5. Claude Assistant

    Now let's update the route in proxy.ts.

  6. Claude Assistant

    Now let's check the models table schema for enabled, key_id columns to make sure query is correct.

  7. Claude Assistant

    Good, key_id exists via migration. Now let's build and run the tests.

  8. Claude Assistant

    Tests pass. Now let's write a quick manual reproduction script to verify the new behavior including filter and dedup logic.

  9. Claude Assistant

    This works as expected. Let's clean up the temp test and run the full test suite to make sure nothing else is broken.

  10. Claude Assistant

    All 456 tests pass. Now let's also check the client side (dashboard) that might consume /v1/models, and check README for doc updates mentioning the endpoint behavior.

  11. Claude Assistant

    Those are unrelated (referring to upstream provider APIs, not our own endpoint). No changes needed there.

    Now let's double check the diff of all changes.

  12. Claude Assistant

    This looks good. Let's also run a TypeScript build check to ensure types compile correctly.

  13. Claude Assistant

    No compile errors. Let's also check the client build for any TS usages of ModelListRow, and run client type check if relevant.

  14. Claude Assistant

    No usages in client. Now let's finalize by running full test suite once more (already did) and review checklist.

  15. Claude Assistant

    Everything looks clean. Let me review the checklist:

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