Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio Hub: Newest and Recently updated list more than Unsloth models under Recommended (#13632)

Daniel Han92da93331c1b
diff --git a/studio/frontend/src/features/hub/hooks/use-discover-search.ts b/studio/frontend/src/features/hub/hooks/use-discover-search.ts
index 53300e6397e..d2f6c63022d 100644
--- a/studio/frontend/src/features/hub/hooks/use-discover-search.ts
+++ b/studio/frontend/src/features/hub/hooks/use-discover-search.ts
@@ -104,6 +104,7 @@ export function useDiscoverSearch({
direction,
channel,
ownerScope,
+ listingTags,
filters,
task,
}: {
@@ -115,6 +116,7 @@ export function useDiscoverSearch({
direction: HfSortDirection;
channel: HfModelSearchChannel | null;
ownerScope: "unsloth" | "all";
+ listingTags?: readonly string[];
filters?: ModelSearchFilters;
task?: HfTaskFilter;
}): DiscoverSearch {
@@ -139,6 +141,8 @@ export function useDiscoverSearch({
ownerScope,
enabled: canProbe && isDiscoverTab && !isDatasetMode,
keepUnsupportedTags: true,
+ unslothFirstBrowse: true,
+ listingTags,
channel,
filters,
task,
diff --git a/studio/frontend/src/features/hub/hooks/use-hub-model-search.ts b/studio/frontend/src/features/hub/hooks/use-hub-model-search.ts
index 020dd45c57b..62d37b3e249 100644
--- a/studio/frontend/src/features/hub/hooks/use-hub-model-search.ts
+++ b/studio/frontend/src/features/hub/hooks/use-hub-model-search.ts
@@ -303,6 +303,7 @@ async function* mergedModelIterator(
signal?: AbortSignal,
parameterFilter = "",
filterPriority?: ModelListingTransform,
+ tags?: string[],
): AsyncGenerator<unknown> {
const tasks = normalizeTaskFilter(task);
const common = {
@@ -315,7 +316,12 @@ async function* mergedModelIterator(
(task, taskSignal) =>
listModels({
hubUrl: getHfEndpoint(),
- search: { query, owner: "unsloth", ...(task ? { task } : {}) },
+ search: {
+ query,
+ owner: "unsloth",
+ ...(task ? { task } : {}),
+ ...(tags ? { tags } : {}),
+ },
fetch: makeSortFetch(sortBy, direction, taskSignal, parameterFilter),
...common,
}) as AsyncGenerator<unknown>,
@@ -326,7 +332,11 @@ async function* mergedModelIterator(
(task, taskSignal) =>
listModels({
hubUrl: getHfEndpoint(),
- search: { query, ...(task ? { task } : {}) },
+ search: {
+ query,
+ ...(task ? { task } : {}),
+ ...(tags ? { tags } : {}),
+ },
fetch: makeSortFetch(sortBy, direction, taskSignal, parameterFilter),
...common,
}) as AsyncGenerator<unknown>,
@@ -655,6 +665,10 @@ export function useHubModelSearch(
enabled?: boolean;
keepUnsupportedTags?: boolean;
channel?: HfModelSearchChannel | null;
+ /** Hub tags for the no-query listing, e.g. ["gguf"] when the view shows only GGUF rows. */
+ listingTags?: readonly string[];
+ /** Float unsloth repos above the rest of a no-query browse under any sort, as a search does. */
+ unslothFirstBrowse?: boolean;
filters?: ModelSearchFilters;
},
) {
@@ -670,6 +684,8 @@ export function useHubModelSearch(
enabled = true,
keepUnsupportedTags = false,
channel = null,
+ listingTags,
+ unslothFirstBrowse = false,
filters,
} = options ?? {};
const unslothOnly = ownerScope === "unsloth";
@@ -678,6 +694,11 @@ export function useHubModelSearch(
const channelTagsKey = channel?.tags ? channel.tags.join("|") : "";
const channelQuery = channel?.query ?? "";
const channelIdSuffix = channel?.idSuffix ?? "";
+ const listingTagsKey = listingTags?.join("|") ?? "";
+ const browseTags = useMemo(
+ () => (listingTagsKey ? listingTagsKey.split("|") : undefined),
+ [listingTagsKey],
+ );
const priorityIdsKey = priorityIds?.join("|") ?? "";
const stablePriorityIds = useMemo(
() => (priorityIdsKey ? priorityIdsKey.split("|") : undefined),
@@ -770,7 +791,11 @@ export function useHubModelSearch(
filterRange,
) as AsyncGenerator<unknown>;
}
- if (hasFilters && pinUnslothFirst && !unslothOnly) {
+ if (
+ (hasFilters || unslothFirstBrowse) &&
+ pinUnslothFirst &&
+ !unslothOnly
+ ) {
return mergedModelIterator(
"",
task,
@@ -781,18 +806,20 @@ export function useHubModelSearch(
signal,
filterRange,
filterPriority,
+ browseTags,
);
}
+ // Unsloth-only scope restricts the plain sort browse to the org.
+ const browseSearch = {
+ ...(unslothOnly ? { owner: "unsloth" } : {}),
+ ...(browseTags ? { tags: browseTags } : {}),
+ };
return mergeTaskIterators(
normalizeTaskFilter(task),
(task, taskSignal) =>
listModels({
hubUrl: getHfEndpoint(),
- // Unsloth-only scope restricts the plain sort browse to the org.
- search: {
- ...(unslothOnly ? { owner: "unsloth" } : {}),
- ...(task ? { task } : {}),
- },
+ search: { ...browseSearch, ...(task ? { task } : {}) },
additionalFields: ALL_FIELDS,
fetch: makeSortFetch(
sortBy,
@@ -848,6 +875,8 @@ export function useHubModelSearch(
unslothOnly,
hasFilters,
filterRange,
+ browseTags,
+ unslothFirstBrowse,
],
);
diff --git a/studio/frontend/src/features/hub/hub-page.tsx b/studio/frontend/src/features/hub/hub-page.tsx
index 3f7f9f9986c..475e1bc4348 100644
--- a/studio/frontend/src/features/hub/hub-page.tsx
+++ b/studio/frontend/src/features/hub/hub-page.tsx
@@ -123,6 +123,10 @@ import {
supersedingRefresh,
} from "./lib/superseded-refresh";
import { studioPageForTask } from "./lib/unsloth-support";
+import {
+ listingTagsForFormat,
+ recommendedNeedsLikes,
+} from "./lib/format-filters";
import {
buildDiscoverRows,
detectResultFormat,
@@ -931,6 +935,10 @@ export function ModelsPage() {
direction: effectiveDirection,
channel: listChannel,
ownerScope,
+ listingTags:
+ mode === "search"
+ ? listingTagsForFormat(effectiveDiscoverFormat, checkpointQuantFormats)
+ : undefined,
filters: searchFilters,
task:
capabilityFilter === "audio" ? (linkedAudioTask ?? undefined) : undefined,
@@ -1051,6 +1059,7 @@ export function ModelsPage() {
// search and every other format show all matches.
(effectiveDiscoverFormat !== "recommended" ||
hasQuery ||
+ (mode === "search" && !recommendedNeedsLikes(effectiveSort)) ||
resolveOwnerProviderLogo(row.owner, row.repo) !== null ||
(row.result.likes ?? 0) >= MIN_ICONLESS_MODEL_LIKES) &&
(effectiveDiscoverFormat === "recommended"
@@ -1079,6 +1088,8 @@ export function ModelsPage() {
hiddenEmbeddingModelIds,
isDatasetMode,
hasQuery,
+ mode,
+ effectiveSort,
effectiveDiscoverFormat,
checkpointQuantFormats,
diffusionQuantFormats,
diff --git a/studio/frontend/src/features/hub/lib/format-filters.ts b/studio/frontend/src/features/hub/lib/format-filters.ts
index b6daa35f444..8a40e5be2df 100644
--- a/studio/frontend/src/features/hub/lib/format-filters.ts
+++ b/studio/frontend/src/features/hub/lib/format-filters.ts
@@ -97,6 +97,23 @@ export function matchesRecommended(
return format !== null && checkpointQuantFormats.includes(format);
}
+/** Hub tags for a listing whose format filter only shows GGUF rows, else undefined. */
+export function listingTagsForFormat(
+ formatFilter: FormatFilterValue,
+ checkpointQuantFormats: readonly string[],
+): readonly string[] | undefined {
+ return formatFilter === "gguf" ||
+ (formatFilter === "recommended" && checkpointQuantFormats.length === 0)
+ ? GGUF_LISTING_TAGS
+ : undefined;
+}
+const GGUF_LISTING_TAGS: readonly string[] = ["gguf"];
+
+/** Recommended's likes floor needs a popularity sort: under Newest no fresh upload has likes yet. */
+export function recommendedNeedsLikes(sort: string): boolean {
+ return sort !== "createdAt" && sort !== "lastModified";
+}
+
// Inference-only quant formats Unsloth cannot fine-tune. Matched on the repo
// name since the search listing often omits the quant config.
const NON_FINETUNABLE_NAME =
diff --git a/studio/frontend/tests/hub-recommended-format.test.ts b/studio/frontend/tests/hub-recommended-format.test.ts
index 6375ad4dc2e..b5cde76d792 100644
--- a/studio/frontend/tests/hub-recommended-format.test.ts
+++ b/studio/frontend/tests/hub-recommended-format.test.ts
@@ -6,8 +6,10 @@ import test from "node:test";
import {
checkpointQuantFormat,
+ listingTagsForFormat,
matchesFormat,
matchesRecommended,
+ recommendedNeedsLikes,
} from "../src/features/hub/lib/format-filters.ts";
import { readSrcAsync } from "./helpers/kit.ts";
@@ -73,7 +75,7 @@ test("the likes threshold only curates Recommended, and Recommended is the defau
const page = await readSrcAsync("features/hub/hub-page.tsx");
assert.match(
page,
- /effectiveDiscoverFormat !== "recommended" \|\|\s*hasQuery \|\|\s*resolveOwnerProviderLogo/,
+ /effectiveDiscoverFormat !== "recommended" \|\|\s*hasQuery \|\|\s*\(mode === "search" && !recommendedNeedsLikes\(effectiveSort\)\) \|\|\s*resolveOwnerProviderLogo/,
);
assert.doesNotMatch(page, /preset\?\.format \?\? "gguf"/);
const channels = await readSrcAsync("features/hub/lib/channels.ts");
@@ -141,3 +143,38 @@ test("a capable Recommended channel query drops the GGUF-only tag", async () =>
/tags: widenRecommendedChannel\s*\?\s*withoutGgufTag\(liveListChannel\.tags\)\s*:\s*liveListChannel\.tags/,
);
});
+
+test("Newest and Recently updated skip the likes floor no fresh upload can meet", () => {
+ for (const sort of ["trendingScore", "downloads", "likes"]) {
+ assert.equal(recommendedNeedsLikes(sort), true, sort);
+ }
+ assert.equal(recommendedNeedsLikes("createdAt"), false);
+ assert.equal(recommendedNeedsLikes("lastModified"), false);
+});
+
+test("GGUF-only views ask the Hub for GGUF repos, others list every format", async () => {
+ assert.deepEqual(listingTagsForFormat("gguf", []), ["gguf"]);
+ assert.deepEqual(listingTagsForFormat("gguf", ["fp8"]), ["gguf"]);
+ assert.deepEqual(listingTagsForFormat("recommended", []), ["gguf"]);
+ // FP8 / NVFP4 checkpoints pass Recommended here, and they are not GGUF repos.
+ assert.equal(listingTagsForFormat("recommended", ["fp8"]), undefined);
+ for (const format of ["all", "checkpoint", "mlx", "npu"] as const) {
+ assert.equal(listingTagsForFormat(format, []), undefined, format);
+ }
+ const page = await readSrcAsync("features/hub/hub-page.tsx");
+ assert.match(
+ page,
+ /listingTags:\s*mode === "search"\s*\?\s*listingTagsForFormat\(effectiveDiscoverFormat, checkpointQuantFormats\)\s*:\s*undefined/,
+ );
+});
+
+test("a Discover browse floats unsloth repos first under any sort, other pickers keep their listing", async () => {
+ const discover = await readSrcAsync("features/hub/hooks/use-discover-search.ts");
+ assert.match(discover, /unslothFirstBrowse: true,/);
+ const search = await readSrcAsync("features/hub/hooks/use-hub-model-search.ts");
+ assert.match(search, /unslothFirstBrowse = false,/);
+ assert.match(
+ search,
+ /if \(\s*\(hasFilters \|\| unslothFirstBrowse\) &&\s*pinUnslothFirst &&\s*!unslothOnly\s*\) \{\s*return mergedModelIterator\(/,
+ );
+});