Skip to main content
Pre-release

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

License Platform OpenAI API

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 -O3 compiler 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 explicit ModelNotFoundError interrupts.
  • 🌐 Zero-Config OpenAI Server: Built-in supervisor for llama-server exposing /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-aichain via LocalAgent.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

termux_llamacpp-1.0.0b1.tar.gz (218.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

termux_llamacpp-1.0.0b1-py3-none-any.whl (120.1 kB view details)

Uploaded Python 3

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

Hashes for termux_llamacpp-1.0.0b1.tar.gz
Algorithm Hash digest
SHA256 f8d59b2d61cd14d7d1660d2f49d72e1f69a206116213d3cc084f9d1c6abd405c
MD5 0dba40cefcad1f3a959517072721b926
BLAKE2b-256 a47405c55eb77b72ca197de2212db253f27d3b115d31077be9d1458ad952aaa2

See more details on using hashes here.

File details

Details for the file termux_llamacpp-1.0.0b1-py3-none-any.whl.

File metadata

File hashes

Hashes for termux_llamacpp-1.0.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 5dbfd785247886e9b6fc9f24105b243001cf2ce890d7b7687fbc3f0b8dfaa1e6
MD5 d03ee7a4c708cb1949410bcbce150c5c
BLAKE2b-256 749eb12b44aa20066189eaaeb98bb126dca9970b8be0ba90d33dae363e31a133

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.2

2 files

This release

1.0.0b1 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page