ui : group families by name and show their org avatar

Assisted-by: pi:llama.cpp/DeepSeek-V4.1-Flash
This commit is contained in:
Aleksander Grygier
2026-09-28 12:10:12 +02:00
parent 5f7aa0102f
commit 8a2680d474
2 changed files with 8 additions and 5 deletions
@@ -436,7 +436,9 @@
</span>
</span>
{:else}
<span class="flex min-w-0 items-center gap-2" style="padding-left: {indent}px">
<span class="flex min-w-0 items-center gap-3" style="padding-left: {indent}px">
<ModelAvatar option={family.entries[0].base} showBaseModelAvatar size="size-7" />
<span class="truncate text-sm font-medium">{family.label}</span>
<span class="text-sm text-muted-foreground">{countLabel}</span>
@@ -198,14 +198,15 @@ export function groupModelQuants(models: ModelOption[]): ModelQuantGroup[] {
}
/**
* Family a repo belongs to, from its name: `Qwen3.8-27B` and `Qwen3.8-Flash-Next`
* both read as `Qwen3.8`, and a name without a version keeps its first segment.
* Family a repo belongs to, from its name. The version is dropped, so `Qwen3.5`,
* `Qwen3.8-27B` and `Qwen3.8-Flash-Next` all read as `Qwen`. A name that does not
* start with letters keeps its first segment.
*/
export function modelFamilyKey(repo: string): string {
const name = repo.split('/').pop() ?? repo;
const versioned = name.match(/^[A-Za-z]+\d+(?:\.\d+)?/);
const letters = name.match(/^[A-Za-z]+/);
return versioned ? versioned[0] : (name.split(/[-_.]/)[0] ?? name);
return letters ? letters[0] : (name.split(/[-_.]/)[0] ?? name);
}
/** One family of the table, the repos it covers. */