{"id":29803482,"url":"https://github.com/dylibso/chicory-compiler-android","last_synced_at":"2026-02-06T09:03:47.318Z","repository":{"id":304133800,"uuid":"1017395648","full_name":"dylibso/chicory-compiler-android","owner":"dylibso","description":"Wasm to Dalvik/ART Compiler for Android","archived":false,"fork":false,"pushed_at":"2025-07-11T15:24:32.000Z","size":7,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-28T11:14:40.799Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://blog.evacchi.dev/posts/2025/07/11/wasm-the-hard-way-porting-the-chicory-compiler-to-android/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dylibso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-10T13:19:37.000Z","updated_at":"2025-07-13T15:08:17.000Z","dependencies_parsed_at":"2025-07-11T11:44:48.593Z","dependency_job_id":"70d658fc-1ef6-4fae-bce8-bd70bdeb6831","html_url":"https://github.com/dylibso/chicory-compiler-android","commit_stats":null,"previous_names":["dylibso/chicory-compiler-android"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dylibso/chicory-compiler-android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylibso%2Fchicory-compiler-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylibso%2Fchicory-compiler-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylibso%2Fchicory-compiler-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylibso%2Fchicory-compiler-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dylibso","download_url":"https://codeload.github.com/dylibso/chicory-compiler-android/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylibso%2Fchicory-compiler-android/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29156402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T07:18:23.844Z","status":"ssl_error","status_checked_at":"2026-02-06T07:13:32.659Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-28T11:08:42.703Z","updated_at":"2026-02-06T09:03:47.272Z","avatar_url":"https://github.com/dylibso.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Experimental Chicory Android Compiler\n\n## Installing\n\nThe experimental Chicory Android compiler is currently available through the [GitHub Package Registry](https://docs.github.com/en/enterprise-server@3.15/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry).\n\n### Gradle\n\n\nIn your `settings.gradle.kts`:\n\n```kotlin\nrepositories {\n    maven {\n        url = uri(\"https://maven.pkg.github.com/dylibso/chicory-compiler-android\")\n        credentials {\n            username = project.findProperty(\"gpr.user\") as String? ?: System.getenv(\"USERNAME\")\n            password = project.findProperty(\"gpr.key\") as String? ?: System.getenv(\"TOKEN\")\n        }\n    }\n}\n```\n\nwhere USERNAME is your GitHub username, and TOKEN is a [Classic Token](https://github.com/settings/tokens). You can configure them in your `gradle.properties` or set the `USERNAME` and `TOKEN` environment variables.\n\nThen add the dependency to your `build.gradle.kts`:\n\n```\ndependencies {\n    implementation(\"com.dylibso.chicory:android-aot:0.0.1\")\n}\n```\n\n### Maven\n\n[Configure Maven](https://docs.github.com/en/enterprise-server@3.15/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry). \nCreate a `settings.xml` file alongside your `pom.xml` or just add to your `~/.m2/settings.xml`:\n\n```xml\n\u003csettings xmlns=\"http://maven.apache.org/SETTINGS/1.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/SETTINGS/1.0.0\n                      http://maven.apache.org/xsd/settings-1.0.0.xsd\"\u003e\n\n  \u003cactiveProfiles\u003e\n    \u003cactiveProfile\u003egithub\u003c/activeProfile\u003e\n  \u003c/activeProfiles\u003e\n\n  \u003cprofiles\u003e\n    \u003cprofile\u003e\n      \u003cid\u003egithub\u003c/id\u003e\n      \u003crepositories\u003e\n        \u003crepository\u003e\n          \u003cid\u003ecentral\u003c/id\u003e\n          \u003curl\u003ehttps://repo.maven.apache.org/maven2\u003c/url\u003e\n        \u003c/repository\u003e\n        \u003crepository\u003e\n          \u003cid\u003egithub\u003c/id\u003e\n          \u003curl\u003ehttps://maven.pkg.github.com/dylibso/chicory-compiler-android\u003c/url\u003e\n          \u003csnapshots\u003e\n            \u003cenabled\u003etrue\u003c/enabled\u003e\n          \u003c/snapshots\u003e\n        \u003c/repository\u003e\n      \u003c/repositories\u003e\n    \u003c/profile\u003e\n  \u003c/profiles\u003e\n\n  \u003cservers\u003e\n    \u003cserver\u003e\n      \u003cid\u003egithub\u003c/id\u003e\n      \u003cusername\u003eUSERNAME\u003c/username\u003e\n      \u003cpassword\u003eTOKEN\u003c/password\u003e\n    \u003c/server\u003e\n  \u003c/servers\u003e\n\u003c/settings\u003e\n```\n\nwhere USERNAME is your GitHub username, and TOKEN is a [Classic Token](https://github.com/settings/tokens).\n\nNow you can depend on the package in your `pom.xml`:\n\n```\n\u003cdependencies\u003e\n \u003cdependency\u003e\n    \u003cgroupId\u003ecom.dylibso.chicory\u003c/groupId\u003e\n    \u003cartifactId\u003eandroid-aot\u003c/artifactId\u003e\n    \u003cversion\u003e0.0.1\u003c/version\u003e\n  \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\nIf you are using a local `settings.xml`, just run `mvn -s settings.xml \u003ccommand\u003e`.\n\n\n## Using the Android Chicory Compiler\n\nOnce you have the `com.dylibso.chicory:android-aot` dependency in your classpath, [you only need to plug the `MachineFactory`.](https://chicory.dev/docs/usage/runtime-compiler)\n\n```java\nimport com.dylibso.chicory.compiler.MachineFactoryCompiler;\nimport com.dylibso.chicory.wasm.Parser;\nimport com.dylibso.chicory.wasm.WasmModule;\nimport com.dylibso.chicory.experimental.android.aot.AotAndroidMachine;\n\nvar module = Parser.parse(new File(\"your.wasm\"));\nvar instance = Instance.builder(module).\n        withMachineFactory(AotAndroidMachine::new).\n        build();\n```\n\nBecause of the memory and stack limitations on the main Android thread, we strongly advise to initialize and invoke the instance on its own thread, with a generous amount of stack memory:\n\n```\nRunnable r = () -\u003e instance.call(...);\nThread t = new Thread( new ThreadGroup(\"chicory\"), r, \"chicory-thread\", 8 * 1024 * 1024) )\n```\n\n## Using the Android Chicory Compiler with Extism\n\nThe `Extism` Chicory SDK supports the Android compiler extension since version `0.2.0`. In this case, you will write:\n\n```java\n        var path = Path.of(\"https://github.com/extism/plugins/releases/download/v1.1.1/count_vowels.wasm\");\n        var wasm = ManifestWasm.fromFilePath(path).build();\n        var manifest = Manifest.ofWasms(wasm)\n                .withOptions(new Manifest.Options()\n                        .withMachineFactory(AotAndroidMachine::new)).build();\n        var plugin = Plugin.ofManifest(manifest).build();\n```\n\nBecause of the memory and stack limitations on the main Android thread, we strongly advise to initialize and invoke the plugin on its own thread, with a generous amount of stack memory:\n\n```\nRunnable r = () -\u003e plugin.call(...);\nThread t = new Thread( new ThreadGroup(\"chicory\"), r, \"chicory-thread\", 8 * 1024 * 1024) )\n```\n\n\n## Using the Android Chicory Compiler with `mcpx4j`\n\nThe `mcpx4j` library to run [mcp.run](mcp.run) tools on-device, is built on Extism and it also supports the Android AOT compiler.\nIn this case, you will write something like:\n\n```kotlin\n        val mcpx =\n            // Configure the MCP.RUN Session\n            Mcpx.forApiKey(BuildConfig.mcpRunKey)\n                .withServletOptions(\n                    McpxServletOptions.builder()\n                        .withMachineFactory{ AotAndroidMachine(it) }\n                        // Setup an HTTP client compatible with Android\n                        // on the Chicory runtime\n                        .withChicoryHttpConfig(AndroidHttpConfig.get())\n                        // Configure an alternative, Android-specific logger\n                        .withChicoryLogger(AndroidLogger(\"mcpx4j-runtime\"))\n                        .build())\n                // Configure also the MCPX4J HTTP client to use\n                // the Android-compatible implementation\n                .withHttpClientAdapter(HttpUrlConnectionClientAdapter())\n                .withProfile(BuildConfig.profile)\n                .build()\n```\n\nBecause of the memory and stack limitations on the main Android thread, we strongly advise to initialize and invoke the plugin on its own thread, with a generous amount of stack memory; for instance:\n\n```kotlin\n    val service = Executors.newSingleThreadExecutor {\n        Thread(ThreadGroup(\"chicory\"), it, \"chicory-thread\", 8 * 1024 * 1024) }\n\n      val call: Callable\u003cString\u003e = Callable { tool.call(input) }\n      val res: String = service.submit(call).get()\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylibso%2Fchicory-compiler-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdylibso%2Fchicory-compiler-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylibso%2Fchicory-compiler-android/lists"}