llama-cpp-python / Dockerfile
V12nm's picture
Update Dockerfile
0dad949 verified
Raw History Blame
733 Bytes
FROM python:3.10-slim
# Install curl
RUN apt-get update && apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install PRE-COMPILED llama-cpp-python for CPU (Very Fast)
RUN pip install llama-cpp-python[server] --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
RUN pip install huggingface_hub
# Download Llama-3.2-3B-Instruct Q4_K_M model from bartowski
RUN huggingface-cli download bartowski/Llama-3.2-3B-Instruct-GGUF Llama-3.2-3B-Instruct-Q4_K_M.gguf --local-dir /app --local-dir-use-symlinks False
# Expose the API port
EXPOSE 7860
# Start the API server
CMD ["python3", "-m", "llama_cpp.server", "--model", "/app/Llama-3.2-3B-Instruct-Q4_K_M.gguf", "--host", "0.0.0.0", "--port", "7860"]