mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-29 09:27:33 -05:00
ui : lead each manager section with the recently used models
Assisted-by: pi:llama.cpp/DeepSeek-V4.1-Flash
This commit is contained in:
@@ -54,10 +54,20 @@
|
||||
return true;
|
||||
});
|
||||
});
|
||||
// recently used models lead their section, the rest keep the server's order
|
||||
const rank = new SvelteMap<string, number>();
|
||||
|
||||
modelsStore.recentModelIds.forEach((id, index) => rank.set(id, index));
|
||||
|
||||
const rankOf = (entry: ModelQuantGroup) =>
|
||||
Math.min(...entry.quants.map((quant) => rank.get(quant.id) ?? Number.MAX_SAFE_INTEGER));
|
||||
const byRecency = (list: ModelQuantGroup[]) =>
|
||||
rank.size === 0 ? list : [...list].sort((a, b) => rankOf(a) - rankOf(b));
|
||||
|
||||
// one entry per repo, so a model with several quants is a single table row;
|
||||
// loaded models lead the table, then favorites, then one block per provider,
|
||||
// and an entry lands in the first group that claims it
|
||||
let entries = $derived(groupModelQuants(visible));
|
||||
let entries = $derived(byRecency(groupModelQuants(visible)));
|
||||
let groups = $derived.by(() => {
|
||||
// only llama-compat servers report a load state
|
||||
const isLlamaCompat = (entry: ModelQuantGroup) =>
|
||||
|
||||
Reference in New Issue
Block a user