# Base : Ubuntu avec ROCm 6.0
FROM rocm/rocm-terminal:6.0

# Installer les dépendances pour llama.cpp
RUN apt-get update && apt-get install -y \
    cmake \
    git \
    python3 \
    python3-pip \
    python3-venv \
    && rm -rf /var/lib/apt/lists/*

# Installer llama.cpp avec support ROCm
RUN git clone https://github.com/ggerganov/llama.cpp /llama.cpp \
    && cd /llama.cpp \
    && git pull \
    && cmake -DLLAMA_HIPBLAS=ON . \  # Active le support ROCm
    && make -j$(nproc)

# Créer un environnement Python
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
COPY requirements.txt /tmp/
RUN pip install --no-cache-dir -r /tmp/requirements.txt

# Copier les scripts et le modèle
COPY scripts/ /app/
COPY config/model.gguf /models/
WORKDIR /app

# Point d'entrée
CMD ["python", "agent_gsd.py"]