PlatformDetector

Detects the current server platform, GPU backend, and physical CPU core count.

All methods are stateless and accept a log function for diagnostic output. This class is shared between LLAMA-Server (text/vision) and Whisper-Server (speech-to-text).

Types

Link copied to clipboard

Detected GPU backend on the current system. Used to select the correct server binary variant.

Link copied to clipboard
data class Platform(val os: String, val arch: String, val exeName: String)

Represents a detected server platform.

Functions

Link copied to clipboard

Detects the best available GPU backend on the current system.

Link copied to clipboard

Detects the number of physical CPU cores (not hyper-threaded logical processors). Falls back to Runtime.availableProcessors if detection fails.

Link copied to clipboard
fun detectPlatform(log: (CodBi.LogLevel, String) -> Unit, windowsExeName: String = "llama-server.exe", unixExeName: String = "LLAMA-Server"): PlatformDetector.Platform

Detects the current server platform from JVM system properties.