Skip to content

Latest commit

 

History

History
 
 

android-consumer-test

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

llama-android consumer-test fixture (CI only)

Minimal AGP app that consumes the net.ladenthin:llama-android AAR from mavenLocal. Not a shipped project — it exists so CI proves Android Studio consumption end to end.

Two CI jobs drive it (.github/workflows/publish.yml):

  1. package-android-aar — assembleRelease with R8 for both -PjllamaBackend=cpu (the default) and -PjllamaBackend=opencl. The latter declares only the OpenCL dependency and resolves the CPU AAR transitively, catching duplicate classes between the two AARs. Validates AAR format, manifest minSdk merge, jni/{arm64-v8a,x86_64} packaging, and the shipped consumer ProGuard rules (asserts the APK still carries the binding and, per ABI, libjllama.so, ggml's shared libraries and at least one libggml-cpu-*.so module).
  2. test-android-emulator — boots a KVM-accelerated x86_64 emulator, adb-pushes a small GGUF (the already-cached draft model) to /data/local/tmp/jllama-test-model.gguf, and runs connectedDebugAndroidTest: OnDeviceInferenceTest loads the binding via System.loadLibrary from the AAR's jni/x86_64/libjllama.so, reads the GGUF with the pure-Java GgufInspector, and runs real native inference on the emulator. Tests self-skip when the model was not pushed, so a local connectedAndroidTest against a bare emulator stays green.

What the emulator job deliberately does NOT cover: arm64 kernels (real-device ABI — the example app on hardware covers that) and Adreno/OpenCL execution (no OpenCL ICD in the emulator). OpenCL dependency resolution, R8 and APK packaging are covered by the first job.