# LLM Hub πŸ€– **LLM Hub** is an open-source mobile app for on-device LLM chat, image generation, video generation, and music generation, available for both **Android** and **iOS**. It's optimized for mobile usage (CPU/GPU/NPU acceleration) and supports multiple model formats so you can run powerful models locally and privately. 🌟 **Featured:** Featured by **RunAnywhere** on their website β€” read the [LLM Hub iOS Case Study](https://www.runanywhere.ai/blog/llm-hub-ios-case-study)! ## Download
**πŸ’» Desktop Versions Coming:** Windows and macOS native apps are planned, bringing desktop-class experiences with advanced cursor integration and Claude Code–like capabilities. ## πŸ“Έ Demo & Screenshots | Vibe Coder Demo on iOS | Image Generation on Android | | :-: | :-: | | | | | Vibe Coder using Gemma 4 model on iPhone (HTML preview) | Stable Diffusion image generation on Android | | AI Agent Termux Command Execution on Android | Music Generation on iOS | | :-: | :-: | | | | | Autonomous AI Agent executing Termux shell commands (`ls` list files) with live terminal output on Android | On-device music generation with Magenta Realtime 2 on iPhone | ## πŸš€ Features ### πŸ› οΈ AI Tools Suite | Tool | Description | |------|-------------| | **πŸ’¬ Chat** | Multi-turn conversations with RAG memory, web search, TTS auto-readout, and multimodal input | | **πŸ€– AI Agent** | **[NEW]** Autonomous device agent with function calling, interactive maps, device tools, MCP tools, and Termux terminal command generation on Android | | **πŸ€– creAItor** | **[NEW]** Design custom AI personas with specialized system prompts (PCTF) in seconds | | **πŸ’» Vibe Coder** | **[NEW]** Build apps with live HTML/JS preview; Android also integrates Codex through Termux using your selected local model | | **✍️ Writing Aid** | Summarize, expand, rewrite, improve grammar, or generate code from descriptions | | **🎨 Image Generator** | Create images from text prompts using Stable Diffusion 1.5 with swipeable gallery | | **🎡 Music Generator** | **[NEW]** Generate music and sound effects locally with SoundGen on Android and Magenta Realtime 2 on iOS, including live playback as music is generated | | **πŸ”Ž Instant Media Search** | **[NEW]** Search photos and videos by description or a reference image on Android and iOS using on-device EmbeddingGemma 2 | | **🎞️ Video Moment Finder** | **[NEW]** Describe a moment in a video and jump to matching timestamps using visual and audio embeddings on Android and iOS | | **πŸ”Š Text to Speech & Voice Cloning** | Android supports Kokoro, multilingual Supertonic 3 with voice-profile import, and Pocket TTS with on-device voice cloning | | **πŸ” Image Upscale** | **[NEW]** Upscale images up to 4Γ— using AI super-resolution models (RealESRGAN, UltraSharp) with NPU acceleration | | **πŸŽ₯ Video Generator** | **[NEW]** Generate videos from text prompts or images: LTX-Video on Android (Snapdragon NPU, Vulkan GPU or CPU), Stable Video Diffusion on iOS | | **🌍 Translator** | Translate text, images (OCR), and audio across 50+ languages - offline | | **πŸŽ™οΈ Transcriber** | Convert speech to text with on-device processing using Whisper models | | **πŸ›‘οΈ Scam Detector** | Analyze messages and images for phishing with risk assessment | | **πŸ—£οΈ VibeVoice** | **[NEW]** Hands-free AI voice chat | ### πŸ€– AI Agent & Termux Terminal Command Generation The **AI Agent** turns on-device LLMs into autonomous assistants with device function calling capabilities: - **Device Actions & Function Calling**: Embedded interactive maps (OpenStreetMap), calendar management, alarm setup, flashlight toggle, SMS & Email composition, cryptographic hashing (SHA-256/MD5), and math calculation. - **MCP Tools**: Connect Model Context Protocol (MCP) servers so the Agent can discover and use external tools such as filesystem, search, document, memory, or custom hosted tools. MCP calls require user approval before execution. - **Termux Command Generation (Android)**: Automatically drafts shell/CLI commands targeting Termux environment execution (`RUN_COMMAND_SERVICE` intent interface). - **Interactive Pre-Execution Editing**: Users can inspect and edit AI-generated shell commands before execution. - **Live Dark Terminal Container**: Formats and streams live command outputs (`stdout`/`stderr`) in a dark monospace terminal UI block. - **AI Error Auto-Correction Loop**: When a shell command fails or encounters permission/syntax errors, the agent automatically feeds the error logs back into the LLM for self-diagnostics and auto-generates fix commands. ### πŸŽ™οΈ Supported ASR Models (Android) The offline **Transcriber** feature on Android supports on-device Whisper models for high-accuracy local speech-to-text. ### πŸ”Š Android Text to Speech & Voice Cloning - **Kokoro**: Local speech with downloadable voices managed in Settings. - **Supertonic 3**: Multilingual on-device speech with downloadable presets and import of compatible voice-style JSON files. Raw audio cloning and Pocket TTS voice states are not supported by Supertonic's importer. See [Supertonic 3 setup](android/docs/supertonic-3.md). - **Pocket TTS**: English speech and fully local voice cloning from recorded or imported audio. Manage, select, rename and delete cloned voices in Settings. Cloning uses 3–30 seconds of reference audio; longer imports use their first 30 seconds. See [Pocket TTS setup](android/docs/pocket-tts.md). - Selecting an engine and voice in Settings applies it to app-wide speech and auto-readout. Translator keeps system TTS. ### πŸ”Ž Media Search & Video Moment Finder On Android and iOS, **Instant Media Search** uses EmbeddingGemma 2 to index photos and videos locally, then find matches from a text description or reference image. **Video Moment Finder** combines video frames and audio from two-second windows so you can search for a scene or event and play the matching moment. Download a compatible EmbeddingGemma 2 model and choose the media to index; search runs on-device. ### πŸ’» Android Vibe Coder & Codex Enable **Codex mode** in Vibe Coder's model settings to use the selected on-device model with the Codex app server running in Termux. Codex can inspect project files, edit code and run project commands, with streamed activity and terminal output in the app. This mode requires an ARM64 device running Android 10 or newer and does not require an OpenAI login. Install Termux, allow external app commands, grant LLM Hub permission to run Termux commands, and use the in-app **Install Codex** action before starting. ### πŸŽ₯ Android Video Generation The Android Video Generator runs [Lightricks LTX-Video 2B 0.9.8 distilled](https://huggingface.co/Lightricks/LTX-Video) fully on-device, from a text prompt or a starting image, in 8 denoising steps. - **Snapdragon NPU**: The transformer and VAE decoder run on the Hexagon NPU as QNN context binaries, one build per Hexagon generation: v69 (8 Gen 1, 8+ Gen 1), v73 (8 Gen 2), v75 (8 Gen 3), v79 (8 Elite) and v81 (8 Elite Gen 5), plus an integer-only v73 build for chips whose NPU has no FP16 (8s Gen 4, 8s Gen 3, 7+ Gen 3, 7 Gen 4). A 25-frame 768x512 clip takes about 25 seconds on a Snapdragon 8 Elite; v69 and v73 chips generate at 512x320. Models: [timmyboy26/LTX-Video-2B-0.9.8-distilled-QNN](https://huggingface.co/timmyboy26/LTX-Video-2B-0.9.8-distilled-QNN). - **Other chips**: GGUF models (Q4_0 / Q8_0) run through stable-diffusion.cpp with Vulkan on the GPU, or on the CPU. A 25-frame 512x320 clip takes about 3 minutes on an Exynos 1580 (Galaxy A56) and about 20 minutes on a Tensor G3 (Pixel 8 Pro). - Open **Video Generator**, download a model from the Video Generation tab, and choose the model and backend in the settings sheet. Detailed prompts that describe the subject, action, camera and lighting work best. - The scripts that build the NPU models are in [android/tools/ltxv_qnn](android/tools/ltxv_qnn). ### 🎡 iOS Live Music Generation The iOS Music Generator supports **Live generation** with Magenta Realtime 2: hear audio as it is generated while the app writes it to a local file. Enable **Unlimited duration** to keep generating until you press Stop, or use a fixed duration. Fixed-duration output uses WAV; unlimited sessions use CAF for long recordings. ### πŸ” Privacy First - **100% on-device processing** - no internet required for inference - **Zero data collection** - conversations never leave your device - **No accounts, no tracking** - completely private - **Open-source** - fully transparent ### ⚑ Advanced Capabilities - GPU/NPU acceleration for fast performance - Text-to-Speech with auto-readout - RAG with global memory for enhanced responses - Import custom models (.task, .litertlm, qnn,.mnn, .gguf) - Direct downloads from HuggingFace - 17 language interfaces ## 🚧 Upcoming Features & Roadmap ### Desktop Expansion (Windows & macOS) - **Advanced Vibe Coder** β€” Enhanced code generation with desktop IDE integration, cursor control, and Claude Code–like experiences - **OpenClaw-like Agent** β€” Autonomous tool-using agent framework for complex multi-step tasks - **Advanced Media Generation** β€” Professional-grade image/video synthesis with ComfyUI/Draw Things feature parity and extended controls Quick Start 1. Download from **Google Play** or the **App Store**, or build from source 2. Open Settings β†’ Download Models β†’ Download or Import a model 3. Select a model and start chatting or generating images Technology - **Android**: Kotlin + Jetpack Compose (Material 3), [GenieX SDK](https://github.com/qualcomm/GenieX) (for LLM and VLM inference), [WhisperKit](https://github.com/argmaxinc/WhisperKitAndroid) (for ASR) - **iOS**: Swift + SwiftUI, [Run Anywhere SDK](https://github.com/RunanywhereAI/runanywhere-sdks), [Draw Things (MediaGenerationKit)](https://drawthings.ai/), Apple Foundation Model, [whisper.cpp](https://github.com/ggml-org/whisper.cpp) for on-device ASR - **LLM & ASR Runtime**: MediaPipe, LiteRT, GenieX SDK (GGUF on Android), WhisperKit (ASR with TFLite + QNN NPU on Android), Llama.cpp (via [Run Anywhere SDK](https://github.com/RunanywhereAI/runanywhere-sdks) on iOS), whisper.cpp on iOS for transcription - **Image & Video Gen**: [Draw Things (MediaGenerationKit)](https://drawthings.ai/) (iOS), Qualcomm QNN (Android), [stable-diffusion.cpp](https://github.com/leejet/stable-diffusion.cpp) with LTX-Video on the Hexagon NPU (QNN), Vulkan or CPU (Android video) - **Music Gen**: Magenta Realtime 2 with MLX/LiteRT (iOS), SoundGen with LiteRT (Android) - **Media Search**: EmbeddingGemma 2 for local media indexing and video moment retrieval (Android and iOS) - **Android TTS**: Kokoro, Supertonic 3 with ONNX Runtime, and PocketTTS.cpp with an NDK/JNI integration for local voice cloning - **Android Coding Agent**: Codex app server in Termux, connected to the app's local model through a loopback inference server Acknowledgments - [GenieX SDK](https://github.com/qualcomm/GenieX) β€” GGUF model inference support (credit shown in-app About) ⚑ - [WhisperKit](https://github.com/argmaxinc/WhisperKitAndroid) β€” On-device ASR with TFLite + NPU acceleration - [whisper.cpp](https://github.com/ggml-org/whisper.cpp) β€” On-device ASR/transcription support on iOS - [Run Anywhere SDK](https://github.com/RunanywhereAI/runanywhere-sdks) β€” iOS model runtime and LLM execution framework πŸš€ - [Draw Things](https://drawthings.ai/) β€” iOS image and video generation engine (MediaGenerationKit) 🎨 - [PocketTTS.cpp](https://github.com/VolgaGerm/PocketTTS.cpp) β€” Android local speech and voice cloning integration - [Supertone Supertonic 3](https://huggingface.co/Supertone/supertonic-3) β€” Multilingual on-device TTS and voice presets - [Lightricks LTX-Video](https://huggingface.co/Lightricks/LTX-Video) β€” Android video generation model (LTX-Video Open Weights License) - [stable-diffusion.cpp](https://github.com/leejet/stable-diffusion.cpp) β€” Android video generation runtime, extended with LTX-Video 0.9 and a QNN backend - [calcuis/ltxv-gguf](https://huggingface.co/calcuis/ltxv-gguf) β€” GGUF builds of LTX-Video, T5-XXL and the VAE - **Google, OpenAI, Meta, Microsoft, IBM, LiquidAI, Mistral, Primsm ML, HuggingFace** β€” model and tooling contributions Development Setup ### Android local development (Android Studio + Gradle) ```bash git clone https://github.com/timmyy123/LLM-Hub.git cd LLM-Hub/android ./gradlew assembleDebug ./gradlew installDebug ``` ### Android-only local configuration #### Setting up Hugging Face Token for Development To use private or gated models, add your HuggingFace token to `android/local.properties` (do NOT commit this file): ```properties HF_TOKEN=hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` Save and sync Gradle in Android Studio; the app will read `BuildConfig.HF_TOKEN` at build time. #### Dev Premium Flag To skip ads and unlock all premium features locally without a real IAP purchase, add this to `android/local.properties`: ```properties DEBUG_PREMIUM=true ``` Set it back to `false` before making a production build. #### Model License Acceptance Some models on HuggingFace (especially from Google and Meta) require explicit license acceptance before downloading. When building the app locally: 1. Ensure you have a valid HuggingFace read token in `local.properties` (see above) 2. **For each model you want to download:** - Visit the model's HuggingFace page (e.g., https://huggingface.co/google/gemma-3n-E2B-it-litert-lm) - Click the "Access repository" or license acceptance button - Grant consent to the model's license terms - Try downloading the model in the app again **Note:** This is only required for local development builds. The Play Store version uses different authentication and does not require manual license acceptance for each model. ### iOS local development (macOS + Xcode) #### Prerequisites - macOS with Xcode installed (use a version that matches your iOS device version) - An Apple ID signed into Xcode (free Personal Team works for local device testing) - iPhone with Developer Mode enabled if you run on real hardware #### Build and run on iPhone 1. Clone the repo and open the iOS project: ```bash git clone https://github.com/timmyy123/LLM-Hub.git cd LLM-Hub open ios/LLMHub/LLMHub.xcodeproj ``` 2. In Xcode, select target **LLMHub** β†’ **Signing & Capabilities**: - Set your **Team** - Set a unique **Bundle Identifier** (for example: `com.yourname.llmhub`) - Keep **Automatically manage signing** enabled 3. Select your iPhone as the run destination and press **Run**. #### If you use Xcode beta If your phone is on a newer iOS build and requires Xcode beta support, switch CLI tools: ```bash sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer xcodebuild -version ``` #### iOS TTS voice troubleshooting **TTS falls back to a robotic default voice after changing Siri voices** iOS can get into a state where the system TTS voice cache doesn't update after a Siri voice change, causing the app to fall back to the old default voice. To fix: 1. Go to **Settings β†’ Accessibility β†’ Spoken Content β†’ Voices** 2. Tap your language and select any voice (even a different one) 3. Switch back to your preferred Siri voice or whichever voice you want This forces iOS to refresh the voice selection and the app will use the correct voice immediately. #### Useful iOS dev troubleshooting - If signing fails, re-check Team + Bundle Identifier in target settings. - If build cache acts stale, clean DerivedData: ```bash rm -rf ~/Library/Developer/Xcode/DerivedData/LLMHub-* ``` - Build logs: **Report Navigator** (`Cmd+9`) - Runtime logs: **Debug Console** (`Cmd+Shift+Y`) Contributing - Fork β†’ branch β†’ PR. See CONTRIBUTING.md (or open an issue/discussion if unsure). License - Source code is licensed under the [PolyForm Noncommercial License 1.0.0](LICENSE). - You are free to use, study, and build on this project for non-commercial purposes. - **Commercial use β€” including distributing the app, charging for it, or monetizing it with ads or IAP β€” is not permitted without explicit written permission from the author.** - Contact timmy@llm-hub.app for commercial licensing enquiries. Support - Email: timmy@llm-hub.app - Issues & Discussions: GitHub Notes - This README is intentionally concise β€” consult `ModelData.kt` for exact model variants, sizes, and format details.