Skip to main content

Introduction

🔥 unitorch is a PyTorch-based library that unifies training, inference, and serving of state-of-the-art models across NLP, computer vision, multimodal learning, and more. It wraps 20+ model architectures with a configuration-driven CLI, integrating seamlessly with transformers, peft, and diffusers.

Get started with a single import or a one-line CLI command — no boilerplate required.

Features

Unified Model Support 20+ architectures: LLMs, diffusion models, vision transformers, multimodal models
Configuration-Driven CLI Train, evaluate, infer, and serve via .ini config files
Multi-GPU & Distributed Native torchrun support + DeepSpeed integration for large-scale models
CUDA Optimized Optional CUDA C++ extensions for accelerated kernels
PEFT / LoRA Built-in parameter-efficient fine-tuning support
Model Serving FastAPI-based serving with unitorch-fastapi

Installation

pip install unitorch
Optional extras
pip install "unitorch[all]"          # everything
pip install "unitorch[deepspeed]"    # DeepSpeed support
pip install "unitorch[diffusers]"    # image generation models

Requires Python >= 3.10 and PyTorch 2.5+.

Quick Start

Python API

from unitorch.models.bart import BartForGeneration
model = BartForGeneration("path/to/bart/config.json")

# Configuration-driven setup
from unitorch.cli import Config
config = Config("path/to/config.ini")

Multi-GPU Training

torchrun --no_python --nproc_per_node 4 \
    unitorch-train examples/configs/generation/bart.ini \
    --train_file path/to/train.tsv --dev_file path/to/dev.tsv

Inference

unitorch-infer examples/configs/generation/bart.ini --test_file path/to/test.tsv

See the documentation for full tutorials and examples.

Supported Models

View all supported models
Domain Models
Language BERT, RoBERTa, XLM-RoBERTa, BART, MBart, LLaMA, Mistral, QWen3
Vision BEiT, Swin Transformer, DINOv2, CLIP, SigLIP
Multimodal LLaVA, QWen3-VL, Chinese CLIP
Image Generation FLUX (StableFlux), QWenImage
Video Generation Wan
Detection DETR, Grounding DINO
Segmentation SAM, Mask2Former, SegFormer, BRIA
Depth Estimation DPT
PEFT LoRA, DPO, GRPO (via peft wrappers)

CLI Commands

Command Purpose
unitorch-train Train models (supports torchrun)
unitorch-eval Evaluate models
unitorch-infer Run batch inference
unitorch-fastapi Start a FastAPI model server
unitorch-copilot unitorch-native agent (similar to Claude / OpenCode)
unitorch-copilot-cli CLI tool for agent use — invokes registered copilot tools

License

Released under the MIT License.

Metadata

Release files for unitorch 0.0.2.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 unitorch 0.0.2.0
File Size Uploaded Provenance Actions
unitorch-0.0.2.0.tar.gz 11.8 MB Without provenance Details for unitorch-0.0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for unitorch 0.0.2.0
File Interpreter ABI Platform Actions
unitorch-0.0.2.0-py3-none-any.whl Python 3 none any Details for unitorch-0.0.2.0-py3-none-any.whl

Total release size: 12.3 MB

Release files / unitorch-0.0.2.0.tar.gz

Download URL unitorch-0.0.2.0.tar.gz
Size 11.8 MB
Tags Source
SHA-256 checksum
How to use checksums
6b7128d0dcbd78ab59542986ca1013fc4c30b8a2829a82a103161a5d628be0fd
BLAKE2b-256 checksum
How to use checksums
d10e094e1fbda72fb2197b86674c788ab996ebbf53f789b4f18881eefc403054
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Release files / unitorch-0.0.2.0-py3-none-any.whl

Download URL unitorch-0.0.2.0-py3-none-any.whl
Size 477.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4fee01f3f1bd0020cfb524d7b073e9650afc6b634554493ce278981641a0d03d
BLAKE2b-256 checksum
How to use checksums
ba83c82a11afb64db62d5a54f42de46bca650b4d8902e204b4c639dfe2be17a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Security for unitorch 0.0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2.0 This release

2 release files No provenance

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