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

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.9
File Size Uploaded
termux_train-1.1.9.tar.gz 213.7 kB Details

Built distribution (wheel)

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

Total release size: 392.8 kB

Release files / termux_train-1.1.9.tar.gz

Download URL termux_train-1.1.9.tar.gz
Size 213.7 kB
Tags Source
SHA-256 checksum
How to use checksums
557f097c8d6c64f389940cd46d9faa62b021fc23e44f82d4a960a615e481f025
BLAKE2b-256 checksum
How to use checksums
e4252a833782185544694606eb961cc5ceb80beb60a5ed81594692e45c0cb09b
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.9-py3-none-any.whl

Download URL termux_train-1.1.9-py3-none-any.whl
Size 179.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8eff556a54f0a91b7714adec6e4028a43ac07d722f3e9c7e9fcfe8599bf7ad66
BLAKE2b-256 checksum
How to use checksums
0c260edae8f76351789665bd382740151807635e68c58fe94f1f7c5b5cd05b13
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

This release

1.1.9 This release

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

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