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 implementing the changes described in the issue.

  3. DeepSeek Assistant

    That doesn't seem right. Let me look more broadly.

  4. DeepSeek Assistant

    This looks like a TypeScript/JavaScript project, not Python. Let me explore the server directory.

  5. DeepSeek Assistant

    It's a TypeScript project. Let me explore the server/src directory.

  6. DeepSeek Assistant

    Let me look at the relevant files. The issue is about GET /v1/models.

  7. DeepSeek Assistant

    The open command doesn't work. Let me use bash to read the file.

  8. DeepSeek Assistant

    Let me understand the database schema and the current behavior

  9. DeepSeek Assistant

    Let me look at the migrations to understand the schema:

  10. DeepSeek Assistant

    Let me look at the providers and the test files for models

  11. DeepSeek Assistant

    Now let's check the existing tests for models:

  12. DeepSeek Assistant

    Let me search for model-related test files and the app.ts to understand routing

  13. DeepSeek Assistant

    Let me look at the app.ts to see how the models router is mounted:

  14. DeepSeek Assistant

    Let me check the proxy router - the models endpoint for /v1/models might be there:

  15. DeepSeek Assistant

    Let me check the shared types to understand the ModelListRow

  16. DeepSeek Assistant

    Now let me look at the router service to understand what information it provides about model availability:

  17. DeepSeek Assistant

    Let me first run the existing tests to establish a baseline:

  18. DeepSeek Assistant

    Let me try running the tests. But first, let me check the vitest config:

  19. DeepSeek Assistant

    All 456 tests pass. Now let me write a reproduce script to understand the current behavior:

  20. DeepSeek Assistant

    Let me write the test script inside the repo instead

  21. DeepSeek Assistant

    Good, I can see the current behavior clearly. Now let me implement the changes. Let me start by modifying the /v1/models endpoint in proxy.ts:

  22. DeepSeek Assistant

    Let me see the exact lines to replace. Let me read lines 121-192 of proxy.ts:

  23. DeepSeek Assistant

    Now let me modify the /v1/models handler in proxy.ts. I'll use the edit command with a heredoc:

  24. DeepSeek Assistant

    Let me verify the patch was applied correctly:

  25. DeepSeek Assistant

    Now let me check if ModelListRow type is still used elsewhere - since we no longer use it in proxy

  26. DeepSeek Assistant

    Let me clean up the unused import and run the test:

  27. DeepSeek Assistant

    Now let me run the test to verify the changes:

  28. DeepSeek Assistant

    The changes are working correctly. Let me now run the full test suite:

  29. DeepSeek Assistant

    All 456 tests pass. Let me clean up the

  30. DeepSeek Assistant

    Let me check if keyless providers have sentinel keys in the database:

  31. DeepSeek Assistant

    Let me verify the import cleanup was successful

  32. DeepSeek Assistant

    Let me also write a quick test to simulate having keys and verify the available filtering works properly

  33. DeepSeek Assistant

    The implementation is working correctly. Let me clean up the test file and run the full test suite one final time:

  34. DeepSeek Assistant

    Let me verify the final state of my changes:

  35. DeepSeek Assistant

    Let me run the full test suite one final time to confirm everything

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