Skip to main content

Simple way to pip install torch, vllm, flash-attn, sglang, ....

Project description

๐Ÿš€ AInfra

PyPI - Version PyPI - Python Version PyPI - Downloads License GitHub release GitHub stars GitHub issues Last commit

ไธญๆ–‡ๆ–‡ๆกฃ | English

Simple and intelligent way to install PyTorch, vLLM, Flash Attention, SGLang, and other ML/AI libraries with automatic environment detection.

๐ŸŒ Web Visualization Tool

Don't want to use the command line? Try our web-based visualization tool at:

๐Ÿ‘‰ https://linxueyuan.online/AInfra/

The web interface provides an intuitive way to generate installation commands based on your configuration. Simply select your Python version, CUDA version, and the libraries you need, and get the complete installation script instantly!

๐ŸŒŸ Features

  • ๐Ÿ” Environment Detection: Automatically detects your NVIDIA driver, CUDA version, OS, and Python version
  • ๐Ÿ“ฆ Smart Installation: Installs the right package versions based on your environment (e.g., CPU vs CUDA for PyTorch)
  • โœ… User Confirmation: Shows installation plan and asks for confirmation before proceeding
  • ๐ŸŽจ Beautiful CLI: Rich terminal output with colored tables and clear formatting
  • ๐Ÿ“š Comprehensive Library Support: Supports popular ML/AI libraries including torch, vllm, numpy, flash-attn, and sglang

๐Ÿ“ฅ Installation

pip install ainfra

๐ŸŽฏ Quick Start

๐Ÿ”Ž Check Your Environment

Display your system's environment information:

ainfra info

Example output:

System Information
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Operating System      โ”‚ Ubuntu 22.04.3 LTS      โ”‚
โ”‚ OS Version            โ”‚ Linux 5.15.0            โ”‚
โ”‚ System Architecture   โ”‚ x86_64 / AMD64          โ”‚
โ”‚ Python Version        โ”‚ 3.10.12                 โ”‚
โ”‚ Nvidia Driver Version โ”‚ 550.54.15               โ”‚
โ”‚ CUDA Driver Version   โ”‚ 12.4                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“‹ List Supported Libraries

View all libraries that AInfra can install:

ainfra list

Example output:

Supported Libraries
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Package      โ”ƒ Status        โ”ƒ Docs                                                         โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ torch        โ”‚ Not installed โ”‚ https://pytorch.org/get-started/locally/                     โ”‚
โ”‚ vllm         โ”‚ Not installed โ”‚ https://docs.vllm.ai/en/stable/getting_started/installation/ โ”‚
โ”‚ numpy        โ”‚ 2.4.0         โ”‚ https://numpy.org/install/                                   โ”‚
โ”‚ flash-attn   โ”‚ Not installed โ”‚ https://github.com/Dao-AILab/flash-attention#installation    โ”‚
โ”‚ sglang       โ”‚ Not installed โ”‚ https://docs.sglang.io/get_started/install.html              โ”‚
โ”‚ liger-kernel โ”‚ Not installed โ”‚ https://github.com/LinkSoul-AI/Liger-Kernel#installation     โ”‚
โ”‚ deepspeed    โ”‚ Not installed โ”‚ https://www.deepspeed.ai/tutorials/installation/             โ”‚
โ”‚ transformers โ”‚ Not installed โ”‚ https://huggingface.co/docs/transformers/installation        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Total: 8 libraries

The Status column shows:

  • Not installed - Library is not installed
  • Version number (e.g., 2.4.0) - Library is installed with the version number

For detailed information about each library, see SUPPORTED_LIBRARIES.md.

๐Ÿ”ง Install Packages

Install packages based on your local environment with user confirmation:

Install specific packages:

ainfra install torch vllm numpy

Install all supported packages:

ainfra install all

Get help:

ainfra install --help

The install command will:

  1. Detect your environment (Python version, CUDA version)
  2. Show the list of packages to be installed
  3. Ask for your confirmation before proceeding
  4. Install the packages with appropriate versions based on your environment

๐Ÿ’ก Usage Examples

# Check your system environment
ainfra info

# List all supported libraries
ainfra list

# Install PyTorch (automatically selects CUDA or CPU version)
ainfra install torch

# Install multiple libraries
ainfra install torch vllm numpy

# Install all supported libraries
ainfra install all

๐Ÿ› ๏ธ Development

This project uses Poetry for dependency management.

๐Ÿ“ฆ Setup

# Install dependencies
poetry install

# Run the CLI
poetry run ainfra info
poetry run ainfra list
poetry run ainfra install torch

๐Ÿ—๏ธ Build

# Build the package
poetry build

# The built package will be in the dist/ directory

๐Ÿ“š Supported Libraries

  • torch: PyTorch - Deep learning framework with GPU acceleration support
  • vllm: vLLM - High-throughput and memory-efficient inference engine for LLMs
  • numpy: NumPy - Fundamental package for scientific computing with Python
  • flash-attn: Flash Attention - Fast and memory-efficient exact attention
  • sglang: SGLang - Structured Generation Language for LLMs
  • liger-kernel: Liger Kernel - Optimized CUDA kernels for LLMs
  • deepspeed: DeepSpeed - Deep learning optimization library for large-scale training
  • transformers: Transformers - Hugging Face transformer library for NLP/LLM

See SUPPORTED_LIBRARIES.md for detailed information.

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“„ License

MIT License. See LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ainfra-0.1.3.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ainfra-0.1.3-py2.py3-none-any.whl (8.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ainfra-0.1.3.tar.gz.

File metadata

  • Download URL: ainfra-0.1.3.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.5 Darwin/25.2.0

File hashes

Hashes for ainfra-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5f8d131d3fed6973de5f43b4c4e04824f7209976e80e5a03fa90e18bf52c2857
MD5 d4fb9727f304083e929e204167703015
BLAKE2b-256 1321a9eb29c42fc06463b500b3736da9220656a7483371b15087e36c4377d5af

See more details on using hashes here.

File details

Details for the file ainfra-0.1.3-py2.py3-none-any.whl.

File metadata

  • Download URL: ainfra-0.1.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.5 Darwin/25.2.0

File hashes

Hashes for ainfra-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 76f481d14b62fcf179094807cbf6be4211996214a524e5b91e6678abbfea8016
MD5 db2238149b17f367eccc5a67d41c3974
BLAKE2b-256 1c8a2c9e97f24addf60dd1b8a00e49097fe741b5c71970ae2e9efaf999c61a0f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page