Skip to content
TheChatArchiveThe Chat Archive
DeepSeekdeepseek/deepseek-v4-pro· deepseekHugging 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`.

    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. DeepSeek Assistant

    Let me start by exploring the repository structure to understand the codebase and then work on the issue.

    The issue is about modifying the /v1/models endpoint to:

    1. By default, return the whole catalog (one entry per model id), each annotated with available and unavailable_reason.
    2. Add an opt-in filter ?available=true (alias ?connected=true) to return only connected models.
    3. The auto virtual model is always available: true.
    4. Dedup: prefer an available instance over a disabled/keyless one.

    Let me explore the repository first.

  3. DeepSeek Assistant

    This looks like a Node.js/TypeScript project. Let me explore the server directory since that's likely where the API endpoints are defined.

  4. DeepSeek Assistant

    Let me find the /v1/models endpoint definition:

  5. DeepSeek Assistant

    Let me look at the models route and the app configuration

  6. DeepSeek Assistant

    I need to make one command at a time. Let me start by reading the models route.

  7. DeepSeek Assistant

    Now let me look at the database schema and understand how models and keys work

  8. DeepSeek Assistant

    Let me check the app.ts and see how the models router is used:

  9. DeepSeek Assistant

    Let me check the proxy routes to see if /v1/models is handled there

  10. DeepSeek Assistant

    Now let me check the shared types to understand the ModelList

  11. DeepSeek Assistant

    Let me check if there are tests related to the models endpoint:

  12. DeepSeek Assistant

    Let me check the proxy test files for models endpoint tests:

  13. DeepSeek Assistant

    Let me look at the proxy-auto-model test:

  14. DeepSeek Assistant

    Now I have a good understanding of the codebase. Let me open the proxy.ts file to the /v1/models endpoint

  15. DeepSeek Assistant

    Now I'll implement the changes. Let me edit the /v1/models endpoint in proxy.ts

  16. DeepSeek Assistant

    Let me check if the ModelListRow import is still used elsewhere in the file

  17. DeepSeek Assistant

    The ModelListRow import is no longer used. Let me remove it

  18. DeepSeek Assistant

    Let me verify the final state of the endpoint:

  19. DeepSeek Assistant

    Now let me run the existing tests to make sure they pass

  20. DeepSeek Assistant

    All tests pass. Let me also run the broader test suite to check nothing else is

  21. DeepSeek Assistant

    All 456 tests pass. Let me now create a simple test script to manually verify the new behavior is correct

  22. DeepSeek Assistant

    Let me check if ModelListRow is used elsewhere

  23. DeepSeek Assistant

    Let me verify the git diff to confirm all changes

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