File size: 1,568 Bytes
1b23905
35516cf
1b23905
 
 
 
35516cf
 
 
1b23905
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35516cf
 
 
1b23905
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM python:3.12-slim

ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
ENV PIP_NO_CACHE_DIR=1
ENV LD_LIBRARY_PATH=/opt/llama

WORKDIR /app

RUN apt-get update && apt-get install -y --no-install-recommends \
    git \
    cmake \
    build-essential \
    curl \
    ca-certificates \
    libgomp1 \
    && rm -rf /var/lib/apt/lists/*

RUN git clone --depth 1 https://github.com/ggml-org/llama.cpp.git /tmp/llama.cpp \
    && cmake -S /tmp/llama.cpp -B /tmp/llama.cpp/build \
        -DGGML_NATIVE=OFF \
        -DGGML_OPENMP=ON \
        -DLLAMA_BUILD_SERVER=ON \
        -DLLAMA_BUILD_TESTS=OFF \
        -DLLAMA_BUILD_EXAMPLES=ON \
    && cmake --build /tmp/llama.cpp/build \
        --config Release \
        --target llama-server \
        -j2 \
    && mkdir -p /opt/llama \
    && cp /tmp/llama.cpp/build/bin/llama-server /opt/llama/ \
    && cp /tmp/llama.cpp/build/bin/*.so* /opt/llama/ \
    && rm -rf /tmp/llama.cpp

RUN pip install huggingface_hub

RUN python3 -c "\
from huggingface_hub import hf_hub_download; \
hf_hub_download( \
    repo_id='LiquidAI/LFM2.5-2.6B-GGUF', \
    filename='LFM2.5-2.6B-QAD-Q4_0.gguf', \
    local_dir='/app/models' \
)"

EXPOSE 7860

CMD ["/opt/llama/llama-server", \
     "--model", "/app/models/LFM2.5-2.6B-QAD-Q4_0.gguf", \
     "--host", "0.0.0.0", \
     "--port", "7860", \
     "--alias", "LFM2.5-2.6B", \
     "--threads", "2", \
     "--ctx-size", "32768", \
     "--cache-type-k", "q8_0", \
     "--cache-type-v", "q8_0", \
     "--parallel", "1", \
     "--cont-batching", \
     "--flash-attn", "auto"]