feat: Maya-Adapter (Managed, gegen Attrappe), Engine-Wahl maya in Registry und CLI (M2.6b)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -11,14 +11,16 @@ use crate::{Store, db};
|
||||
pub const LLAMA_CPP: &str = "llama.cpp";
|
||||
/// Name der Engine-Zeile für Ollama.
|
||||
pub const OLLAMA: &str = "ollama";
|
||||
/// Name der Engine-Zeile für Maya.
|
||||
pub const MAYA: &str = "maya";
|
||||
|
||||
/// Eingabe für `register_llm`: ein Sprachmodell mit einem Startprofil.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct NewLlm {
|
||||
pub name: String,
|
||||
/// Engine: `llama.cpp` oder `ollama`.
|
||||
/// Engine: `llama.cpp`, `ollama` oder `maya`.
|
||||
pub engine: String,
|
||||
/// Pfad der Modelldatei (llama.cpp) oder Modellname der Engine (Ollama, zum Beispiel `qwen3:0.6b`).
|
||||
/// Pfad der Modelldatei (llama.cpp) Modellname der Engine (Ollama, zum Beispiel `qwen3:0.6b`) oder Maya-Konfigurationsdatei (JSON).
|
||||
pub path: PathBuf,
|
||||
pub quantization: Option<String>,
|
||||
pub size_bytes: Option<i64>,
|
||||
@ -67,9 +69,9 @@ impl Store {
|
||||
if new.gpus.is_empty() {
|
||||
return Err(Error::Db("mindestens eine GPU angeben".to_string()));
|
||||
}
|
||||
if new.engine != LLAMA_CPP && new.engine != OLLAMA {
|
||||
if new.engine != LLAMA_CPP && new.engine != OLLAMA && new.engine != MAYA {
|
||||
return Err(Error::Db(format!(
|
||||
"unbekannte Engine \"{}\" (llama.cpp oder ollama)",
|
||||
"unbekannte Engine \"{}\" (llama.cpp, ollama oder maya)",
|
||||
new.engine
|
||||
)));
|
||||
}
|
||||
@ -291,6 +293,26 @@ mod tests {
|
||||
assert_eq!(plan.extra_args, vec!["--flash-attn".to_string()]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn maya_modell_hat_die_konfigurationsdatei_als_pfad_und_eigene_engine() {
|
||||
let mut store = Store::open_in_memory().unwrap();
|
||||
let mut n = neu("glm");
|
||||
n.engine = "maya".to_string();
|
||||
n.path = PathBuf::from("/srv/apps/maya/maya-test.json");
|
||||
n.gpus = vec![0, 1];
|
||||
store.register_llm(&n).unwrap();
|
||||
let plan = store.start_plan("glm").unwrap().unwrap();
|
||||
assert_eq!(plan.engine_name, "maya");
|
||||
assert_eq!(
|
||||
plan.model_path,
|
||||
PathBuf::from("/srv/apps/maya/maya-test.json")
|
||||
);
|
||||
assert_eq!(plan.gpus, vec![0, 1]);
|
||||
let mut falsch = neu("x");
|
||||
falsch.engine = "gibtsnicht".to_string();
|
||||
assert!(store.register_llm(&falsch).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ollama_modell_hat_den_modellnamen_als_pfad_und_eigene_engine() {
|
||||
let mut store = Store::open_in_memory().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user