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.

feat: sort unsloth models first in HF search dropdowns

imagineer99c815fc045db4
diff --git a/studio/frontend/src/hooks/use-hf-model-search.ts b/studio/frontend/src/hooks/use-hf-model-search.ts
index 4745b4dc7b9..2ec100b1bda 100644
--- a/studio/frontend/src/hooks/use-hf-model-search.ts
+++ b/studio/frontend/src/hooks/use-hf-model-search.ts
@@ -1,6 +1,6 @@
import type { PipelineType } from "@huggingface/hub";
import { listModels } from "@huggingface/hub";
-import { useCallback } from "react";
+import { useCallback, useMemo } from "react";
import { useHfPaginatedSearch } from "./use-hf-paginated-search";
export interface HfModelResult {
@@ -84,5 +84,17 @@ export function useHfModelSearch(
[query, task, accessToken],
);
- return useHfPaginatedSearch(createIter, mapModel);
+ const search = useHfPaginatedSearch(createIter, mapModel);
+
+ const results = useMemo(
+ () =>
+ [...search.results].sort((a, b) => {
+ const aFirst = a.id.startsWith("unsloth/") ? 0 : 1;
+ const bFirst = b.id.startsWith("unsloth/") ? 0 : 1;
+ return aFirst - bFirst;
+ }),
+ [search.results],
+ );
+
+ return { ...search, results };
}