Skip to content

Commit cd3c996

Browse files
committed
[Android] Introducing mlc4j and app packaging
This PR lifts the existing `library` of android app into a standalone `mlc4j` directory, which can be referenced by android app at any location. On the app side, this PR moves the android app into a subfolder `MLCChat` which itself is a well-formed Android app. This folder contains two core files for app build: * `MLCChat/mlc-package-config.json` the config file that specifies the models to build into the app. * `MLCChat/prepare_package.py` the Python script that helps automatically prepare/build mlc4j and model libraries. This PR also updates the android app documentation to reflect this latest change.
1 parent 33c15e7 commit cd3c996

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+931
-448
lines changed

android/MLCChat/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# MLC-LLM Android
2+
3+
Checkout [Documentation page](https://llm.mlc.ai/docs/deploy/android.html) for more information.
4+
5+
- run `prepare_package.py`
6+
- open this `MLCChat/` folder as a project in Android Studio
File renamed without changes.

android/app/build.gradle renamed to android/MLCChat/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ android {
4747
}
4848

4949
dependencies {
50-
implementation project(":library")
50+
implementation project(":mlc4j")
5151
implementation 'androidx.core:core-ktx:1.10.1'
5252
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
5353
implementation 'androidx.activity:activity-compose:1.7.1'
File renamed without changes.

android/app/src/main/java/ai/mlc/mlcchat/AppViewModel.kt renamed to android/MLCChat/app/src/main/java/ai/mlc/mlcchat/AppViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class AppViewModel(application: Application) : AndroidViewModel(application) {
3838
private val modelIdSet = emptySet<String>().toMutableSet()
3939

4040
companion object {
41-
const val AppConfigFilename = "app-config.json"
41+
const val AppConfigFilename = "mlc-app-config.json"
4242
const val ModelConfigFilename = "mlc-chat-config.json"
4343
const val ParamsConfigFilename = "ndarray-cache.json"
4444
const val ModelUrlSuffix = "resolve/main/"

0 commit comments

Comments
 (0)