Repository navigation
Studio: list each on-disk quant of a multi-quant GGUF in GET /v1/models - #13422
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 688916e1aa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| wanted = {m.strip() for m in (output_modalities or "").split(",")} | ||
| if not wanted & {"all", "decisions"}: | ||
| return {"object": "list", "data": await _openai_catalog_objects()} | ||
| return {"object": "list", "data": await _openai_catalog_objects(quant_pins = True)} |
There was a problem hiding this comment.
Update the existing zero-argument catalog test double
When openai_list_models is exercised by test_studio_lists_its_decision_models_only_when_asked, that existing test replaces _openai_catalog_objects with the zero-argument coroutine chat_catalog (studio/backend/tests/test_systemone_connections.py:509-511). Every non-decision listing now supplies quant_pins=True, so calls such as ids() and ids("text") raise TypeError: chat_catalog() got an unexpected keyword argument 'quant_pins' before their assertions, breaking the backend test suite; the test double must be updated as part of this signature change.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in f26caa8: the System One test double now accepts quant_pins (the test was not collected here without fastmcp; reproduced the TypeError after installing it).
| for mid in ("publisher/Qwen3:Q8_0", "publisher/Qwen3:Q4_K_M"): | ||
| assert _retrieve(mid) == rows[mid] |
There was a problem hiding this comment.
Freeze time before comparing separately generated model objects
This equality compares a row saved from one _listed() call with objects produced by later _retrieve() calls, while each path independently sets created = int(time.time()) in _openai_catalog_objects. If execution crosses a one-second boundary between those calls, the objects differ only in created and the test fails nondeterministically; freeze time.time() for this test or exclude the volatile field from the comparison.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in f26caa8: the cross-call comparison ignores created.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! 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". |
|
Nice — seeing every on-disk quant listed now. One gap we ran into while testing the new entries, though: the per-quant ids themselves don't load.
Either way, the 200-on-failed-load seems worth a look. (Context: hit while testing the scan-folder rewrite area of #13343 — unrelated to that change; the id passes through that rewrite untouched either way.) |
Fixes #9340
Problem
A model with several downloaded quants (the report: Q8_0 and Q4_K_M of one repo) appears once in
GET /v1/models, naming a singlequant. Chat completions already accept"model": "<repo>:<quant>", and since #12727GET /v1/models/<repo>:<quant>resolves too, but clients that only offer a dropdown built from/v1/models(Open WebUI style pickers) have no way to pick the other quant, and everyone else has to load the model in Studio first to learn the exact name.Change
GET /v1/modelsnow also lists<repo>:<quant>for every on-disk quant of a GGUF repo that has more than one, right after the repo's bare row:GET /v1/models/<repo>:<quant>uses, so retrieving a listed id returns the identical object. The resident quant's row isloaded: truewith its context fields; the others areloaded: falsewithout them..gguffiles, non-GGUF checkpoints and TTS / media rows are unchanged (the bare id already names them).GET /v1/models/{id}is untouched, as are the Studio chat picker,unsloth start(it reads/api/inference/loaded-models) and notebooks.Loading a quant other than the resident one still needs Settings > Model auto-switch > Switch model by request, as before.
Verification
Live Studio on a GPU (backend from main vs this branch, same install and llama-server, isolated HF cache holding
unsloth/SmolLM2-135M-Instruct-GGUFQ8_0 + Q4_K_M, auto-switch on), choosing each id straight from the listing:GET /v1/models(SmolLM2 rows)GGUF(quant Q4_K_M)GGUF,GGUF:Q4_K_M,GGUF:Q8_0GGUF:Q4_K_Mfrom the listGGUF:Q8_0from the listGET /v1/models/...GGUF:Q8_0reportsloaded: trueGGUFGET /v1/modelson the real catalog scan (in process, 200 calls after warmup, two interleaved rounds): main 5.8 / 4.5 ms median, this branch 5.2 / 4.7 ms, within noise.Tests: four new cases in
tests/test_openai_catalog.py(every quant listed after the bare row and retrievable as the same object, only the resident pin marked loaded, a pin the resolver would not honour is not listed, the index is built for pins only when it never was). The listing cases fail on main and pass here; the index case fails when the listing is pointed back at the rebuilding lookup. Across the 19 backend test files that touch/v1/models, the resolver or auto-switch (1600 tests), the failing test IDs are identical on main and this branch (28 pre-existing failures on this host, the same IDs on both).