FROM python:3.11-slim WORKDIR /app # ── System dependencies (C++ compiler only — no vision / audio tools needed) ── RUN apt-get update && apt-get install -y \ build-essential \ cmake \ git \ && rm -rf /var/lib/apt/lists/* # ── Compile llama-cpp-python CPU-only (AVX2/512 disabled → runs on any HF CPU) ─ RUN pip install --no-cache-dir -U pip && \ CMAKE_ARGS="-DGGML_BLAS=OFF -DGGML_CUDA=OFF -DGGML_METAL=OFF \ -DGGML_AVX2=OFF -DGGML_AVX512=OFF" \ FORCE_CMAKE=1 \ pip install --no-cache-dir --timeout=1800 llama-cpp-python==0.2.90 # ── App dependencies ─────────────────────────────────────────────────────────── COPY requirements-hf.txt . RUN pip install --no-cache-dir -r requirements-hf.txt # ── Copy application source ──────────────────────────────────────────────────── COPY . . # ── HF Spaces expects port 7860 ─────────────────────────────────────────────── EXPOSE 7860 ENV PORT=7860 CMD ["python", "app.py"]