termux-train Logo

termux-train

v0.1.0 (Native)
PyPI (pip) ๐Ÿ’– Sponsor GitHub
PyPI Version PyPI Monthly Downloads PyPI Total Downloads Audit Score: 100/100 (Grade A+) AMEVA Foundation

termux-train

Native On-Device Deep Learning & LoRA Training Framework for Android Termux (ARM64 Bionic)

๐Ÿ›๏ธ AMEVA Foundation (์•„๋ฉ”๋ฐ” ์žฌ๋‹จ) Initiative:

termux-train์€ ๋น…ํ…Œํฌ์˜ ํด๋ผ์šฐ๋“œ GPU ๋…์  ์ข…์†์„ ํƒ€ํŒŒํ•˜๊ณ , ์ „ ์„ธ๊ณ„ ๋ชจ๋“  ๊ฐœ๋ฐœ์ž๊ฐ€ ์Šค๋งˆํŠธํฐ๊ณผ ์—ฃ์ง€ ๋‹จ๋ง์—์„œ 100% ๋ฌด๋ฃŒ๋กœ AI๋ฅผ ์ง์ ‘ ํ•™์Šตํ•˜๊ณ  ๋ฏธ์„ธ์กฐ์ •(LoRA)ํ•  ์ˆ˜ ์žˆ๋„๋ก ์ง€์›ํ•˜๋Š” ์•„๋ฉ”๋ฐ” ์žฌ๋‹จ(AMEVA Foundation)์˜ ๊ณต์‹ ์˜คํ”ˆ์†Œ์Šค ํ”„๋กœ์ ํŠธ์ž…๋‹ˆ๋‹ค.

The Mobile Deep Learning Challenge

Standard PyTorch binaries fail on Android Termux due to GNU Glibc vs Android Bionic Libc mismatch, while PRoot Linux containers add 40% memory overhead and trigger Android LMK (Low Memory Killer) aborts.

The Zero-Dependency Breakthrough

termux-train runs natively on Android Termux with a pure Python DAG Autograd core, pluggable NumPy/OpenBLAS ARM NEON SIMD vectorization, RoPE Transformers, SafeTensors zero-copy, and low-rank LoRA fine-tuning.

Key Capabilities & Mobile Architecture

โšก Pure Python Autograd Core

Zero C++ dependency dynamic computation graph with reverse-mode DAG autograd. Runs everywhere without compilation.

๐ŸŽฏ On-Device LoRA Adapters

Freeze 96%+ base weights and fine-tune low-rank adapters with <100KB SafeTensors footprint.

๐Ÿง  RoPE & Incremental KV Cache

Rotary Position Embedding with O(0) learnable parameters and O(1) step generation cache.

๐Ÿ’พ SafeTensors Zero-Copy I/O

HuggingFace-compatible binary serialization eliminating Python pickle memory bloat and LMK crashes.

๐Ÿ“ฆ Streaming MMap Datasets

Stream multi-gigabyte token datasets directly from disk via kernel page cache without consuming mobile RAM.

๐Ÿš€ Official PyPI Distribution

Install with single command pip install termux-train across Android Termux, Linux, Windows, macOS.

Canonical 10-Line Training Demo (Python)

from termux_train import Tensor, nn, optim, set_backend

# 1. Automatic C-acceleration (NumPy / OpenBLAS NEON)
set_backend("auto")

# 2. Dynamic Autograd Tensor
x = Tensor([[1.0, 2.0], [3.0, 4.0]], requires_grad=True)
w = Tensor([[2.0], [1.0]], requires_grad=True)

# 3. Forward & Backward
y = x @ w
loss = (y * y).mean()
loss.backward()

print("dL/dw:", w.grad)