This release is a pre-release and may not be stable for production use.
termux-llamacpp
Universal GGUF Runtime, Model Manager & OpenAI-Compatible Local Server for Android Termux & ARM64
Notice: This project is an independent open-source tool and is not affiliated with or endorsed by Meta Platforms, Inc.
📌 Features
- 🚀 One-Click ARM64 Compilation: Auto-detects Android Termux hardware, NEON, FP16, and DotProd SIMD capabilities with
-O3compiler optimization flags. - 📦 GGUF Model Management & Safe Interrupt: Automatic streaming download from Hugging Face with SHA-256 checksum verification, unified model caching (
~/.termux-llama/models/), and explicitModelNotFoundErrorinterrupts. - 🌐 Zero-Config OpenAI Server: Built-in supervisor for
llama-serverexposing/health,/v1/models, and/v1/chat/completions(streaming SSE & JSON). - 🔍 Hugging Face Discovery & Playwright Bridge: Search models directly from CLI/SDK, with optional deep crawling powered by
termux-playwright. - 🔗 Seamless Ecosystem Interoperability: Plug-and-play with
termux-aichainviaLocalAgent.create(mode="connect", endpoint="http://127.0.0.1:8080").
⚡ Quick Start
1. Installation
# Python
pip install termux-llamacpp
# Node.js
npm install termux-llamacpp
2. Python SDK
from termux_llamacpp import LlamaRuntime
# 1. Initialize runtime
runtime = LlamaRuntime.install(preset="android-arm64")
# 2. Download curated model preset
model_path = runtime.models.download("qwen2.5-1.5b-instruct")
# 3. Start local OpenAI-compatible server
server = runtime.serve(
model="qwen2.5-1.5b-instruct",
host="127.0.0.1",
port=8080
)
print(f"OpenAI API Server is ready at {server.endpoint}")
3. Connection with termux-aichain
from termux_aichain import LocalAgent
agent = LocalAgent.create(
mode="connect",
endpoint="http://127.0.0.1:8080"
)
response = agent.run("Analyze Android system memory and optimize background processes.")
print(response)
🛠️ CLI Usage
# System and hardware diagnostic
termux-llama doctor
# List curated models
termux-llama models
# Search Hugging Face
termux-llama find "qwen2.5 gguf"
# Download model
termux-llama download qwen2.5-1.5b-instruct
# Start server
termux-llama serve qwen2.5-1.5b-instruct --port 8080
📄 License
Licensed under the Apache License, Version 2.0.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file termux_llamacpp-1.0.0b1.tar.gz.
File metadata
- Download URL: termux_llamacpp-1.0.0b1.tar.gz
- Upload date:
- Size: 218.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8d59b2d61cd14d7d1660d2f49d72e1f69a206116213d3cc084f9d1c6abd405c
|
|
| MD5 |
0dba40cefcad1f3a959517072721b926
|
|
| BLAKE2b-256 |
a47405c55eb77b72ca197de2212db253f27d3b115d31077be9d1458ad952aaa2
|
File details
Details for the file termux_llamacpp-1.0.0b1-py3-none-any.whl.
File metadata
- Download URL: termux_llamacpp-1.0.0b1-py3-none-any.whl
- Upload date:
- Size: 120.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5dbfd785247886e9b6fc9f24105b243001cf2ce890d7b7687fbc3f0b8dfaa1e6
|
|
| MD5 |
d03ee7a4c708cb1949410bcbce150c5c
|
|
| BLAKE2b-256 |
749eb12b44aa20066189eaaeb98bb126dca9970b8be0ba90d33dae363e31a133
|