Build a customer support chatbot on Android with Llama and ExecuTorch
Introduction
Create a development environment
Set up ExecuTorch
Understand Llama models
Prepare Llama models for ExecuTorch
Run the chatbot on Android
Build and run the Android chat app
Next Steps
Build a customer support chatbot on Android with Llama and ExecuTorch
Who is this for?
This is an introductory topic for software developers interested in building an on-device customer support chatbot for Android using Meta's Llama models and the ExecuTorch runtime.
What will you learn?
Upon completion of this Learning Path, you will be able to:
- Set up a development environment for building and deploying ExecuTorch-based apps on Android
- Describe how ExecuTorch uses KleidiAI kernels to accelerate performance on Arm-based platforms
- Export a Llama 3.2 model to .pte format optimized for on-device inference
- Run a Llama model on an Arm-powered Android phone and verify inference performance
- Build and run an Android chat app configured as a customer support assistant
Prerequisites
Before starting, you will need the following:
- An Apple M1/M2/M3 development machine, or a Linux machine with at least 16GB of RAM
- An Arm-powered smartphone with the i8mm feature running Android, with 16GB of RAM
- A USB cable to connect your smartphone to your development machine
- Android Debug Bridge (adb) installed. Follow the steps in adb to install Android SDK Platform Tools
- Java 17 JDK. Follow the steps in Java SE 17 Archive Downloads to download and install JDK for your host
- Python 3.10 or later
- A Hugging Face account with access to Meta Llama models
Summary
This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
.pte. Finally, you’ll cross-compile the runner with the Android NDK and enable KleidiAI through XNNPACK, then deploy to an Arm phone and run inference.Frequently asked questions
These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
.pte file. This format is optimized for on-device inference and is loadable by the ExecuTorch runtime.ANDROID_NDK is set to the correct path and that build/cmake/android.toolchain.cmake exists there. Also confirm your ExecuTorch dependencies are installed in the Python environment.