Add an LLM to your Android app with Arm's AI Chat library
Introduction
Create the Android project
Configure the AI Chat library dependency
Create the UI layouts and message adapter
Implement the main activity logic
Download a model and run the app
Next Steps
Add an LLM to your Android app with Arm's AI Chat library
Overview
In this Learning Path you will create a chatbot Android app from scratch that loads a GGUF model and runs it in a conversational format.
The app uses Arm’s AI Chat library, available from Maven Central. The library provides an Android wrapper around llama.cpp with optimizations for Arm CPUs, delivering high-performance execution of LLM models in the GGUF format.
Reference implementations
For additional examples of chatbots using this library, you can explore:
- The Arm AI Chat app on Google Play , which demonstrates the performance and capabilities of mobile LLM models
- The AI Chat library GitHub example , which provides a slightly more feature-rich implementation
Create the project
Open Android Studio and create a new project of the type “Empty Views Activity”. Name it simpleaichat, and set the Minimum SDK to 33 (Android 13).
You now have an empty Android project ready for development. In the next section, you’ll add the AI Chat library dependency and configure the project to load the required native libraries.