Spaces:
Paused
Paused
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Build tools are a fallback in case a prebuilt llama-cpp-python wheel isn't | |
| # available for this platform/Python and pip has to compile from source. | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential cmake git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # llama.cpp (CPU) — prefer the prebuilt CPU wheel index, fall back to source build. | |
| RUN pip install --no-cache-dir \ | |
| llama-cpp-python \ | |
| --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu | |
| RUN pip install --no-cache-dir \ | |
| fastapi \ | |
| "uvicorn[standard]" \ | |
| pydantic \ | |
| jinja2 \ | |
| huggingface_hub | |
| COPY app.py index.html chat_template.jinja start.sh ./ | |
| RUN chmod +x start.sh | |
| # The GGUF is pulled from HF at startup (see start.sh) into /app/model. | |
| ENV MODEL_PATH=/app/model/puffyshirt-Q4_K_M.gguf | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV HF_HOME=/app/.cache/huggingface | |
| # HuggingFace Spaces expects port 7860 | |
| EXPOSE 7860 | |
| CMD ["./start.sh"] | |