termux-llamacpp
Universal GGUF Runtime, Model Manager & OpenAI Server for Android Termux & ARM64
The Edge LLM Challenge
Cross-compiling native llama.cpp for mobile ARM64 without SIGILL illegal instruction traps and managing GGUF downloads with hash integrity is difficult and error-prone.
The termux-llamacpp Solution
Delivers pinned-commit native toolchains, tiered build presets (baseline, dotprod, native), HTTP Range resume caching with sidecar manifests, and PID-locked OpenAI servers.
Canonical Usage Example
from termux_llamacpp import LlamaRuntime
# 1. Initialize runtime
runtime = LlamaRuntime.install(preset="android-arm64-baseline")
# 2. Download model with SHA256 validation and manifest
model_path = runtime.models.download("qwen2.5-1.5b-instruct")
# 3. Start OpenAI and termux-aichain compliant server
server = runtime.serve(model="qwen2.5-1.5b-instruct", port=8080)
print(f"Server ready at {server.endpoint}")