Repository navigation
fix(studio): accept trailing slash for model discovery - #9876
Conversation
|
Confirmed that on main a GET to /v1/models/ falls through to the retrieve route at studio/backend/routes/inference.py:22411 and comes back empty rather than listing the catalog, so the alias does fix a real discovery failure. Note the redirect described in the summary is not what happens here; will get this reviewed. |
|
@codex review |
mahiatlinux
left a comment
There was a problem hiding this comment.
LGTM, reviewed the changes. Does what it needs to do.
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
/v1/models/as a direct compatibility alias for/v1/modelsWhy
DEVONthink probes
GET /v1/models/when configuring an OpenAI-compatible provider. Without an explicit collection route for the trailing-slash form, the existing/models/{model_id:path}catch-all consumes the empty path segment and returns an authenticated404 model_not_foundresponse instead of the model catalog.Registering
/v1/models/directly makes that request return the same OpenAI-compatible catalog as/v1/models.DEVONthink documents the required discovery endpoint here: https://discourse.devontechnologies.com/t/how-to-use-an-api-gateway/84925/5
Validation
python3 -m py_compile studio/backend/routes/inference.py studio/backend/tests/test_openai_auto_switch.pyget_current_subjectdependency via ASTgit diff --check