Feat: "Modelle finden" mit gleichwertigem Stöbern-&-Suchen-Modus

Profi-Suche raus aus dem versteckten Akkordeon → eigener Modus-Umschalter
(Empfohlen | Stöbern & Suchen) im "Modelle finden"-Tab.

- Stöbern & Suchen: immer sichtbare Suchleiste, Filter-Chips (Beliebt/Coder/
  Vision/Reasoning/Klein), reiche Treffer (Autor · Downloads · Likes · installiert-
  Badge), aufklappbar → Quant + Rolle + Fit-Ampel + Download (OOM-Gate), plus
  Direkt-Eingabe für exaktes Repo/URL.
- Trending ohne Query: hf.search('') liefert jetzt Top-GGUF nach Downloads;
  Route /api/hf/search?q wird optional.
- Empfohlen = unveränderte Rollen-Sockets (Default). AddModel.tsx in ModelBrowse
  aufgegangen → gelöscht.

Verifiziert: npm run build (tsc strict) clean; Backend-Smoke (empty-q → Top-GGUF);
live gegen die Box (Toggle, Chips, Suche, installiert-Erkennung, Fit-Ampel).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hitonabi
2026-06-29 19:51:16 +02:00
parent a894a4e952
commit 8108d3fd28
9 changed files with 676 additions and 592 deletions
+6 -4
View File
@@ -31,10 +31,12 @@ def list_quants(repo: str) -> list[str]:
return sorted(quants, key=lambda q: (order.get(q, 99), q))
def search(q: str, limit: int = 20) -> list[dict]:
"""Freie HF-Suche nach GGUF-Repos."""
url = (f"https://huggingface.co/api/models?search={q}"
f"&filter=gguf&sort=downloads&direction=-1&limit={limit}")
def search(q: str = "", limit: int = 24) -> list[dict]:
"""Freie HF-Suche nach GGUF-Repos. Ohne q → Top-GGUF nach Downloads (Stöbern)."""
url = (f"https://huggingface.co/api/models?filter=gguf"
f"&sort=downloads&direction=-1&limit={limit}")
if q and q.strip():
url += f"&search={q.strip()}"
try:
with httpx.Client(timeout=12.0) as c:
data = c.get(url).json()