Team Ai
Apppublic

rbantog/llama-cpp-server

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
4likes
Dockerfile46 linesDownload Raw Back to root
1# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker2# you will also find guides on how best to write your Dockerfile3 4FROM  ubuntu:20.045 6ARG MODEL_DOWNLOAD_LINK7ENV MODEL_DOWNLOAD_LINK=${MODEL_DOWNLOAD_LINK:-https://huggingface.co/unsloth/DeepSeek-R1-Distill-Qwen-1.5B-GGUF/resolve/main/DeepSeek-R1-Distill-Qwen-1.5B-Q4_K_M.gguf?download=true}8 9ENV DEBIAN_FRONTEND=noninteractive10 11RUN useradd -m -u 1000 user12USER user13ENV PATH="/home/user/.local/bin:$PATH"14 15WORKDIR /app16 17 18COPY --chown=user . /app19 20USER root21 22RUN apt-get update && apt-get install -y git cmake build-essential g++ wget curl python323 24RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -25RUN apt-get install -y nodejs26    27USER user28 29RUN python3 replace_hw.py30RUN git clone https://github.com/ggerganov/llama.cpp.git31 32WORKDIR /app/llama.cpp33RUN git apply ../helloworld.patch34 35WORKDIR /app/llama.cpp/examples/server/webui36RUN npm i37RUN npm run build38 39WORKDIR /app/llama.cpp40RUN cmake -B build -DBUILD_SHARED_LIBS=OFF41RUN cmake --build build --config Release -j 842 43WORKDIR /app/llama.cpp/build/bin44RUN wget -nv -O local_model.gguf ${MODEL_DOWNLOAD_LINK}45CMD ["/app/llama.cpp/build/bin/llama-server",  "--host", "0.0.0.0","--port","8080", "-c", "2048","-m","local_model.gguf", "--cache-type-k", "q8_0" ]46