WhisperServerManager

Verwaltet den gesamten Lebenszyklus einer lokalen Whisper-Server-Instanz: Binär-Download, FFmpeg Bereitstellung, Prozessstart, Zustandsprüfung, Ressourcenüberwachung und Herunterfahren.

Aus „Whisper.kt“ extrahiert, sodass die Servlet-Klasse nur die Konfiguration und das Anforderungsrouting übernimmt.

Parameters

log

Logging callback (LogLevel, message).

Constructors

Link copied to clipboard
constructor(log: (CodBi.LogLevel, String) -> Unit)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

GPU backend detected at initialization.

Link copied to clipboard

true when ffmpeg is available, enabling the --convert flag.

Link copied to clipboard

Captures the first fatal error during background initialization, if any.

Link copied to clipboard

The TCP port the running server listens on. 0 means no server is running.

Link copied to clipboard

true once the whisper-server is healthy and accepting requests.

Functions

Link copied to clipboard

Estimated seconds the client should wait before retrying.

Link copied to clipboard

Gibt einen für Menschen lesbaren Grund zurück, wenn Ressourcenschwellenwerte überschritten werden, oder „null“, falls verfügbar.

Link copied to clipboard

Marks the server as ready without starting a local process (external API mode).

Link copied to clipboard
fun shutdown()

Stops the resource monitor, kills the server process, and resets readiness state.

Link copied to clipboard
fun startAsync(preferredPort: Int, whisperRelease: String, whisperReleaseBaseUrl: String, modelUrl: String, modelsDir: File, binDir: File, whisperDir: File, noGpu: Boolean, threadCount: Int?, maxRAMPercent: Double, maxComputePercent: Double, onReady: (port: Int) -> Unit)

Startet die Hintergrundinitialisierung: lädt die Whisper-Server-Binärdatei und das Whisper-Server-Modell herunter und stellt sicher ffmpeg, startet den Server und startet den Ressourcenmonitor.