feat(hub): enable Run/New Chat for downloaded GGUF models, fix README - #6152
Conversation
Sneakr
commented
Jun 10, 2026
- enable the Run / New Chat action for GGUF models that are already downloaded, across the download card, on-device card, and hub page
- remove the extra bottom spacing under the model inspector README
… bottom spacing - enable the Run / New Chat action for GGUF models that are already downloaded, across the download card, on-device card, and hub page - remove the extra bottom spacing under the model inspector README
There was a problem hiding this comment.
Code Review
This pull request integrates the chat model runtime into the Hub models page, replacing previous stubs with actual implementations for selecting, loading, and ejecting models. It also introduces a new feature flag HUB_GGUF_RUN_ACTIONS_VISIBLE to selectively enable run actions for GGUF models. The review feedback highlights two issues: a potential runtime error in non-secure contexts due to the use of crypto.randomUUID, and a layout inconsistency where a divider's visibility is still gated by the old feature flag instead of the new runActionsVisible variable.
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.
| const handleUseInChat = useCallback(() => { | ||
| void navigate({ to: "/chat" }); | ||
| void navigate({ to: "/chat", search: { new: crypto.randomUUID() } }); | ||
| }, [navigate]); |
There was a problem hiding this comment.
In non-secure contexts (such as accessing a self-hosted instance over HTTP), crypto.randomUUID is undefined, which will cause a runtime TypeError when clicking "Use in Chat". Adding a fallback ensures the application remains functional in all environments.
const handleUseInChat = useCallback(() => {
const uuid = typeof crypto !== "undefined" && crypto.randomUUID
? crypto.randomUUID()
: Math.random().toString(36).substring(2, 15);
void navigate({ to: "/chat", search: { new: uuid } });
}, [navigate]);
There was a problem hiding this comment.
crypto.randomUUID is polyfilled app-wide at startup in main.tsx for non-secure contexts, so this bare call is safe and matches the existing new-chat navigation in chat-page.tsx. No per-call fallback needed.
| className={cn( | ||
| "group/pair flex h-9 shrink-0 items-stretch gap-1.5", | ||
| !HUB_POST_DOWNLOAD_ACTIONS_VISIBLE && "hidden", | ||
| !runActionsVisible && "hidden", | ||
| )} |
There was a problem hiding this comment.
The divider above this container (at line 443) is still gated by HUB_POST_DOWNLOAD_ACTIONS_VISIBLE. Since runActionsVisible can be true (for GGUF models) while HUB_POST_DOWNLOAD_ACTIONS_VISIBLE is false, the divider will be hidden even when the Run/Train buttons are visible, leading to a layout inconsistency. Consider updating the divider's visibility condition to use runActionsVisible as well.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0a5464ec7
ℹ️ 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".
| if ( | ||
| !isExternalModelId(store.params.checkpoint) && | ||
| !modelIdsMatch(store.params.checkpoint, status.active_model) | ||
| ) { | ||
| store.setCheckpoint(status.active_model, status.gguf_variant ?? null); |
There was a problem hiding this comment.
Refresh active GGUF variant when model IDs match
When Hub opens while the backend is already running the same GGUF repo but a different quantization (for example after another tab switched variants), this guard skips setCheckpoint, so activeGgufVariant stays stale even though status.gguf_variant is authoritative. The Hub cards then mark the wrong variant as Loaded/Chat and can navigate the user into chat believing a different quantization is active; include a GGUF variant mismatch in this condition before skipping the status update.
Useful? React with 👍 / 👎.
💡 Codex Reviewunsloth/studio/frontend/src/features/hub/hub-page.tsx Lines 550 to 552 in 028e700 When a GGUF load is already in progress for one model, selecting a different downloaded GGUF makes ℹ️ 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". |

