Skip to main content

termux-train (v1.1.0)

PyPI Version NPM Version License Python Support Node Support

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.


📌 Key Architectural Highlights

  • ⚡ 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 .bin token 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.sh for one-click setup across Android Termux, Linux, and macOS.

🚀 Installation & Quickstart

curl -fsSL https://raw.githubusercontent.com/uno-km/termux-train/main/install.sh | bash

2. Python Package (PyPI)

# Standard pure Python + NumPy Autograd engine
pip install termux-train

# With Vulkan GPU acceleration
pip install "termux-train[vulkan]"

3. Node.js Global CLI (NPM)

npm install -g termux-train

🛠️ CLI Usage Guide

# 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 3

📖 Node.js & TypeScript SDK Usage

import { 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 Documentation & Portal


📄 License

Licensed under the Apache-2.0 License. Copyright (c) 2026 Eunho Kim (@uno-km).

Metadata

Release files for termux-train 1.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for termux-train 1.1.8
File Size Uploaded
termux_train-1.1.8.tar.gz 198.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for termux-train 1.1.8
File Interpreter ABI Platform
termux_train-1.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 361.2 kB

Release files / termux_train-1.1.8.tar.gz

Download URL termux_train-1.1.8.tar.gz
Size 198.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c4c55cc92bf0b619527a13d3830b579e46e8a9eb521dd6016a4a31a17f51f676
BLAKE2b-256 checksum
How to use checksums
0b7250e64f1608879cfabbe452774e500040b208d25e419cc9e76c0f0118d316
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / termux_train-1.1.8-py3-none-any.whl

Download URL termux_train-1.1.8-py3-none-any.whl
Size 162.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c287292757848ea14b703c0f6a8604973e98a1064368513156ac5ca89be863aa
BLAKE2b-256 checksum
How to use checksums
3bfd8efff5ba0d1eba4b3c677f5415a9bb5b38d8cc6fba1f68cc5102fd59b660
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release history Release notifications | RSS feed

2.0.1

2 release files

2.0.0

2 release files

1.1.9

2 release files

This release

1.1.8 This release

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page