File size: 1,175 Bytes
d57abe3
 
 
f4af5cf
 
 
 
 
5a08cc6
 
 
 
f4af5cf
 
5a08cc6
f4af5cf
 
 
 
d57abe3
d52e646
5a08cc6
 
 
d52e646
 
5a08cc6
f4af5cf
 
 
d57abe3
 
 
 
 
 
 
 
 
 
 
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


FROM ghcr.io/ggml-org/llama.cpp:server

ENV DEBIAN_FRONTEND=noninteractive \
    PYTHONUNBUFFERED=1 \
    OMP_NUM_THREADS=2 \
    MODELS_DIR=/models \
    DATA_DIR=/data \
    LLAMA_REPO=bartowski/Llama-3.2-1B-Instruct-GGUF \
    LLAMA_FILE=Llama-3.2-1B-Instruct-Q4_K_M.gguf \
    THREADS=2

RUN apt-get update && apt-get install -y --no-install-recommends \
      python3 python3-pip curl wget ca-certificates \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app


RUN mkdir -p /models && \
    pip3 install --no-cache-dir --break-system-packages "huggingface_hub>=0.34.0" && \
    (hf download "$LLAMA_REPO" "$LLAMA_FILE" --local-dir /models \
      || huggingface-cli download "$LLAMA_REPO" "$LLAMA_FILE" --local-dir /models) && \
    ls -lh /models

RUN mkdir -p /data/jobs

EXPOSE 7860



ENTRYPOINT ["/app/llama-server"]

CMD ["-m", "/models/Llama-3.2-1B-Instruct-Q4_K_M.gguf", \
     "--host", "0.0.0.0", "--port", "7860", \
     "-c", "4096", "-b", "512", "-ub", "128", \
     "-t", "2", "--threads-batch", "2", "--parallel", "1", \
     "--cache-type-k", "q8_0", "--cache-type-v", "q8_0", \
     "--flash-attn", "on", "--jinja", \
     "--temp", "0.0", "--metrics"]