termux-aichain
v1.2.0
Published
Zero-dependency AI chaining and autonomous agent framework utilizing device resources for Node.js ESM and Android Termux
Maintainers
Readme
Termux-AIChain (Python)
Why LangChain on Termux? Bloat & Crash vs 94KB Zero-Dep LCEL & Hardware Native Agents
Installation
pip install termux-aichainQuickstart
from termux_aichain import PromptTemplate, OpenAICompatibleChat, StringOutputParser, get_battery_status
# 1. Read physical smartphone hardware telemetry
battery = get_battery_status()
# 2. Build LCEL Chain connected to local llama-server (port 8080)
prompt = PromptTemplate.from_template("Phone Telemetry: {status}. Diagnose in 1 sentence:")
llm = OpenAICompatibleChat(base_url="http://127.0.0.1:8080/v1", model="llama3", temperature=0.3)
chain = prompt | llm | StringOutputParser()
# 3. Execute with 0 external dependencies
report = chain.invoke({"status": battery})
print("AI Diagnostic:", report)Description
Termux-AIChain provides 100% pure standard-library LCEL pipe chaining (prompt | llm | parser), autonomous StateGraph agents, on-device SQLite vector RAG, and first-class Android smartphone hardware actuation (battery, temperature, haptics, GPS) in a tiny 94KB footprint.
Documentation
License
Apache-2.0 License. Copyright (c) 2026 Eunho Kim (@uno-km).
