Overview of PocketPal AI Architecture
mainPocketPal AI operates on a four-layer stack designed for on-device inference:
| Layer | Components |
|---|---|
| UI & Tool Use | React Native app (React Native Paper, MobX, WatermelonDB). The AgentRunner manages chat turns, token streaming, and Talents (tools) dispatching. |
| Bridging | Native modules connecting JS to engines: llama.rn (LLM inference via JSI), react-native-speech, and onnxruntime-react-native (TTS). |
| Engine | llama.cpp (for GGUF language models) and ONNX Runtime (for ONNX TTS models). |
| Hardware | Targets CPU (fallback), GPU (Metal on iOS, OpenCL on Android), and NPU (Qualcomm Hexagon). |