FROM python:3.10-slim RUN apt-get update && apt-get install -y wget build-essential && rm -rf /var/lib/apt/lists/* RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH WORKDIR $HOME/app COPY --chown=user requirements.txt . RUN pip install --no-cache-dir -r requirements.txt --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu # Download DictaLM 2.0 Q4_K_M GGUF RUN wget -q -O model.gguf "https://huggingface.co/dicta-il/dictalm2.0-instruct-GGUF/resolve/main/dictalm2.0-instruct.Q4_K_M.gguf" COPY --chown=user . . # Run FastAPI server # Port 7860 is required for HF Spaces CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]