Spaces:
Running
Running
chore(sync): mirror backend .py + Dockerfile to Space (hf-sync-backend)
Browse filesAutomated backend sync from szl-holdings/a11oy main via hf-sync-backend.
Updated (differed from the Space): Dockerfile
Deleted (gone from the repo + Dockerfile COPY set): (none)
Keeps the Space-built backend (serve.py + the Dockerfile-COPY'd .py
modules) identical to GitHub main so the Space never rebuilds from a
stale backend, new endpoints don't 404 there, and orphaned modules
removed from the repo don't linger in the Space tree.
- Dockerfile +25 -19
Dockerfile
CHANGED
|
@@ -449,25 +449,31 @@ COPY szl_alloy_models.py ./szl_alloy_models.py
|
|
| 449 |
# no prebuilt wheel), but the GGUF weight below is now RELIABLY fetched (pinned
|
| 450 |
# revision + retry + integrity verify) so the published image always carries it.
|
| 451 |
# We never redistribute the weight in our repo — it is fetched from the HF repo.
|
| 452 |
-
#
|
| 453 |
-
#
|
| 454 |
-
#
|
| 455 |
-
#
|
| 456 |
-
#
|
| 457 |
-
#
|
| 458 |
-
#
|
| 459 |
-
#
|
| 460 |
-
#
|
| 461 |
-
#
|
| 462 |
-
#
|
| 463 |
-
#
|
| 464 |
-
#
|
| 465 |
-
# --
|
| 466 |
-
#
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 471 |
# GGUF weight — RELIABLY PRESENT (pinned revision + retry + integrity verify), NOT best-effort.
|
| 472 |
# Previously a single best-effort `hf_hub_download(...) || echo` step: a transient download
|
| 473 |
# failure silently shipped an image with NO model, so the alloy demo tier always degraded to
|
|
|
|
| 449 |
# no prebuilt wheel), but the GGUF weight below is now RELIABLY fetched (pinned
|
| 450 |
# revision + retry + integrity verify) so the published image always carries it.
|
| 451 |
# We never redistribute the weight in our repo — it is fetched from the HF repo.
|
| 452 |
+
# CPU demo-tier llama.cpp — BUILT FROM SOURCE against glibc (NOT a prebuilt wheel).
|
| 453 |
+
# WHY: abetlen's CPU wheel index ships the recent, Qwen2.5-capable 0.3.x cp312
|
| 454 |
+
# linux_x86_64 wheels built against MUSL libc — their bundled libllama.so NEEDs
|
| 455 |
+
# libc.musl-x86_64.so.1, which CANNOT load on this glibc python:3.12-slim base
|
| 456 |
+
# (dlopen fails: "libc.musl-x86_64.so.1: cannot open shared object file"), so the
|
| 457 |
+
# demo tier silently degrades to the honest tower-side label. The only glibc
|
| 458 |
+
# (manylinux) prebuilt cp312 wheels on that index are 0.2.6x — far too old to load
|
| 459 |
+
# the Qwen2.5 GGUF architecture. So we compile llama-cpp-python==0.3.19 from source
|
| 460 |
+
# here: recent enough to load the Qwen2.5-Coder GGUF AND producing a glibc-linked
|
| 461 |
+
# libllama.so that actually loads. NO `|| echo` mask — the demo tier is a HARD
|
| 462 |
+
# requirement of the published image (the ghcr-build-push "Demo tier serves REAL
|
| 463 |
+
# local model" step boots the image and fails the build if the alloy demo tier does
|
| 464 |
+
# not serve genuine local llama.cpp output), so a failed compile must fail LOUD.
|
| 465 |
+
# GUARD: .github/workflows/llama-wheel-guard.yml re-builds this exact pinned version
|
| 466 |
+
# from source on cp312/linux_x86_64 and asserts the resulting libllama.so links
|
| 467 |
+
# glibc (not musl) and imports — verifying, not assuming, the contract on each bump.
|
| 468 |
+
# GGML_NATIVE=OFF keeps the build portable (no -march=native) across CI + box CPUs.
|
| 469 |
+
RUN set -eux; \
|
| 470 |
+
apt-get update; \
|
| 471 |
+
apt-get install -y --no-install-recommends build-essential cmake ninja-build git libgomp1 libstdc++6; \
|
| 472 |
+
CMAKE_ARGS="-DGGML_NATIVE=OFF" pip install --no-cache-dir --no-binary llama-cpp-python "llama-cpp-python==0.3.19"; \
|
| 473 |
+
python3 -c "import llama_cpp, os, glob; base=os.path.dirname(llama_cpp.__file__); so=glob.glob(os.path.join(base,'**','libllama.so'), recursive=True); assert so, 'libllama.so not found under '+base; d=open(so[0],'rb').read(); assert b'libc.so.6' in d and b'libc.musl-x86_64.so.1' not in d, 'libllama.so is not glibc-linked: '+so[0]; print('[a11oy] llama_cpp built from source OK (glibc):', so[0], getattr(llama_cpp,'__version__','?'))"; \
|
| 474 |
+
apt-get purge -y build-essential cmake ninja-build git; \
|
| 475 |
+
apt-get autoremove -y; \
|
| 476 |
+
rm -rf /var/lib/apt/lists/*
|
| 477 |
# GGUF weight — RELIABLY PRESENT (pinned revision + retry + integrity verify), NOT best-effort.
|
| 478 |
# Previously a single best-effort `hf_hub_download(...) || echo` step: a transient download
|
| 479 |
# failure silently shipped an image with NO model, so the alloy demo tier always degraded to
|