-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile_LLM
More file actions
76 lines (64 loc) · 1.98 KB
/
Dockerfile_LLM
File metadata and controls
76 lines (64 loc) · 1.98 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
# Declare expected mount points
VOLUME /app/aria_dashboard
VOLUME /app/plugins
VOLUME /app/crypto/keys
VOLUME /app/aria_proxy
VOLUME /etc/nginx/conf.d
VOLUME /app/BitNet
# Install base packages and add LLVM/Clang apt source for version 18+
RUN apt-get update && apt-get install -y \
python3 \
python3-dev \
python3-venv \
python3-pip \
wget \
curl \
gnupg \
lsb-release \
cmake \
g++ \
make \
git \
unzip \
ninja-build \
libssl-dev \
libffi-dev \
apt-transport-https \
libpcap0.8-dev \
libpcap-dev \
libpcap0.8 \
gcc \
software-properties-common && \
bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" && \
rm -rf /var/lib/apt/lists/*
# Set python3.9 as default python
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \
python -m pip install --upgrade pip
# Create app directory
WORKDIR /app
COPY . .
# Install Python deps for BitNet
RUN pip install -r ./requirements.txt
# Copy BitNet into image
COPY ./BitNet /app/BitNet
# Install Python deps for BitNet
RUN pip install --no-cache-dir -r ./BitNet/requirements.txt
# Create app directory
WORKDIR /app/BitNet
RUN rm -rf build && mkdir build && cd build && cmake .. && make
WORKDIR /app
# Optionally build the project inside Docker (comment out if doing manually)
RUN python ./BitNet/setup_env.py -md ./BitNet/models/BitNet-b1.58-2B-4T -q i2_s || echo "Setup failed — model files may be missing. Mount and retry if needed."
# Set PYTHONPATH
ENV PYTHONPATH=/app/BitNet:/app
ENV DASHBOARD_URL=172.17.0.2:8000
# Default to bitnet directory
WORKDIR /app
RUN pip install --upgrade protobuf
RUN pip install protobuf>=4.21.0
# Optional default command
CMD ["python3", "node.py"]
#, "run_inference.py", "-m", "models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf", "-p", "Write a haiku about neural networks.", "-n", "100", "-t", "8", "-c", "2048", "-temp", "0.8", "-cnv"]