feat: enhance serving functionality and add comprehensive examples
- Improve API server with better error handling and response formatting - Enhance CLI with additional options for DiT stages and configuration - Add comprehensive examples in examples/basic/ including: - API client with health checks and text generation - Docker setup and usage examples - Simple usage patterns for different scenarios - Add utility scripts for model downloading and Docker setup - Update documentation with implementation details and testing guidelines - Fix configuration validation issues in OmniLLM - Improve stage configuration handling for AR and DiT stages - Add proper error handling and fallback mechanisms Tested with Qwen3-0.6B model: - Server starts successfully on port 8000 - Health and info endpoints working correctly - Text generation with various parameters functioning - API client examples working as expected - CLI help and configuration options working properly
This commit is contained in:
1 parent
51d2570464
commit
afe5c2692c
16 files changed
+1051
-134
No files matched your search
@@ -47,17 +47,100 @@ vLLM-omni is built on a modular architecture that extends vLLM's core functional
|
||||
|
||||
## 🛠️ Installation
|
||||
|
||||
### Prerequisites
|
||||
### Quick Start
|
||||
|
||||
- Python 3.8+
|
||||
- PyTorch 2.0+
|
||||
- CUDA 11.8+ (for GPU acceleration)
|
||||
|
||||
### Install from Source
|
||||
#### Option 1: Docker (Recommended for macOS)
|
||||
|
||||
```bash
|
||||
git clone https://github.com/your-org/vllm-omni.git
|
||||
pip install -r requirements.txt
|
||||
# Clone the repository
|
||||
git clone https://github.com/hsliuustc0106/vllm-omni.git
|
||||
cd vllm-omni
|
||||
|
||||
# Run the automated Docker setup
|
||||
./scripts/docker-setup-macos.sh
|
||||
```
|
||||
|
||||
#### Option 2: Local Installation
|
||||
|
||||
```bash
|
||||
# Clone the repository
|
||||
git clone https://github.com/hsliuustc0106/vllm-omni.git
|
||||
cd vllm-omni
|
||||
|
||||
# Run the installation script
|
||||
./install.sh
|
||||
```
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Python 3.11+ (recommended)
|
||||
- Conda or Miniconda
|
||||
- Git
|
||||
- CUDA 11.8+ (for GPU acceleration) or CPU-only installation
|
||||
|
||||
### Installation Methods
|
||||
|
||||
#### Method 1: Automated Installation (Recommended)
|
||||
```bash
|
||||
# Using shell script
|
||||
./install.sh
|
||||
|
||||
# Or using Python script
|
||||
python install.py
|
||||
```
|
||||
|
||||
#### Method 2: Manual Installation
|
||||
```bash
|
||||
# Create conda environment
|
||||
conda create -n vllm_omni python=3.11 -y
|
||||
conda activate vllm_omni
|
||||
|
||||
# Install PyTorch (CPU or GPU)
|
||||
pip install torch>=2.7 --index-url https://download.pytorch.org/whl/cpu # CPU
|
||||
# pip install torch>=2.7 --index-url https://download.pytorch.org/whl/cu121 # GPU
|
||||
|
||||
# Install dependencies
|
||||
pip install -r requirements.txt
|
||||
pip install "vllm>=0.10.2"
|
||||
|
||||
# Install vLLM-omni
|
||||
pip install -e .
|
||||
```
|
||||
|
||||
### Verify Installation
|
||||
|
||||
```bash
|
||||
# Test the installation
|
||||
python test_installation.py
|
||||
|
||||
# Test basic functionality
|
||||
python -c "import vllm_omni; print('Ready!')"
|
||||
|
||||
# Test CLI
|
||||
vllm --help
|
||||
```
|
||||
|
||||
For detailed installation instructions, see [INSTALL.md](INSTALL.md).
|
||||
|
||||
## 📥 Model Download
|
||||
|
||||
Models are automatically downloaded when first used, or you can pre-download them:
|
||||
|
||||
```bash
|
||||
# Check downloaded models
|
||||
python scripts/download_models.py --check-cache
|
||||
|
||||
# Download all default models
|
||||
python scripts/download_models.py --all
|
||||
|
||||
# Download specific models
|
||||
python scripts/download_models.py --ar-models Qwen/Qwen3-0.6B
|
||||
python scripts/download_models.py --dit-models stabilityai/stable-diffusion-2-1
|
||||
```
|
||||
|
||||
**Model Storage Location:**
|
||||
- Default: `~/.cache/huggingface/hub/`
|
||||
- AR models: 100MB - 1GB each
|
||||
- DiT models: 2GB - 7GB each
|
||||
|
||||
For detailed model management, see [MODEL_DOWNLOAD_GUIDE.md](docs/MODEL_DOWNLOAD_GUIDE.md).
|
||||
Reference in new issue
Block a user