feat: edit validated per-model engine start profiles (#1070)
This commit is contained in:
@ -46,6 +46,7 @@ pub struct ModelEntry {
|
||||
/// Alles, was zum Starten einer Instanz nötig ist.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct StartPlan {
|
||||
pub start_parameters: nexus_core::startparams::StartParameters,
|
||||
pub model: String,
|
||||
pub engine_name: String,
|
||||
pub model_path: PathBuf,
|
||||
@ -318,11 +319,25 @@ impl Store {
|
||||
.collect()
|
||||
})
|
||||
.unwrap_or_default();
|
||||
let start_parameters = self.start_parameters(model)?.unwrap_or_default();
|
||||
let gpus = if let Some(value) = start_parameters.get("gpu") {
|
||||
nexus_core::startparams::gpu_selection(value)
|
||||
.ok_or_else(|| Error::Config("Ungültige GPU-Auswahl im Startprofil.".into()))?
|
||||
} else {
|
||||
parse_gpus(&gpus)?
|
||||
};
|
||||
nexus_core::startparams::validate_start_parameters(
|
||||
&engine_name,
|
||||
&start_parameters,
|
||||
gpus.len(),
|
||||
)
|
||||
.map_err(|e| Error::Config(e.into()))?;
|
||||
Ok(Some(StartPlan {
|
||||
start_parameters,
|
||||
model: model.to_string(),
|
||||
engine_name,
|
||||
model_path: PathBuf::from(path),
|
||||
gpus: parse_gpus(&gpus)?,
|
||||
gpus,
|
||||
context,
|
||||
extra_args,
|
||||
vram_mb: vram_mb
|
||||
|
||||
Reference in New Issue
Block a user