edge_llm_chat / Dockerfile
lemonteaa's picture
Update Dockerfile
07e3bc7 verified
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile
FROM python:3.10
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
USER root
RUN wget -qO- "https://github.com/Kitware/CMake/releases/download/v4.0.1/cmake-4.0.1-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local
USER user
RUN git clone https://github.com/ggml-org/llama.cpp
WORKDIR /app/llama.cpp/
RUN cmake -B build -DLLAMA_CURL=OFF
RUN cmake --build build --config Release
WORKDIR /app/llama.cpp/build/
RUN wget https://huggingface.co/unsloth/gemma-3-270m-it-GGUF/resolve/main/gemma-3-270m-it-UD-Q8_K_XL.gguf
RUN wget https://huggingface.co/LiquidAI/LFM2-VL-450M-GGUF/resolve/main/LFM2-VL-450M-Q8_0.gguf
RUN wget https://huggingface.co/LiquidAI/LFM2-VL-450M-GGUF/resolve/main/mmproj-LFM2-VL-450M-F16.gguf
RUN wget https://huggingface.co/unsloth/ERNIE-4.5-0.3B-PT-GGUF/resolve/main/ERNIE-4.5-0.3B-PT-UD-Q8_K_XL.gguf
RUN wget https://huggingface.co/unsloth/Qwen3-0.6B-GGUF/resolve/main/Qwen3-0.6B-UD-Q8_K_XL.gguf
WORKDIR /app
RUN mkdir /app/llamaswap
RUN wget -qO- https://github.com/mostlygeek/llama-swap/releases/download/v154/llama-swap_154_linux_amd64.tar.gz | tar -xvz -C /app/llamaswap
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY --chown=user . /app
CMD ["python", "chat_demo.py"]