Where to start by platform:
Platform support matrix
x86 JVM hosts (e.g. Linux/Windows x86_64 desktop JVMs) load the engine via JNI. JNI binaries ship inside the
leap-sdk JAR β no extra setup needed.
JVM Desktop
The JVM target supports Kotlin and Java projects on macOS (Apple Silicon), Linux (x86_64, aarch64), and Windows (x86_64, aarch64). The JAR bundles all platform-specific JNI binaries β at runtime the SDK extracts and loads the right one for the current OS/arch.Installation
- Gradle (Kotlin DSL)
- Gradle (Groovy DSL)
- Maven
Loading a model
LeapDownloader is the cross-platform downloader. Point it at a writable directory and call loadModel(modelName:, quantizationType:) for manifest-based downloads, or loadSimpleModel(model: ModelSource(...)) for a GGUF you already have on disk.
Loading a sideloaded GGUF
When the file already lives somewhere on disk (CI artifact, app resource folder, network share), skip the manifest lookup:mmprojPath = "..." for vision models, or audioDecoderPath = "..." (and optionally audioTokenizerPath = "...") for audio models. See Model Loading for the full ModelSource reference β the Kotlin API applies unchanged to JVM, Linux native, and Windows native.
Runtime expectations
- Memory. Plan for at least
model_size_on_disk + 1 GiBof free RAM. Withuse_mmap=true(the default since v0.10.4 β see the changelog) the OS pages weights in lazily, so resident memory grows as the model is exercised rather than at load time. - Threads. The engine defaults to a sensible CPU thread count for the host (
CpuThreadAdvisor.getRecommendedThreadCount()). Override by passingModelLoadingOptions(cpuThreads = N)throughloadModel(...)if you need to share the box with other workloads. - GPU acceleration. Available on macOS (Metal, automatic) and on Linux JVM builds with a CUDA-capable GPU when the matching native variant is on the classpath. GPU offload is configured through the
extrasJSON payload onModelLoadingOptions(advanced use only β most desktop workloads run pure-CPU).
Linux native (Kotlin/Native)
For statically-targeted Linux binaries β CLIs, daemons, embedded server processes β the SDK shipslinuxX64 and linuxArm64 Kotlin/Native targets. The engine is shipped as a separate -natives.zip classifier artifact rather than embedded in a JAR, because Kotlin/Native has no runtime resource-extraction equivalent to JVMβs getResourceAsStream.
Installation (recommended: ai.liquid.leap.nativelibs plugin)
The plugin auto-discovers your Kotlin/Native targets, registers a Copy task that drops the .so files next to the linked executable, and wires the linker -L<dir> flag automatically.
build/bin/linuxX64/releaseExecutable/, alongside the .so files the plugin installed (libinference_engine.so, libinference_engine_llamacpp_backend.so, libie_zip.so, plus their transitive dependencies). Keep them co-located when you ship β the cinterop manifest bakes -rpath=$ORIGIN into the binary so the dynamic linker resolves siblings.
Manual recipe (if you canβt apply the plugin)
Runtime requirements
- glibc 2.34+ β Ubuntu 22.04, Debian 12, RHEL 9, or newer. The pinned glibc-2.19 sysroot Kotlin/Native links against is only used at link time; the engine
.sois built against modern glibc and calls into symbols likedlsym@GLIBC_2.34at runtime. Older hosts fail at process start with a glibc version error. - Co-located
.sofiles β the dynamic linker usesrpath=$ORIGINfrom the binary, plusDT_RUNPATH=$ORIGIN:$ORIGIN/../libfrom the engine.soitself. The Copy task installs every dependent library (umbrella libs,libllama,libmtmd,libggml*, per-CPU-microarch GGML variants, SONAME aliases). Donβt cherry-pick from the natives ZIP β ship the whole set.
-natives.zip artifacts:
ai.liquid.leap:leap-sdk-linuxx64:0.10.7:natives@zipai.liquid.leap:leap-sdk-linuxarm64:0.10.7:natives@zip
Windows native (MinGW x64)
The same Kotlin/Native flow works for Windows x86_64 via the MinGW-w64 toolchain.inference_engine.dll, libinference_engine_llamacpp_backend.dll, ie_zip.dll, and their transitive DLLs into the link output directory. Windowsβ standard DLL search order finds DLLs co-located with the .exe before checking PATH, so no rpath plumbing is needed β just ship the executable and its sibling DLLs together.
The Maven coordinates for the -natives.zip artifact:
ai.liquid.leap:leap-sdk-mingwx64:0.10.7:natives@zip
Building from macOS or Linux for Windows? Kotlin/Native does not support cross-compiling to MinGW from a non-Windows host as of 2.3.20 β the build must run on Windows (native or in CI). GitHub Actions
windows-latest works without extra setup.macOS (Apple Silicon)
macOS is supported from two angles depending on the language youβre writing in:From Swift (AppKit / SwiftUI)
Identical Swift API to iOS β sameModelDownloader, Conversation, ChatMessage, MessageResponse. Follow the Quick Start (iOS / macOS tab) and substitute these platform-specific bits:
ios-arm64, ios-arm64-simulator, macos-arm64; Mac Catalyst is not supported, and the iOS simulator slice is ARM64-only (Intel-Mac simulator hosts cannot run it).
From Kotlin (JVM, Compose for Desktop)
If youβre targeting macOS as a JVM host β for example with Compose Multiplatform Desktop, IntelliJ-style tooling, or a Kotlin CLI β use the JVM Desktop instructions above. Theleap-sdk JAR ships a macOS ARM64 JNI binary.
VoiceAssistantStore API you use on iOS/Android works unchanged.
macosArm64 Kotlin/Native target. The SDK also ships a macosArm64 Kotlin/Native klib for shared-code KMP projects that want to compile native macOS binaries directly (no JVM, no Swift). Most macOS consumers should prefer either Swift (via SPM) or JVM β the Kotlin/Native macOS path exists primarily so KMP commonMain code is portable to macOS, not as a recommended end-user entry point.Picking the right target
Quick decision matrix when more than one target could plausibly fit:Next steps
- Model Loading reference β the Kotlin API applies identically on JVM, Linux native, and Windows native.
- Conversation & Generation β same Kotlin API.
- Function Calling, Constrained Generation, OpenAI-compatible client β all cross-platform.
- SDK Changelog β including the Kotlin/Native Linux + Windows story.