bots-garden/houlapublic Fork
⑂ v0.0.0
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/houla.git
git clone ssh://git@rickub.com/bots-garden/houla.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP
🛟 Updated. 1dfc968Unverified · on v0.0.0 · k33g · 4h ago
llama-cpp-olala.dockerfile · 61 lines · 2.2 KBGDScript3 Blame HistoryRaw
 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
# syntax=docker/dockerfile:1

# --- build stage: the OVHai llama.cpp fork, CPU only, portable ------------------
# Same flags as the fork's .devops/cpu.Dockerfile: no -march=native, and every CPU
# variant built as a backend library loaded at runtime for the CPU it runs on.
FROM debian:trixie-slim AS build
ARG LLAMA_REF
ARG TARGETARCH

# A heredoc RUN does not stop at the first failing line by itself: every
# script starts with `set -eu`.
RUN <<EOF
set -eu
apt-get update
apt-get install -y --no-install-recommends build-essential cmake git ca-certificates libgomp1
rm -rf /var/lib/apt/lists/*
EOF

RUN <<EOF
set -eu
git init -q /src
cd /src
git remote add origin https://github.com/OVHai-LLM/llama.cpp.git
git fetch -q --depth 1 origin "${LLAMA_REF}"
git checkout -q FETCH_HEAD
EOF

# -DLLAMA_USE_PREBUILT_UI=OFF: the prebuilt web UI does not match the fork (model card).
# -DLLAMA_OPENSSL=OFF: llama-server serves plain HTTP; downloads are done with `hf`.
# RPATH=$ORIGIN: binaries find their libraries next to them, wherever they are installed.
RUN <<EOF
set -eu
case "${TARGETARCH}" in
  amd64|arm64) ;;
  *) echo "unsupported TARGETARCH: ${TARGETARCH}" >&2; exit 1 ;;
esac
cd /src
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
  -DGGML_NATIVE=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON \
  -DLLAMA_USE_PREBUILT_UI=OFF -DLLAMA_OPENSSL=OFF \
  -DLLAMA_BUILD_TESTS=OFF -DLLAMA_BUILD_EXAMPLES=OFF \
  -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_INSTALL_RPATH='$ORIGIN'
cmake --build build -j "$(nproc)" --target llama-server llama-cli
EOF

RUN <<EOF
set -eu
dest=/out/opt/llama-cpp-olala
mkdir -p "$dest" /out/usr/local/bin
cp -P /src/build/bin/llama-server /src/build/bin/llama-cli "$dest"/
find /src/build/bin -name '*.so*' -exec cp -P {} "$dest"/ \;
# OpenMP runtime: not guaranteed on the sandbox image.
cp -L "$(gcc -print-file-name=libgomp.so.1)" "$dest"/libgomp.so.1
git -C /src rev-parse HEAD > "$dest"/REVISION
ln -s /opt/llama-cpp-olala/llama-server /out/usr/local/bin/llama-server
ln -s /opt/llama-cpp-olala/llama-cli    /out/usr/local/bin/llama-cli
EOF

# --- overlay: only the binaries and their libraries land on the workload ---------
FROM scratch
COPY --from=build /out/ /