A React Native mobile application for running LLaMA language models using ExecuTorch. This example is for iOS only for now.
- Run LLaMA models directly on device, build the UI using React Native
- Tested using Llama 3.2 SpinQuant 1B on iPhone 12 Pro
- The setup is heavily inspired by the etLLM app
- Node.js & yarn
- Xcode
-
Clone the repository:
git clone git@github.com:pytorch/executorch.git -
Navigate to the root of the repository:
cd executorch -
Pull submodules:
git submodule sync && git submodule update --init -
Install dependencies:
./install_executorch.sh && ./examples/models/llama/install_requirements.sh -
Follow the instructions in the README to export a model as
.pte -
Navigate to the example:
cd examples/demo-apps/react-native/rnllama -
Install dependencies:
yarn && cd ios && pod install && cd .. -
Run the app:
npx expo run:ios --device --configuration Releaseand select a USB connected iOS device -
Find the device in finder, and place the exported
.ptemodel and the downloaded tokenizer under the app -
Select the model and tokenizer in the app to start chatting:
