Production-Grade Native On-Device Deep Learning & LoRA Training Framework for Android Termux & ARM64.
Dual-Engine Architecture: Native Python Autograd DAG + Node.js / TypeScript SDK.
- β‘ Production Dual-Engine: Seamless CLI & SDK parity across Python (
termux_train) and Node.js/TypeScript (termux-train). - π‘οΈ HuggingFace SafeTensors Hardening: 100MB Header Bomb defense and zero-copy binary checkpointing with optimizer momentum.
- πΎ 2M-Sample Bounded MMap Dataset: High-throughput binary
.bintoken stream loader operating within constant <50MB RAM. - 𧬠LoRA & RoPE Attention: Rank-decomposition parameter-efficient fine-tuning with transactional snapshot rollback & Rotary Position Embeddings.
- π Multilingual ByteTokenizer: Native UTF-8 tokenizer with full Korean Hangul, CJK ideographs, Emoji, and UTF-8 BOM support.
- π One-Touch Universal Installer:
install.shfor one-click setup across Android Termux, Linux, and macOS.
curl -fsSL https://raw.githubusercontent.com/uno-km/termux-train/main/install.sh | bash# Standard pure Python + NumPy Autograd engine
pip install termux-train
# With Vulkan GPU acceleration
pip install "termux-train[vulkan]"npm install -g termux-train# 1. Hardware & Vulkan GPU Diagnostics
termux-train doctor
# or via Python:
python3 -m termux_train.cli doctor
# 2. On-Device GEMM & Autograd Latency Benchmark
termux-train benchmark --dim 256
# 3. Train MLP / LoRA / Transformer with Checkpoints
termux-train train --model lora --dim 64 --rank 8 --epochs 5 --checkpoint ./adapter.safetensors
# 4. Stream 2,000,000+ Sample MMap Dataset
termux-train train --data ./corpus.bin --batch-size 32 --epochs 3import { TermuxTrainer, runDoctor, runBenchmark } from 'termux-train';
// 1. Diagnostics
const doc = runDoctor();
console.log(`Hardware Tier: ${doc.hardware.tier} | RAM: ${doc.hardware.totalRamMb}MB`);
// 2. Training Session
const trainer = new TermuxTrainer();
const result = await trainer.train({
modelType: 'lora',
dim: 64,
loraRank: 8,
epochs: 5,
lr: 0.001,
checkpointPath: './adapter.safetensors'
});
console.log(`Training complete! Final Loss: ${result.finalLoss}`);- Official Architecture & API Reference
- Ecosystem Metrics & Registry Stats
- AMEVA Open-Source Foundation
Licensed under the Apache-2.0 License. Copyright (c) 2026 Eunho Kim (@uno-km).