feat: Strata-Adapter (#1038), Release 0.1.6

Strata teilt Servercode und Protokoll mit Maya (docs/m2-strata-messung.md);
MayaEngine::strata startet server.py --engine strata, behält den Arbeitsordner
des Terminals, nur 127.0.0.1. Scheduler führt Strata als exklusiv. Neu: Abschnitt
[strata], nexus model add --engine strata --strata-config. Auf srv04 mit echtem
Strata geprüft (client2antwort.1-.3).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GmHhg3bfByVgQ9z7CGCSGc
This commit is contained in:
2026-11-16 06:51:21 +01:00
parent 437108c88b
commit 3e100918c2
18 changed files with 291 additions and 35 deletions

View File

@ -171,6 +171,7 @@ fn model_add(args: &[String]) -> Result<(), String> {
"path",
"tag",
"maya-config",
"strata-config",
"gpus",
"context",
"vram-mb",
@ -203,9 +204,17 @@ fn model_add(args: &[String]) -> Result<(), String> {
}
(path, None)
}
// Strata: dasselbe, die Konfigurationsdatei des Strata-Terminals.
"strata" => {
let path = PathBuf::from(flags.require("strata-config")?);
if !path.is_file() {
return Err(format!("{} ist keine Datei.", path.display()));
}
(path, None)
}
other => {
return Err(format!(
"Unbekannte Engine \"{other}\" (llama.cpp, ollama oder maya)."
"Unbekannte Engine \"{other}\" (llama.cpp, ollama, maya oder strata)."
));
}
};
@ -372,9 +381,14 @@ async fn model_discover(args: &[String]) -> Result<(), String> {
.discover()
.await
}
"strata" => {
MayaEngine::strata(crate::serve::strata_config(&config)?)
.discover()
.await
}
other => {
return Err(format!(
"Unbekannte Engine \"{other}\" (llama.cpp, ollama oder maya)."
"Unbekannte Engine \"{other}\" (llama.cpp, ollama, maya oder strata)."
));
}
}
@ -397,6 +411,8 @@ async fn model_discover(args: &[String]) -> Result<(), String> {
"--engine ollama --tag <modellname>"
} else if engine == "maya" {
"--engine maya --maya-config <pfad>"
} else if engine == "strata" {
"--engine strata --strata-config <pfad>"
} else {
"--path <pfad>"
}

View File

@ -286,6 +286,7 @@ fn log_dirs(config: &Config) -> Vec<PathBuf> {
crate::serve::llama_config(config).map(|c| c.log_dir),
crate::serve::ollama_config(config).map(|c| c.log_dir),
crate::serve::maya_config(config).map(|c| c.log_dir),
crate::serve::strata_config(config).map(|c| c.log_dir),
]
.into_iter()
.flatten()

View File

@ -25,8 +25,9 @@ Aufruf:
nexus model add --name N --path PFAD [--gpus 0,1] [--context N] [--vram-mb N] [--ram-mb N] [--idle-min N] [--quant Q] [--disabled]
nexus model add --name N --engine ollama --tag MODELLNAME [--gpus 0] [--disabled]
nexus model add --name N --engine maya --maya-config PFAD.json [--gpus 0,1] [--disabled]
nexus model add --name N --engine strata --strata-config PFAD.json [--gpus 0,1] [--disabled]
nexus model set --name N [--vram-mb N] [--idle-min MINUTEN (0 = nie) | --idle-default]
nexus model list | enable --name N | disable --name N | discover [--engine llama.cpp|ollama|maya]
nexus model list | enable --name N | disable --name N | discover [--engine llama.cpp|ollama|maya|strata]
nexus diag [--out DATEI.tar.gz] [--ohne-engine-logs] Diagnose-Archiv ohne Prompts und Keys
nexus backup [--out DATEI.db] Kopie der Datenbank (ohne sie zu migrieren; auch bei laufendem Gateway)
nexus help Diese Hilfe

View File

@ -78,6 +78,38 @@ pub fn runtime_options(config: &Config) -> RuntimeOptions {
}
}
/// Liest den Abschnitt `[strata]`. Ohne Angaben gelten die Pfade des
/// Strata-Terminals von `svc-scotty` und der Port-Bereich 18500 bis 18599.
pub fn strata_config(config: &Config) -> Result<MayaConfig, String> {
let mut table = config.strata.clone();
let base = "/home/svc-scotty/.local/share/strata";
for (key, value) in [
(
"python",
toml::Value::String(format!("{base}/terminal/current/python/bin/python3.12")),
),
(
"script",
toml::Value::String(format!("{base}/terminal/current/serve/server.py")),
),
(
"config_roots",
toml::Value::Array(vec![toml::Value::String(format!("{base}/install"))]),
),
("port_from", toml::Value::Integer(18500)),
("port_to", toml::Value::Integer(18599)),
(
"log_dir",
toml::Value::String(config.data_dir.join("logs").display().to_string()),
),
] {
table.entry(key).or_insert(value);
}
table
.try_into::<MayaConfig>()
.map_err(|e| format!("Konfiguration [strata]: {e}"))
}
pub async fn command(args: &[String]) -> ExitCode {
match run(args).await {
Ok(()) => ExitCode::SUCCESS,
@ -107,6 +139,10 @@ async fn run(args: &[String]) -> Result<(), String> {
"maya".to_string(),
Arc::new(MayaEngine::new(maya_config(&config)?)),
);
engines.insert(
"strata".to_string(),
Arc::new(MayaEngine::strata(strata_config(&config)?)),
);
let state = AppState::new(
store,
Runtime::with_options(engines, runtime_options(&config)),
@ -211,6 +247,7 @@ fn spawn_background_jobs(
llama_config(config)?.log_dir,
ollama_config(config)?.log_dir,
maya_config(config)?.log_dir,
strata_config(config)?.log_dir,
];
dirs.sort();
dirs.dedup();