File size: 700 Bytes
43a49a4
 
809cefd
 
 
43a49a4
 
 
 
 
 
 
 
 
 
 
 
 
 
fd2a9b8
 
43a49a4
 
 
 
 
 
 
 
 
7357a31
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Base image with Python and llama-cpp dependencies
FROM python:3.11-slim

ENV HF_HOME=/tmp/huggingface
ENV HF_HUB_CACHE=/tmp/huggingface

# System dependencies for llama-cpp
RUN apt-get update && apt-get install -y \
    build-essential \
    cmake \
    wget \
    git \
    && rm -rf /var/lib/apt/lists/*

# Install Python packages
RUN pip install --no-cache-dir \
    llama-cpp-python==0.2.66 \
    fastapi \
    uvicorn \
    huggingface-hub \
    starlette

# Create app directory
WORKDIR /app
COPY . /app

# Download model from Hugging Face Hub (on container startup)
ENV MODEL_REPO=TheBloke/phi-2-GGUF
ENV MODEL_FILE=phi-2.Q4_K_M.gguf

COPY start.sh .
RUN chmod +x start.sh
CMD ["./start.sh"]