a-ghorbani/pocketpal-ai

An app that brings language models directly to your phone.

PocketPal AI – an on‑device AI chat assistant

What it is – PocketPal AI is a free, open‑source mobile app (iOS & Android) that lets you talk to large language models, hear them speak, and give them simple tools (calculator, date‑time, HTML rendering) – all without ever leaving your phone. The app downloads a GGUF‑format model from Hugging Face once, then runs inference locally using the phone’s CPU, GPU (Metal/OpenCL) or NPU (Qualcomm Hexagon). No cloud account, no subscription, and everything stays private unless you explicitly share benchmark results or feedback.


Core features

Feature What you get
On‑device chat Run popular LLMs (Gemma, Qwen, Phi, Llama, etc.) offline in GGUF format.
Neural TTS On‑device text‑to‑speech (Kokoro and other ONNX models) – no internet calls.
Pals & PalsHub Create or download personalized “assistants” with custom prompts, personalities, and even role‑play settings.
Tool use (Talents) Models can call built‑in tools (calculator, date‑time, HTML renderer) via a tool‑use loop.
Hardware acceleration Inference can use CPU, GPU (Metal on iOS, OpenCL on Android) or NPU; the app falls back gracefully.
Benchmark & leaderboard Measure tokens‑per‑second and memory usage; optionally submit results to the public AI‑Phone leaderboard.
Localization UI available in 11 languages; full iPad support.
Open‑source & free MIT‑licensed, no hidden “pro” tier.

How it works (high‑level)

  1. UI layer – React Native app (React Native Paper, MobX state, WatermelonDB for chat history). The AgentRunner streams model tokens and dispatches Talents when the model requests them.
  2. Bridging layer – Native modules expose llama.cpp inference (llama.rn) and ONNX‑Runtime TTS to JavaScript.
  3. Engine layer – llama.cpp runs quantized GGUF LLMs; ONNX Runtime runs neural‑TTS models.
  4. Hardware layer – Math is executed on the device’s CPU, GPU (Metal/OpenCL), or NPU (Qualcomm Hexagon) with automatic fallback.

Getting started as a user

  1. Install from the App Store or Google Play.
  2. Open the app → Menu ☰ → Models → pick a model that fits your device’s memory and download it (or add one from Hugging Face with a personal token).
  3. Load the model and start chatting. You can enable voice output, switch between Pals, or run the benchmark screen.

Getting started as a developer

  • Prerequisites – Node 22 (via .nvmrc), Yarn 1, Xcode + CocoaPods (iOS) or Android Studio (Android). The repo follows a standard React‑Native layout.
  • Build – git clone … && nvm use && yarn install && (cd ios && pod install) then yarn ios or yarn android.
  • Code structure –
    • src/screens – UI pages (Chat, Models, Pals, Benchmark, Settings).
    • src/services/agent – AgentRunner implements the chat‑tool loop.
    • src/services/talents – built‑in tools; add new ones by implementing a TalentEngine and registering it.
    • src/services/tts – TTS engines; extendable with additional ONNX models.
    • src/store – MobX stores for models, chat sessions, settings, etc.
  • Quality gates – yarn lint, yarn typecheck, yarn test must pass before PRs.
  • Extending – Add new Talents, TTS engines, or locales (JSON files under src/locales).

Who might benefit?

  • Privacy‑conscious users who want a conversational AI that never uploads data.
  • Travelers / field workers needing offline AI on a plane or remote location.
  • Developers interested in on‑device LLM inference, hardware acceleration, or building custom AI‑powered assistants.

License & community

  • License – MIT.
  • Support – GitHub Discussions, Issues, the website pocketpal.dev, and optional sponsorship via GitHub Sponsors.
  • Acknowledgements – Built on llama.cpp, llama.rn, ONNX Runtime, React‑Native, MobX, WatermelonDB, and many other open‑source libraries.

Bottom line – PocketPal AI demonstrates that modern quantized LLMs can run fully offline on a smartphone, offering a private, extensible AI assistant without any recurring fees.

Related

  • Project
  • Project
  • Project
  • Project
  • Project