File size: 1,049 Bytes
d1f62f9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
787b02e
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 ubuntu:22.04

RUN apt-get update && \

    apt-get install -y \
    build-essential \
    libssl-dev \
    zlib1g-dev \
    libopenblas-dev \
    libomp-dev \
    cmake \
    pkg-config \
    git \
    python3-pip \
    curl \
    libcurl4-openssl-dev \
    wget && \
    rm -rf /var/lib/apt/lists/*

RUN pip3 install --upgrade pip && \

    pip3 install openai fastapi uvicorn pydantic orjson httptools

RUN pip install httpx[http2]

RUN git clone https://github.com/ggerganov/llama.cpp && \

    cd llama.cpp && \
    cmake -B build -S . \
        -DLLAMA_BUILD_SERVER=ON \
        -DGGML_BLAS=ON \
        -DGGML_BLAS_VENDOR=OpenBLAS \
        -DCMAKE_BUILD_TYPE=Release && \
    cmake --build build --config Release --target llama-server -j $(nproc)

RUN mkdir -p /models && \

    wget -O /models/model.gguf https://huggingface.co/unsloth/Qwen3-0.6B-GGUF/resolve/main/Qwen3-0.6B-UD-Q8_K_XL.gguf

COPY app.py /app.py
COPY start.sh /start.sh
RUN chmod +x /start.sh

EXPOSE 7860

CMD ["bash", "/start.sh"]