llama-cpp-python Docker & Self-Hosted Deployment

GitHub

Python bindings for llama.cpp

10,473 stars Python Python 1 file ยท ~11,830 tokens
1. Pull Image (DOCKERHUB) docker pull abetlen/llama-cpp-python:latest
2. Docker Run (1-Click Launch) docker run -d --name llama-cpp-python --restart always abetlen/llama-cpp-python:latest
3. Podman Run podman run -d --name llama-cpp-python --restart always abetlen/llama-cpp-python:latest
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/abetlen/llama-cpp-python:latest
5. ORAS Pull (OCI Artifact) oras pull abetlen/llama-cpp-python:latest
docker/openblas_simple/Dockerfile
FROM python:3-slim-bookworm

# We need to set the host to 0.0.0.0 to allow outside access
ENV HOST 0.0.0.0

COPY . .

# Install the package
RUN apt update && apt install -y libopenblas-dev ninja-build build-essential pkg-config \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* /tmp/*
    
RUN python -m pip install --upgrade pip pytest cmake scikit-build setuptools fastapi uvicorn sse-starlette pydantic-settings starlette-context

RUN CMAKE_ARGS="-DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS" pip install llama_cpp_python --verbose

# Run the server
CMD python3 -m llama_cpp.server