FROM python:3.11-slim RUN apt-get update && apt-get install -y --no-install-recommends \ git build-essential cmake curl ca-certificates && \ rm -rf /var/lib/apt/lists/* WORKDIR /app RUN git clone https://github.com/ggerganov/llama.cpp /tmp/llama.cpp && \ cmake -S /tmp/llama.cpp -B /tmp/llama.cpp/build -DBUILD_SERVER=ON -DBUILD_SHARED_LIBS=OFF && \ cmake --build /tmp/llama.cpp/build -j && \ cp /tmp/llama.cpp/build/bin/llama-server /usr/local/bin/llama-server COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY . . ENV PORT=7860 ENV MODEL_PATH=/app/models/Qwen3.5-0.8B-Q4_K_M.gguf CMD ["python","app.py"]