FROM python:3.11-slim WORKDIR /app # Install build dependencies RUN apt-get update && apt-get install -y \ build-essential \ cmake \ git \ && rm -rf /var/lib/apt/lists/* # Upgrade pip RUN pip install --upgrade pip # Copy requirements COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Install llama-cpp-python - try multiple repos in order # First try jllllll's CPU wheels, then abetlen's RUN pip install --no-cache-dir llama-cpp-python==0.2.85 \ --extra-index-url https://jllllll.github.io/llama-cpp-python-cuBLAS-wheels/basic/cpu \ || pip install --no-cache-dir llama-cpp-python==0.2.85 \ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \ || pip install --no-cache-dir llama-cpp-python==0.2.85 # Copy application COPY . . # Expose port EXPOSE 7860 # Run CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]