Feat: Migrate to unified KleidiAI build and direct internal model downloads - #137
Open
afalefesifiofo wants to merge 2 commits into
Open
afalefesifiofo wants to merge 2 commits into
afalefesifiofo wants to merge 2 commits into
Conversation
added 2 commits
September 16, 2026 14:48
…and standard LLMRunner - Consolidate CMake build to a single arm64-v8a target using KleidiAI native dispatch. - Downgrade kotlin serialization to 2.0.0 across modules to match KSP version. - Remove redundant LLM-Runner submodule and implement LLMRunner abstraction locally. - Simplify SmolLM.kt and LLMInference.cpp by delegating core inference loop to LLMRunner.
- Refactor DownloadModelsViewModel to use internal Ketch DownloadService. - Models now download directly to app's internal filesDir, preventing duplicate storage. - Automate GGUF metadata extraction and Room DB model registration upon download completion. - Add TTFT (Time To First Token) metric and cache warmup pass to C++ bench_model.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR significantly improves the C++ architecture and Android integration for LLM inference in SmolChat.
Changes Included:
arm64-v8atarget. The runtime now uses KleidiAI micro-kernels to dynamically dispatch to the best matrix multiplication operations (SVE, DotProd, i8mm, Neon) based on the device's CPU topology.llm-runnersubmodule and implemented a clean, standardizedLLMRunnerabstraction locally in C++.2.0.0to cleanly match the base KSP version requirements.DownloadManagerwith the internalKetchdownloader. Models are now downloaded directly into the app'sfilesDir. This completely eliminates the need for the Android File Picker and prevents 1.5GB models from being duplicated across internal and shared storage.bench_modelJNI implementation by adding an initial cache warmup pass (producing more reliable throughput numbers) and explicitly printing the Time To First Token (TTFT) in milliseconds.