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

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.0
File Size Uploaded
termux_train-1.1.0.tar.gz 154.7 kB Details

Built distribution (wheel)

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

Total release size: 270.4 kB

Release files / termux_train-1.1.0.tar.gz

Download URL termux_train-1.1.0.tar.gz
Size 154.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0c6de930ac5e521a17b498b8ef0db76c8c377c6b5f69bd8586b0c13ee9169cf4
BLAKE2b-256 checksum
How to use checksums
c37200ab70f2d235e5f8d8d6d1c4b311fcca94ee057f4464055e469875028124
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.0-py3-none-any.whl

Download URL termux_train-1.1.0-py3-none-any.whl
Size 115.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d8d712495d87c83ca5286a15836f396d912f7f3bd241dd4a75efb096b7fe9434
BLAKE2b-256 checksum
How to use checksums
6858fb8ce2f2c7933a906435e0c1a6834674d7c30266b0ed4b908727d10e20fa
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

1.1.1

2 release files

This release

1.1.0 This release

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