Chat UI
ChatGPT-style interface with sidebar, session history, auto-titles, date grouping, search, and math rendering via KaTeX.
NativeLab Android Client
Run local LLMs on your Android phone. Chat with models, attach documents and images, get RAG-powered answers, and expose a LAN API server - all on-device, all private, all free forever.
Features
PhonoLab is not a thin wrapper around an API. It runs the full llama.cpp inference stack on your device with a polished native Android UI.
ChatGPT-style interface with sidebar, session history, auto-titles, date grouping, search, and math rendering via KaTeX.
Attach PDF, text, or DOCX files. Text is extracted, chunked with sliding window overlap, and relevant chunks are injected into your prompt.
Attach images from your gallery. Auto-detects vision models and pairs mmproj files. Supports Llama 3.2 Vision, LLaVA, and more.
Expose an OpenAI and Anthropic compatible API on your local network. SSE streaming, separate local/LAN API keys, configurable port.
Built-in catalog of small models optimized for mobile: SmolLM2 360M, Qwen 0.5B, Llama 3.2 1B, Qwen 1.5B, TinyLlama 1.1B.
17-layer error handling. JNI guards, lifecycle-safe UI updates, thread-safe date formatting, JSON parsing safety, body size limits.
Architecture
PhonoLab bundles llama-server as a native binary in the APK. At install time, Android extracts it to nativeLibraryDir. At runtime, JNI fork+execve starts the server - no W^X violations, no root needed.
Ecosystem
NativeLab runs on desktop (Linux, macOS, Windows). PhonoLab runs on Android. Both are local-first, privacy-first, and free forever under AGPL v3.
Desktop workbench with visual pipeline builder, Labs, MCP, integrations.
Chat, attachments, RAG, model catalog, LAN API server.
Subprocess wrapper, optional HF Transformers backend, Ollama bridge.
Bundled binary, fork+execve, no W^X issues, vision model support.
20+ node types, AI Builder, save/load JSON, native graph helpers.
PDF/text/DOCX extraction, sliding window chunking, keyword retrieval.
pip install nativelab, cross-platform.
APK install, arm64-v8a + armeabi-v7a.
Free and open source forever.
Free and open source forever.
Reliability
Every external call - JNI, network, file I/O, JSON parsing - is guarded. Fatal errors show a restart dialog. Non-fatal errors show a red banner that auto-dismisses. The app never crashes silently.
nativeLoaded flag. All native calls check the flag first. UnsatisfiedLinkError caught gracefully.
runOnUi{} checks isAdded before touching views. Worker executors shut down in onDestroyView.
ThreadLocal date formatters. @Volatile abort flag. Socket write guards for client disconnects.
optJSONObject() instead of getJSONObject(). Session logs capped at 500. renameTo() copy+delete fallback.
Get started
Open the Android project in Android Studio, or build from the command line. The APK bundles everything you need.
$ git clone https://github.com/7ZoneSystems/NativeLab.git $ cd NativeLab/PhonoLab/android
$ ./setup_binaries.sh
$ ./gradlew assembleDebug $ adb install app/build/outputs/apk/debug/app-debug.apk
License
Both NativeLab and PhonoLab are licensed under the GNU Affero General Public License v3. You can use, modify, and distribute them freely. If you run a modified version as a service, you must share the source code.
Full copyleft license. Guarantees the software and all derivatives remain free and open source. See the LICENSE file.
llama.cpp (MIT) ยท AndroidX (Apache 2.0) ยท Material 3 (Apache 2.0) ยท KaTeX (MIT). No proprietary dependencies.