Skip to content

Commit 483b6ba

Browse files
committed
Updated README.md instructions on how to use *_simple/Dockerfiles
1 parent 0e0c9bb commit 483b6ba

File tree

6 files changed

+19
-8
lines changed

6 files changed

+19
-8
lines changed

docker/README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1-
# Dockerfiles for building the llama-cpp-python server
2-
- `Dockerfile.openblas_simple` - a simple Dockerfile for non-GPU OpenBLAS
3-
- `Dockerfile.cuda_simple` - a simple Dockerfile for CUDA accelerated CuBLAS
4-
- `hug_model.py` - a Python utility for interactively choosing and downloading the latest `5_1` quantized models from [huggingface.co/TheBloke]( https://huggingface.co/TheBloke)
1+
# Simple Dockerfiles for building the llama-cpp-python server with external model bin files
2+
- `./openblas_simple/Dockerfile` - a simple Dockerfile for non-GPU OpenBLAS, where the model is located outside the Docker image
3+
- `cd ./openblas_simple`
4+
- `docker build -t openblas_simple .`
5+
- `docker run -e USE_MLOCK=0 -e MODEL=/var/model/<model-path> -v <model-root-path>:/var/model -t openblas_simple`
6+
where `<model-root-path>/<model-path>` is the full path to the model file on the Docker host system.
7+
- `./cuda_simple/Dockerfile` - a simple Dockerfile for CUDA accelerated CuBLAS, where the model is located outside the Docker image
8+
- `cd ./cuda_simple`
9+
- `docker build -t cuda_simple .`
10+
- `docker run -e USE_MLOCK=0 -e MODEL=/var/model/<model-path> -v <model-root-path>:/var/model -t cuda_simple`
11+
where `<model-root-path>/<model-path>` is the full path to the model file on the Docker host system.
12+
13+
# "Bot-in-a-box" - a method to build a Docker image by choosing a model to be downloaded and loading into a Docker image
14+
- `cd ./auto_docker`:
15+
- `hug_model.py` - a Python utility for interactively choosing and downloading the latest `5_1` quantized models from [huggingface.co/TheBloke]( https://huggingface.co/TheBloke)
516
- `Dockerfile` - a single OpenBLAS and CuBLAS combined Dockerfile that automatically installs a previously downloaded model `model.bin`
617

7-
# Get model from Hugging Face
18+
## Get model from Hugging Face
819
`python3 ./hug_model.py`
920

1021
You should now have a model in the current directory and `model.bin` symlinked to it for the subsequent Docker build and copy step. e.g.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docker/Dockerfile.cuda_simple renamed to docker/cuda_simple/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG CUDA_IMAGE="12.1.1-devel-ubuntu22.04"
2-
FROM ${CUDA_IMAGE}
2+
FROM nvidia/cuda:${CUDA_IMAGE}
33

44
# We need to set the host to 0.0.0.0 to allow outside access
55
ENV HOST 0.0.0.0
@@ -10,7 +10,7 @@ COPY . .
1010
RUN apt update && apt install -y python3 python3-pip
1111
RUN python3 -m pip install --upgrade pip pytest cmake scikit-build setuptools fastapi uvicorn sse-starlette
1212

13-
RUN LLAMA_CUBLAS=1 python3 setup.py develop
13+
RUN LLAMA_CUBLAS=1 pip install llama-cpp-python
1414

1515
# Run the server
1616
CMD python3 -m llama_cpp.server

docker/Dockerfile.openblas_simple renamed to docker/openblas_simple/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ COPY . .
99
RUN apt update && apt install -y libopenblas-dev ninja-build build-essential
1010
RUN python -m pip install --upgrade pip pytest cmake scikit-build setuptools fastapi uvicorn sse-starlette
1111

12-
RUN LLAMA_OPENBLAS=1 python3 setup.py develop
12+
RUN LLAMA_OPENBLAS=1 pip install llama_cpp_python --verbose
1313

1414
# Run the server
1515
CMD python3 -m llama_cpp.server

0 commit comments

Comments
 (0)