Engine::start_info meldet das Startkommando mit Platzhaltern. Die Karten "Planung ändern" weichen einem Dialog je Modell. Lokal mit Attrappen im Browser gesehen, auf srv04 nicht geprüft. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GmHhg3osejhFSpUz472iQ1
42 lines
1.4 KiB
Rust
42 lines
1.4 KiB
Rust
use std::time::Duration;
|
|
|
|
use async_trait::async_trait;
|
|
|
|
use crate::types::{
|
|
DiscoveredArtifact, Endpoint, Health, InstanceHandle, ProfileSpec, Result, Usage,
|
|
};
|
|
use crate::types::{EngineInfo, StartInfo};
|
|
|
|
/// Vertrag zwischen Gateway und Engine (Spezifikation, Abschnitt 4).
|
|
///
|
|
/// Alle Methoden sind wiederholbar aufrufbar. `stop` ist idempotent: Eine
|
|
/// bereits beendete oder unbekannte Instanz ist kein Fehler.
|
|
#[async_trait]
|
|
pub trait Engine: Send + Sync {
|
|
/// Art, Modus und Fähigkeiten der Engine.
|
|
fn describe(&self) -> EngineInfo;
|
|
|
|
/// Wie die Engine gestartet wird (nur zur Anzeige, ohne Geheimnisse).
|
|
fn start_info(&self) -> StartInfo {
|
|
StartInfo::default()
|
|
}
|
|
|
|
/// Sucht Modelle und Quantisierungen. Verändert nichts.
|
|
async fn discover(&self) -> Result<Vec<DiscoveredArtifact>>;
|
|
|
|
/// Startet eine Instanz und kehrt erst zurück, wenn sie bereit ist oder
|
|
/// der Start gescheitert ist.
|
|
async fn start(&self, profile: &ProfileSpec) -> Result<InstanceHandle>;
|
|
|
|
/// Beendet die Instanz: zuerst höflich, nach `grace` mit Gewalt.
|
|
async fn stop(&self, instance: &InstanceHandle, grace: Duration) -> Result<()>;
|
|
|
|
async fn health(&self, instance: &InstanceHandle) -> Health;
|
|
|
|
/// Adresse, unter der die Instanz erreichbar ist.
|
|
fn endpoint(&self, instance: &InstanceHandle) -> Endpoint;
|
|
|
|
/// Misst den echten Ressourcenverbrauch.
|
|
async fn measure(&self, instance: &InstanceHandle) -> Usage;
|
|
}
|