Skip to content

runtime-kllama / runtime-kgemma publish no iOS artifacts — kllama's iosMain exists but is never compiled #271

Description

@michalharakal

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

  1. Add the Apple targets to runtime-kllama (and runtime-kgemma), or — if the
    runtime facades are deliberately not iOS-supported — say so explicitly.
  2. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions