File size: 593 Bytes
5435d7a
15cb762
 
1ac548a
389cfb5
a7939d4
 
389cfb5
a7939d4
389cfb5
61eefc8
a7939d4
 
60f06e7
4acc9a9
a7939d4
 
be75bff
467870d
61eefc8
60f06e7
467870d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM python:3.10-slim
WORKDIR /app

# Install system dependencies (Only build tools needed for Llama.cpp)
RUN apt-get update && apt-get install -y \
    build-essential \
    cmake \
    git \
    libopenblas-dev \
    && rm -rf /var/lib/apt/lists/*

COPY requirements.txt .

# Optimize Llama.cpp build for CPU
ENV CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS"
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

COPY . .

# Expose port 7860 for Hugging Face Spaces
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]