fix: feste GPUs durch Startprofil anzeigen, Hilfetext zum Speicherbedarf richtigstellen (#1272)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 10:40:45 +01:00
parent f62ba6e986
commit 0ccc4139ad
6 changed files with 78 additions and 12 deletions

View File

@ -103,6 +103,8 @@ struct ModelRow {
embedding_modell: bool,
/// Wer die GPUs bestimmt (#1272).
gpu_wahl: GpuWahl,
/// Das Startprofil hält das Modell fest; `gpu_wahl` ist dann ohne Wirkung.
durch_profil: bool,
/// Ergebnis des Embedding-Tests (#1184) und Vektorgröße.
embedding: String,
embedding_dim: Option<i64>,
@ -166,6 +168,8 @@ fn model_rows(state: &AppState) -> Vec<ModelRow> {
.ok()
.flatten()
.map_or(GpuWahl::Fest, |(wahl, _)| wahl),
durch_profil: details.as_ref().is_some_and(|d| d.engine == "llama.cpp")
&& store.startprofil_haelt_gpus_fest(&m.name).unwrap_or(false),
systemprompt: store
.model_systemprompt(&m.name)
.ok()
@ -423,6 +427,9 @@ fn models_table(state: &AppState, viewer: &Viewer, art: &str) -> String {
} else {
let symbole = super::faehigkeiten::gpu_symbole(&m.gpus);
match m.gpu_wahl {
_ if m.durch_profil => {
format!("<span class=\"klein\">fest durch Startprofil</span> {symbole}")
}
GpuWahl::Fest => symbole,
GpuWahl::Auto => format!("<span class=\"klein\">wählt</span> {symbole}"),
GpuWahl::Alle => "<span class=\"klein\">automatisch</span>".to_string(),
@ -492,7 +499,7 @@ fn modellkopf_block(state: &AppState, m: &ModelRow) -> String {
.iter()
.map(|g| (g.index, g.memory_total_mb))
.collect();
let gpus = if m.gpu_wahl == GpuWahl::Alle && !gesamt.is_empty() {
let gpus = if m.gpu_wahl == GpuWahl::Alle && !m.durch_profil && !gesamt.is_empty() {
gesamt.iter().map(|(index, _)| *index).collect()
} else {
eingetragen
@ -520,9 +527,14 @@ fn gpu_felder(m: &ModelRow) -> String {
if m.gpu_wahl == wahl { " selected" } else { "" }
)
};
let ohne_wirkung = if m.durch_profil {
"<b>Zurzeit ohne Wirkung:</b> Das Startprofil legt die Verteilung fest, deshalb gilt das Modell als fest. "
} else {
""
};
format!(
"<label class=\"feld\"><span class=\"titel\">Wahl der Grafikkarten</span><select name=\"gpu_wahl\">{}{}{}</select>\
<span class=\"hilfe\">Automatisch: Nexus nimmt beim Laden eine freie Karte, sonst mehrere, und verdrängt erst dann. \
<span class=\"hilfe\">{ohne_wirkung}Automatisch: Nexus nimmt beim Laden eine freie Karte, sonst mehrere, und verdrängt erst dann. \
Verteilungsangaben in den Startparametern halten das Modell fest. Gilt ab dem nächsten Laden.</span></label>\
<label class=\"feld\"><span class=\"titel\">Grafikkarten</span><input name=\"gpus\" value=\"{}\" pattern=\"[0-9]+(, ?[0-9]+)*\" required>\
<span class=\"hilfe\">Fest: genau diese. Automatisch unter diesen: die erlaubten. Bei „alle“ ohne Wirkung.</span></label>",
@ -607,7 +619,7 @@ fn edit_dialog(state: &AppState, viewer: &Viewer, m: &ModelRow) -> String {
<input type=\"hidden\" name=\"name\" value=\"{name}\">\
<label class=\"feld\"><span class=\"titel\">Speicherbedarf (VRAM) in MB</span>\
<input name=\"vram_mb\" type=\"number\" min=\"1\" max=\"1000000\" value=\"{vram}\" placeholder=\"unverändert\">\
<span class=\"hilfe\">So viel reserviert der Scheduler je GPU, bis das Modell gemessen ist ({measured}). \
<span class=\"hilfe\">So viel reserviert der Scheduler für das ganze Modell, bis es gemessen ist, auf mehreren Grafikkarten zu gleichen Teilen ({measured}). \
Eine neue Angabe verwirft die Messung.</span></label>{gpu_felder}\
<label class=\"feld\"><span class=\"titel\">Leerlauf bis zum Entladen in Minuten</span>\
<input name=\"idle_min\" type=\"number\" min=\"0\" max=\"100000\" value=\"{idle}\" placeholder=\"Standard\">\
@ -664,7 +676,14 @@ fn edit_dialog(state: &AppState, viewer: &Viewer, m: &ModelRow) -> String {
.split(',')
.filter_map(|g| g.trim().parse().ok())
.collect();
esc(&m.gpu_wahl.beschreibung(&liste))
if m.durch_profil {
esc(&format!(
"{} (durch Startprofil)",
GpuWahl::Fest.beschreibung(&liste)
))
} else {
esc(&m.gpu_wahl.beschreibung(&liste))
}
},
context = m
.context