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

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.7
File Size Uploaded
termux_train-1.1.7.tar.gz 189.2 kB Details

Built distribution (wheel)

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

Total release size: 341.4 kB

Release files / termux_train-1.1.7.tar.gz

Download URL termux_train-1.1.7.tar.gz
Size 189.2 kB
Tags Source
SHA-256 checksum
How to use checksums
96d12e0b76e86d736dbd3ac6f4867cf85366c7b50f0c42a59ae3fd9a9ef40850
BLAKE2b-256 checksum
How to use checksums
90a266133e23af6d0e553794a7cabab3ee9129569cd4e81cf6b66c1cb5bbc508
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.7-py3-none-any.whl

Download URL termux_train-1.1.7-py3-none-any.whl
Size 152.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
314d263e87d87cafdaa508178abf7278bb3ebd4cd17a51c6295688303d51fac4
BLAKE2b-256 checksum
How to use checksums
5b602a543fb09c86abad195e0b477fb287763aba2eabfde28cb9d10da56800b7
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

1.1.8

2 release files

This release

1.1.7 This release

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