Overseas access: www.kdjingpai.com
Bookmark Us
Current Position:fig. beginning " AI Answers

如何安装和验证LitServe?

2025-08-30 1.3 K

Preparation for installation

安装LitServe前需要确保系统满足以下条件:

  • Python 3.8 or higher
  • 建议使用虚拟环境隔离依赖
  • Linux/Windows/MacOS系统均可

Detailed installation steps

  1. Creating a Virtual Environment::

    Linux/Mac. python -m venv venv && source venv/bin/activate

    Windows. python -m venv venv && venvScriptsactivate

  2. 安装稳定版::pip install litserve
  3. (可选)安装开发版::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

Recommended

Can't find AI tools? Try here!

Just type in the keyword Accessibility Bing SearchYou can quickly find all the AI tools on this site.

Top

en_USEnglish