Fix GGUF variant file selection#6342
Conversation
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Code Review
This pull request refactors GGUF variant file resolution in the backend to prefer exact quant-label matches over loose substring matches, preventing incorrect resolution (such as matching big-endian variants). It also updates the frontend to filter out big-endian GGUF files during the auto-load process. The review feedback suggests enhancing runtime safety by wrapping the backend's quant-label extraction in a try-except block and adding defensive null/undefined checks for the variant filename in the frontend.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a helper function _gguf_files_for_variant in the backend to resolve GGUF files matching a requested variant, preferring exact quant-label matches, and adds corresponding tests. In the frontend, it prevents auto-loading big-endian GGUF files by introducing a helper function isAutoLoadableGgufVariant with a regular expression check. The review feedback suggests improving this regular expression to also support underscores as separators (e.g., _be), ensuring more robust detection of big-endian variants.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b38c946cce
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 896da65d1f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97e39ab82b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Add entries for PRs unslothai#5894, unslothai#6357, and unslothai#6342 to the cherry-pick session handoff.
This reverts commit 6b1a736.
The TestGgufVariantFileResolution class exercises upstream's _is_big_endian_gguf_path filter (PR unslothai#6342, commit 6b1a736) which was deliberately reverted in our fork via 3bb9cf8 ('Revert "Fix GGUF variant file selection (unslothai#6342)"'). Marking strict xfail so: - CI does not flag these as regressions after the upstream merge - Tests still run and report xfail (not silently skipped) - Rationale and revert commit are documented inline for future revisit If the revert rationale is reconsidered and the filter is re-applied, remove this xfail marker to re-enable the tests.
Summary
Fix GGUF variant resolution so a request for stories260K picks the matching little endian file.
Skip big endian GGUF files during automatic chat model selection.
Add regression coverage for the tinyllamas cache shape that failed Studio UI CI.
Test plan
Python compile for changed backend files.
Ruff check for changed backend files.
Backend GGUF fallback tests passed.
Backend cached GGUF route tests passed.
Frontend typecheck passed.
Diff whitespace check passed.