Skip to content

build(docker): LLAMA_REF pin to rebuild llama.cpp on demand - #87

Merged
baylitoo merged 1 commit into
masterfrom
build/llama-ref-pin
Aug 4, 2026
Merged

build(docker): LLAMA_REF pin to rebuild llama.cpp on demand#87
baylitoo merged 1 commit into
masterfrom
build/llama-ref-pin

Conversation

@baylitoo

@baylitoo baylitoo commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Problem

The llama-builder stage clones + builds llama.cpp in ONE RUN whose text never changes, so Docker caches it. A plain docker compose build serving reuses the cached llama-server even after upstream HEAD moves — so a newly-supported arch (Unlimited-OCR / deepseek-ocr, llama.cpp#24969, merged 2026-06-24) is never picked up. My earlier "just rebuild" advice was wrong.

Fix

Optional LLAMA_REF build arg:

  • Empty (default) → unchanged (latest HEAD, cached).
  • Set to a commit/tag → shallow-fetch (GitHub any-SHA fetch) + build llama.cpp at that pin. The changed ARG value busts the layer cache (forcing a rebuild) AND makes the build reproducible.

Wired on the serving service (it holds the llama-server that serves deployed models) via ${LLAMA_REF:-}, documented in .env.example.

Usage

LLAMA_REF=<commit-or-tag-after-the-merge>   # in .env
docker compose build serving && docker compose up -d serving

Then deploy Unlimited-OCR — the runtime log confirms the arch loads.

🤖 Generated with Claude Code

…ible)

The llama-builder stage clones+builds llama.cpp in ONE cached RUN, so a plain
`docker compose build serving` reuses the old llama-server even after upstream
HEAD moves — a new arch (Unlimited-OCR / deepseek-ocr, ggml-org/llama.cpp#24969)
never gets picked up. New optional LLAMA_REF build arg: set a commit/tag to
shallow-fetch and build llama.cpp at that pin — the changed ARG busts the layer
cache (forcing a rebuild) AND makes the build reproducible. Empty = current
behavior (latest HEAD). Wired on the serving service (it holds the llama-server
that serves deployed models) via ${LLAMA_REF:-} and documented in .env.example.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@baylitoo
baylitoo merged commit 8e62cf6 into master Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant