Skip to main content

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

Project description

๐Ÿš€ AInfra

ไธญๆ–‡ๆ–‡ๆกฃ | 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    โ”ƒ Description                                                       โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ 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                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Total: 5 libraries

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

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.1.tar.gz (5.8 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.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ainfra-0.1.1.tar.gz
  • Upload date:
  • Size: 5.8 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.1.tar.gz
Algorithm Hash digest
SHA256 05407569289f916ff03ceef3ebe6ca3f8260bb933458ce8f7e113f0c1ea1484d
MD5 051417021a8302088c2d313d0cae08cc
BLAKE2b-256 604fa3aa4662fdb43b2a8a65d55a34cb6281027ee264f400bc6ab96af92ad077

See more details on using hashes here.

File details

Details for the file ainfra-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ainfra-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8aca2dcebd4aa2047c33f014bd2a401384b61a5518b32f519f8233d9621e1d01
MD5 aafc913f9b22068988f3fb8d5bc37fb1
BLAKE2b-256 f34ffa35bc56a1dbc2f9d75171acffb882db4909fec1600a0ab7b86908e1f083

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