Skip to content

ADFA-3105 - Wire debug llama asset bundling and add versioned dynamic AAR refresh for Local LLM#964

Merged
jatezzz merged 2 commits intostagefrom
feat/llama.cpp-update
Mar 4, 2026
Merged

ADFA-3105 - Wire debug llama asset bundling and add versioned dynamic AAR refresh for Local LLM#964
jatezzz merged 2 commits intostagefrom
feat/llama.cpp-update

Conversation

@jatezzz
Copy link
Collaborator

@jatezzz jatezzz commented Feb 11, 2026

This PR wires the local LLM (llama.cpp) update through the full asset lifecycle so both debug and release users get the new runtime library consistently, including Brotli-based assets.

What changed

1) Debug build flow now bundles updated llama assets

Updated app/build.gradle.kts so debug variants explicitly depend on llama asset bundling and debug asset sync:

  • assembleV8Debug depends on:
    • bundleV8LlamaAssets
    • assetsDownloadDebug (non-CI)
  • assembleV7Debug depends on:
    • bundleV7LlamaAssets
    • assetsDownloadDebug (non-CI)

This matches release behavior and ensures debug builds also regenerate/pick up the latest llama assets.

2) Runtime refresh for installed llama AAR

Updated DynamicLibraryLoader to force-refresh llama.aar from bundled assets when version changes:

  • Reintroduced ensureLatestLlamaAar(context) call before classloading
  • Added versioned preference gate (dynamic_libs/llama_lib_version)
  • Added asset lookup fallback order:
    • dynamic_libs/llama-.aar.br
    • dynamic_libs/llama-.aar
  • On refresh, clears unzip/optimized cache dirs so new code is loaded
  • Bumped LLAMA_LIB_VERSION to trigger rollout on existing installs

3) Assets generated/validated

Generated updated split assets and Brotli outputs:

  • assets/release/v8/dynamic_libs/llama-v8.aar.br (updated)
  • assets/release/v7/dynamic_libs/llama-v7.aar.br (new)
  • Split zip regeneration includes updated dynamic_libs/llama.aar:
    • app/build/outputs/assets/assets-arm64-v8a.zip
    • app/build/outputs/assets/assets-armeabi-v7a.zip

Validation performed

  • ./gradlew :app:bundleV8LlamaAssets :app:bundleV7LlamaAssets ✅
  • ./gradlew :app:assembleV8Assets ✅
  • Verified generated zip contains:
    • dynamic_libs/llama.aar
    • bootstrap.zip
    • android-sdk.zip
    • plugin-artifacts.zip
  • Deployed to Samsung device (arm64-v8a) at:
    • /sdcard/Download/assets-arm64-v8a.zip
  • Verified device file checksum matches local build checksum ✅

Why this is needed

Without these changes:

  • Debug builds may not consistently pick up refreshed llama assets.
  • Existing app installs can continue using stale extracted llama.aar even after updating bundled assets.

This PR ensures local LLM updates are reliably applied for both debug and release workflows using normal developer commands.

Ticket

ADFA-3105

@jatezzz jatezzz requested a review from a team February 11, 2026 14:51
@jatezzz jatezzz force-pushed the feat/llama.cpp-update branch from dd78752 to f484d97 Compare February 20, 2026 14:35
@jatezzz jatezzz changed the title Updated vendored llama.cpp to upstream master at commit 6a9bf2f7882394d74fc54a43764d47316b3f6aef. Wire debug llama asset bundling and add versioned dynamic AAR refresh for Local LLM Feb 26, 2026
@jatezzz jatezzz changed the title Wire debug llama asset bundling and add versioned dynamic AAR refresh for Local LLM ADFA-3105 - Wire debug llama asset bundling and add versioned dynamic AAR refresh for Local LLM Feb 26, 2026
@jatezzz jatezzz force-pushed the feat/llama.cpp-update branch from 29f2c8d to 5c0764e Compare March 4, 2026 14:18
@jatezzz jatezzz merged commit 394a561 into stage Mar 4, 2026
2 checks passed
@jatezzz jatezzz deleted the feat/llama.cpp-update branch March 4, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants