Repository navigation
Studio: fix structured columns in Data Recipes on non-GGUF models - #11049
Conversation
…ns on GGUF models
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. |
Review + reproduction evidencePinned review: Real Studio run (Modal L4, Chromium 1440×900). Same 3-record test run, pasted through Recipe Studio's import, with an
GitHub Actions A/B (fresh
Full CI on a fork (fresh Conclusion: the structured-column failure on non-GGUF models and its fix are verified end to end, and the GGUF grammar path is unchanged. |
|
Confirmed this hits studio/backend/routes/data_recipe/jobs.py where the structured response_format is injected even when the loaded model is not served by llama.cpp, which drops the whole recipe output on safetensors models. Will get this reviewed. |
…oute's refusal Follow-up to the recipe structured-column fix on the same branch. The gate was threaded out of _loaded_local_model_identity and _ensure_selected_local_model_loaded as a fourth tuple member and a return value, which left an "ensure" helper reporting the backend kind and a four-member tuple whose two booleans sit at opposite ends. _inject_local_providers is synchronous with no await between the model-loaded check and the injection, and get_llama_cpp_backend is a module-global accessor, so reading is_loaded again at the injection site cannot disagree with the first read. Both original signatures are restored, which also makes the existing _ensure_selected_local_model_loaded stub in test_job_accounts.py correct again. The comment above the gate now says why a non-GGUF backend is excluded and what it falls back to, rather than only describing the injection the called function already documents. Adds a test asserting that the payload the GGUF path injects is exactly what the local /v1 route refuses without llama.cpp, so teaching the safetensors/MLX backend guided decoding fails here instead of leaving recipes asking it for prompt-level JSON. The non-GGUF test now compares whole columns rather than aliases, since output_format is what that prompt-level schema is built from, and the schema constant is deep-copied into the recipe so it stays a pristine expectation against an injector that forwards it by reference.
|
Pushed Production. The gate was threaded out of The comment above the gate now says why a non-GGUF backend is excluded and what it falls back to, instead of only restating the injection the called function already documents. Tests. Added one: the payload the GGUF path injects is exactly what the local The non-GGUF test compares whole columns rather than aliases, since Validation. Every added assertion was mutation-checked in both directions: forcing the gate on fails only the non-GGUF test, forcing it off fails the GGUF test and the new route test, and making One note for reviewers on the approach rather than the code: #10611 solved the same problem for Deep Research by sending |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d020671a07
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 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". |
Lyxot
left a comment
There was a problem hiding this comment.
Approving. Real bug, right fix, and the gate mirrors the condition /v1 itself dispatches on (using_gguf = llama_backend.is_loaded), so the two cannot drift apart.
Re-verified against today's main (f70af706b1): merges clean, the merged result is exactly the two files, and the refusal the gate exists to avoid is still there. Tests pass on the merged tree, and the gate mutation-checks on it — forcing the gate on fails the non-GGUF test and nothing else. A staging CI run of the rebased change was green on every job covering this code, including the backend shard that runs the new test.
The fallback is not a hope: data_designer's StructuredResponseRecipe always emits the JSON-fence instruction and the schema in <response_schema> tags regardless of response_format, llm-judge columns already run that way on every backend including GGUF, and the default max_conversation_restarts=5 retries a parse miss.
Disclosure: I pushed the follow-up commit d020671a07 to this branch, so this is not a fully independent approval of every line. The original fix is @NilayYadav's.
Note for whoever merges: the red jobs are not from this PR. test_no_test_file_spawns_powershell_directly fails on a clean main today, and the Core zoo failures are in unsloth-zoo at its pinned commit, a repository this change does not touch. Both preset-sheet and multi-account failures seen earlier have since been fixed on main.
…slothai#11049) * Studio: only send grammar response_format for recipe structured columns on GGUF models * Studio: read the GGUF gate at the injection site, and tie it to the route's refusal Follow-up to the recipe structured-column fix on the same branch. The gate was threaded out of _loaded_local_model_identity and _ensure_selected_local_model_loaded as a fourth tuple member and a return value, which left an "ensure" helper reporting the backend kind and a four-member tuple whose two booleans sit at opposite ends. _inject_local_providers is synchronous with no await between the model-loaded check and the injection, and get_llama_cpp_backend is a module-global accessor, so reading is_loaded again at the injection site cannot disagree with the first read. Both original signatures are restored, which also makes the existing _ensure_selected_local_model_loaded stub in test_job_accounts.py correct again. The comment above the gate now says why a non-GGUF backend is excluded and what it falls back to, rather than only describing the injection the called function already documents. Adds a test asserting that the payload the GGUF path injects is exactly what the local /v1 route refuses without llama.cpp, so teaching the safetensors/MLX backend guided decoding fails here instead of leaving recipes asking it for prompt-level JSON. The non-GGUF test now compares whole columns rather than aliases, since output_format is what that prompt-level schema is built from, and the schema constant is deep-copied into the recipe so it stays a pristine expectation against an injector that forwards it by reference. --------- Co-authored-by: Lyxot <[email protected]>

A recipe with a structured column failed on every row when the Chat model was not a GGUF, for example a safetensors model. The run ended with "Dataset is empty" and the good text columns were lost too. This started after #9262.
Recipes now only ask for strict JSON output when the model runs on llama.cpp (GGUF). Other models go back to asking for JSON in the prompt, which is how it worked before #9262. #10611 made the same kind of fix for Deep Research.
With a 3 row recipe on Qwen3-0.6B (safetensors), main failed with "Dataset is empty" and this change completes with values like {"name":"Riverside","score":8}. The GGUF model and a recipe without a structured column still work. Added a unit test that fails on main.