Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Use NVIDIA CUDA runtime with cuDNN
FROM nvidia/cuda:12.1.105-cudnn8-runtime-ubuntu22.04

# Set environment variables to avoid Python buffering and warnings
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive

# Install Python 3.10 and pip
RUN apt-get update && apt-get install -y \
python3.10 \
python3.10-distutils \
python3-pip \
&& rm -rf /var/lib/apt/lists/*

# Upgrade pip
RUN python3.10 -m pip install --upgrade pip

# Set working directory
WORKDIR /app

# Copy requirements and install
COPY requirements.txt .
RUN python3.10 -m pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application
COPY . .

<<<<<<< HEAD
# Create volume for models or data
VOLUME ["/app/models"]

# Default command to run example.py
CMD ["python3.10", "example.py"]
=======
# Create volume for data
VOLUME ["/app/data"]

# Default command to run example
CMD ["python3", "example.py"]
>>>>>>> 4906eee39bbe85c6561aca5f93b76d0d8e32bdce
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,36 @@ A lightweight vLLM implementation built from scratch.

## Installation

### Option 1: Pip Installation

Clone the repository and install dependencies using pip:

```bash
git clone https://github.com/BaoZhuhan/nano-vllm.git
cd nano-vllm
pip install -r requirements.txt
```

### Option 2: Conda Environment

Create a conda environment with all dependencies:

```bash
conda env create -f environment.yml
conda activate nano-vllm
```

### Option 3: Docker

Build and run using Docker (requires NVIDIA GPU support):

```bash
docker build -t nano-vllm .
docker run --gpus all -v /path/to/models:/app/models nano-vllm
```

For manual installation from source:

```bash
pip install git+https://github.com/GeeeekExplorer/nano-vllm.git
```
Expand Down
17 changes: 17 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: nano-vllm
channels:
- pytorch
- nvidia
- conda-forge
dependencies:
- python=3.10
- pytorch>=2.4.0
- torchvision
- torchaudio
- pytorch-cuda=12.1
- pip
- pip:
- triton>=3.0.0
- transformers>=4.51.0
- flash-attn
- xxhash
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
torch>=2.4.0
triton>=3.0.0
transformers>=4.51.0
flash-attn
xxhash