What we hit
Building an iOS app, the obvious dependency for llama inference is
skainet-transformers-runtime-kllama, and the README describes the project as
KMP including iOS ("where applicable", README.md:53). On Maven Central 0.38.0
though, runtime-kllama publishes -android, -jvm, -js, -linuxarm64,
-linuxx64, -macosarm64, -wasm-js — no -iosarm64, no -iossimulatorarm64.
Same for runtime-kgemma. Meanwhile inference-llama, transformers-core and
transformers-agent all publish iOS variants.
What made it extra confusing: llm-runtime/kllama/src/iosMain/.../cli/BackendActual.kt
exists in the repo (byte-identical to the macos actual), so at first glance iOS
looks supported — but the module sets
kotlin.mpp.applyDefaultHierarchyTemplate=false (kllama/gradle.properties) and
hand-wires its source sets, build.gradle.kts declares no iOS targets, so that
folder is silently dead code.
Why it looks cheap to fix
- All of kllama's commonMain dependencies already publish iosArm64:
:llm-inference:llama, :llm-inference:qwen, :llm-agent, :llm-core, and
the engine artifacts (skainet-lang-core, skainet-compile-core,
skainet-backend-cpu, skainet-io-core, skainet-io-gguf,
skainet-io-safetensors).
- kgemma's JVM-only deps (compile-hlo, gemma-iree, llm-providers, …) are already
confined to jvmMain, so its commonMain is iOS-clean too.
- Because the default hierarchy template is off, the change is: add
iosArm64() +
iosSimulatorArm64() and explicitly attach iosArm64Main/iosSimulatorArm64Main
to the existing hand-made nativeMain (exactly how llm-core/build.gradle.kts
does it). CLI executables stay per-target, so no iOS binary needs declaring.
- API dumps are jvm/android-only, so no ABI dump churn; the publish workflow
already runs on macOS-latest, so the artifacts would build in CI as-is.
Ask
- Add the Apple targets to
runtime-kllama (and runtime-kgemma), or — if the
runtime facades are deliberately not iOS-supported — say so explicitly.
- Either way: a module-vs-target support matrix in the README or docs would
remove the whole guessing game. Right now the only reliable way to learn what
runs on iOS is browsing directory listings on Maven Central.
For anyone landing here meanwhile: driving LlamaNetworkLoader +
OptimizedLLMRuntime directly from commonMain (:llm-inference:llama +
:llm-core) works fine on iOS — that's how we shipped. It just took a while to
discover that this is the intended path.
Happy to open the PR for the target additions.
What we hit
Building an iOS app, the obvious dependency for llama inference is
skainet-transformers-runtime-kllama, and the README describes the project asKMP including iOS ("where applicable", README.md:53). On Maven Central 0.38.0
though,
runtime-kllamapublishes-android,-jvm,-js,-linuxarm64,-linuxx64,-macosarm64,-wasm-js— no-iosarm64, no-iossimulatorarm64.Same for
runtime-kgemma. Meanwhileinference-llama,transformers-coreandtransformers-agentall publish iOS variants.What made it extra confusing:
llm-runtime/kllama/src/iosMain/.../cli/BackendActual.ktexists in the repo (byte-identical to the macos actual), so at first glance iOS
looks supported — but the module sets
kotlin.mpp.applyDefaultHierarchyTemplate=false(kllama/gradle.properties) andhand-wires its source sets,
build.gradle.ktsdeclares no iOS targets, so thatfolder is silently dead code.
Why it looks cheap to fix
:llm-inference:llama,:llm-inference:qwen,:llm-agent,:llm-core, andthe engine artifacts (
skainet-lang-core,skainet-compile-core,skainet-backend-cpu,skainet-io-core,skainet-io-gguf,skainet-io-safetensors).confined to jvmMain, so its commonMain is iOS-clean too.
iosArm64()+iosSimulatorArm64()and explicitly attachiosArm64Main/iosSimulatorArm64Mainto the existing hand-made
nativeMain(exactly howllm-core/build.gradle.ktsdoes it). CLI executables stay per-target, so no iOS binary needs declaring.
already runs on macOS-latest, so the artifacts would build in CI as-is.
Ask
runtime-kllama(andruntime-kgemma), or — if theruntime facades are deliberately not iOS-supported — say so explicitly.
remove the whole guessing game. Right now the only reliable way to learn what
runs on iOS is browsing directory listings on Maven Central.
For anyone landing here meanwhile: driving
LlamaNetworkLoader+OptimizedLLMRuntimedirectly from commonMain (:llm-inference:llama+:llm-core) works fine on iOS — that's how we shipped. It just took a while todiscover that this is the intended path.
Happy to open the PR for the target additions.