Preparation for installation
安装LitServe前需要确保系统满足以下条件:
- Python 3.8 or higher
- 建议使用虚拟环境隔离依赖
- Linux/Windows/MacOS系统均可
Detailed installation steps
- Creating a Virtual Environment::
Linux/Mac.
python -m venv venv && source venv/bin/activate
Windows.
python -m venv venv && venvScriptsactivate
- 安装稳定版::
pip install litserve
- (可选)安装开发版::
pip install git+https://github.com/Lightning-AI/litserve.git@main
Verify Installation
执行以下命令检查是否成功安装:
python -c "import litserve; print(litserve.__version__)"
成功安装会显示版本号,如”0.1.0″。
Optional dependency installation
如需GPU加速支持,需额外安装框架的GPU版本,例如PyTorch的CUDA版本:
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
This answer comes from the articleLitServe: Rapidly Deploying Enterprise-Grade General AI Model Reasoning ServicesThe