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

1. Universal One-Touch Installation (Recommended)

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.1

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.1
File Size Uploaded
termux_train-1.1.1.tar.gz 159.4 kB Details

Built distribution (wheel)

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

Total release size: 280.6 kB

Release files / termux_train-1.1.1.tar.gz

Download URL termux_train-1.1.1.tar.gz
Size 159.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ed2144771a7f48679621f3b577462a2f39f981dfb4a58d7261f2a9b74f42e75f
BLAKE2b-256 checksum
How to use checksums
7ae759e127003c3936927567a9c01262ceef8ec555c1f9f69d4014474256f23f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.0

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

Download URL termux_train-1.1.1-py3-none-any.whl
Size 121.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf94b4a21f4fad45c29d5a7c5430c720f682d9b163bc5a5b4d505d0203ba10b0
BLAKE2b-256 checksum
How to use checksums
333128bb513ccff7ff3e36eb3113c14a4da5abf65ba8a359b3c44af83fb679c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.0

Release history Release notifications | RSS feed

2.0.1

2 release files

2.0.0

2 release files

1.1.9

2 release files

1.1.8

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

This release

1.1.1 This release

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