From 91619d930773ff436ecfc3c0388ad1796444dba4 Mon Sep 17 00:00:00 2001 From: duffyduck Date: Sat, 31 Oct 2026 19:41:24 +0100 Subject: [PATCH] =?UTF-8?q?feat(diagnostic):=20Katalog=20zeigt,=20ob=20ein?= =?UTF-8?q?=20Modell=20Werkzeuge=20kann=20(=F0=9F=94=A7)=20+=20Filter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Erkennung: Chat-Vorlage des GGUF (HF expand[]=gguf) kennt ein Werkzeug- Format, oder Schlagworte wie function-calling/tool-use. Zeigt, OB das Format da ist — nicht, wie gut das Modell damit umgeht. - Neue und hinzugefuegte Eintraege bekommen tools: true/false/null, bestehende beim naechsten "Von HuggingFace aktualisieren". - Liste: 🔧-Abzeichen; Haken "nur Modelle mit Werkzeugen" (Standard an) blendet Modelle ohne Werkzeug-Format aus (unbekannt bleibt sichtbar). - ℹ: Zeile "Werkzeuge: ja / nein / unbekannt". Getestet gegen HuggingFace (7 Modelle, u.a. Hermes 3 ueber das Schlagwort, weil dessen offizielle Vorlage minimal ist). Co-Authored-By: Claude Opus 5.5 --- diagnostic/index.html | 12 ++++++++++-- diagnostic/server.js | 24 +++++++++++++++++++++++- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/diagnostic/index.html b/diagnostic/index.html index 7794f08..2cb4991 100644 --- a/diagnostic/index.html +++ b/diagnostic/index.html @@ -966,6 +966,8 @@
+
(lade Katalog…)
@@ -9737,7 +9739,11 @@ const q = (document.getElementById('llm-catalog-search') || {}).value || ''; const rows = document.querySelectorAll('#llm-catalog-list tbody tr[data-search]'); let shown = 0; - rows.forEach(tr => { const ok = _llmMatches(tr.dataset.search, q); tr.style.display = ok ? '' : 'none'; if (ok) shown++; }); + const onlyTools = (document.getElementById('llm-catalog-tools') || {}).checked; + rows.forEach(tr => { + const ok = _llmMatches(tr.dataset.search, q) && !(onlyTools && tr.dataset.tools === 'nein'); + tr.style.display = ok ? '' : 'none'; if (ok) shown++; + }); const none = document.getElementById('llm-catalog-none'); if (none) none.style.display = rows.length && !shown ? '' : 'none'; } @@ -9822,8 +9828,9 @@ ? targets.map(t => ``).join('') : ''; const searchText = [m.id, m.description, m.hfRepo, m.quant].filter(Boolean).join(' '); - return '' + + return '' + '' + escapeHtml(m.id) + '' + + (m.tools ? ' 🔧' : '') + (m.uncensored ? ' unzensiert' : '') + (m.added_at && (Date.now() - new Date(m.added_at).getTime()) < 7 * 864e5 ? ' neu' : '') + (m.hfRepo ? ' ' : '') @@ -10272,6 +10279,7 @@
Kurzbeschreibung wird vom lokalen Modell aus der Modellkarte erstellt …
${fam} + ${row('Werkzeuge', j.tools === true ? '🔧 ja — die Chat-Vorlage kennt Werkzeug-Aufrufe' : j.tools === false ? 'nein — eher für Übersetzen, Zusammenfassen, Erklären' : 'unbekannt (keine Chat-Vorlage)')} ${row('Größe', m.sizeGB ? '~' + m.sizeGB + ' GB · ' + escapeHtml(m.quant || '') : '')} ${row('Grundmodell', j.base ? escapeHtml(j.base) : '')} ${row('Von', escapeHtml(j.author))} diff --git a/diagnostic/server.js b/diagnostic/server.js index 1170690..bbe372a 100644 --- a/diagnostic/server.js +++ b/diagnostic/server.js @@ -573,6 +573,11 @@ async function refreshLlmCatalogFromHF() { e.quant = q.quant; e.sizeGB = q.sizeGB; e.quants = q.quants; delete e.unusable; })); } + // Werkzeug-Faehigkeit nachtragen (alle Eintraege, die noch keine Angabe haben) + const noTools = [...byId.values()].filter(e => e.hfRepo && e.tools === undefined); + for (let i = 0; i < noTools.length; i += 6) { + await Promise.all(noTools.slice(i, i + 6).map(async e => { e.tools = await hfToolSupport(e.hfRepo); })); + } let added = 0; for (const e of byId.values()) { if (e._new) { added++; delete e._new; } } // Aufraeumen: von HF uebernommen, vor > LLM_CATALOG_KEEP_DAYS Tagen, auf @@ -821,12 +826,27 @@ async function llmModelInfo(repo) { created: meta.createdAt || "", updated: meta.lastModified || "", tags: tags.slice(0, 20), families, uncensored: !!unc, + tools: await hfToolSupport(repo), uncensoredWhy: unc ? `erkannt an „${unc[0]}“ in Name/Schlagworten` : "", intro: await hfReadmeIntro(base || repo) || await hfReadmeIntro(repo), introFrom: base || repo, }; } +// Kann das Modell Werkzeuge? Kennzeichen: die Chat-Vorlage im GGUF (HF liefert +// sie unter expand[]=gguf) kennt ein Werkzeug-Format, oder Schlagworte wie +// function-calling/tool-use. Zeigt nur, OB das Format da ist, nicht wie gut. +const TOOLS_TEMPLATE_RE = /\btools\b|tool_call| TOOLS_TAG_RE.test(t))) return true; + return tpl ? false : null; // keine Vorlage = unbekannt +} + async function addHfRepoToCatalog(repo, description = "") { repo = hfRepoFromInput(repo); if (!/^[\w.-]+\/[\w.-]+$/.test(String(repo || ""))) throw new Error("ungueltiges Repo — Link oder org/name"); @@ -842,7 +862,9 @@ async function addHfRepoToCatalog(repo, description = "") { if (same) return { models: cat, id: same.id, existed: true }; while (cat.some(m => m.id === id)) id += "-2"; cat.push({ id, hfRepo: repo, quant: q.quant, ctx: 8192, sizeGB: q.sizeGB, quants: q.quants, - description: description || "Aus den HuggingFace-Trends übernommen", source: "hf" }); + description: description || "Aus den HuggingFace-Trends übernommen", source: "hf", + tools: await hfToolSupport(repo), uncensored: UNCENSORED_RE.test(repo), + added_at: new Date().toISOString().slice(0, 10) }); saveLlmCatalog(cat); return { models: cat, id, existed: false }; }