File size: 897 Bytes
ade0283
 
 
541af2c
ade0283
 
541af2c
 
ade0283
 
541af2c
 
 
 
 
e7a1edc
 
541af2c
 
ade0283
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM ubuntu:22.04

RUN apt-get update && apt-get install -y \
    build-essential cmake git wget \
    && rm -rf /var/lib/apt/lists/*

RUN git clone --depth=1 https://github.com/ggerganov/llama.cpp /app/llama.cpp

WORKDIR /app/llama.cpp

RUN cmake -B build \
    -DLLAMA_CURL=OFF \
    -DLLAMA_BUILD_TESTS=OFF \
    -DLLAMA_BUILD_EXAMPLES=OFF \
    -DLLAMA_BUILD_SERVER=ON \
    -DGGML_BACKEND_DL=OFF \
    -DLLAMA_BUILD_COMMON=OFF \
    && cmake --build build --target llama-server -j$(nproc)

RUN mkdir -p /app/models && \
    wget -q -O /app/models/qwen3-4b.gguf \
    "https://huggingface.co/bartowski/Qwen3-4B-GGUF/resolve/main/Qwen3-4B-Q4_K_M.gguf"

EXPOSE 7860

CMD ["/app/llama.cpp/build/bin/llama-server", \
     "--model", "/app/models/qwen3-4b.gguf", \
     "--host", "0.0.0.0", \
     "--port", "7860", \
     "--ctx-size", "4096", \
     "--threads", "4", \
     "--n-predict", "512"]