WhisperServerManager

Gestisce l'intero ciclo di vita di un'istanza del server Whisper locale: download binario, FFmpeg provisioning, avvio del processo, controllo dello stato, monitoraggio delle risorse e arresto.

Estratto da "Whisper.kt" in modo che la classe servlet gestisca solo la configurazione e l'instradamento delle richieste.

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

Restituisce un motivo leggibile se vengono superate le soglie delle risorse o "null" se disponibile.

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)

Avvia l'inizializzazione in background: scarica il file binario e il modello del server Whisper, garantisce ffmpeg, avvia il server e avvia il monitor delle risorse.