Pre-download embedder models into Docker image (first-boot delay) #62
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
hero_osis_server downloads BGE embedding models (~1.4G) from HuggingFace on first boot. This takes 3-5 minutes, during which:
Root cause
build-local.shbuilds the ONNX runtime library but does NOT download the embedder models. They're fetched at runtime byhero_embedder_lib::download.Fix
hero_embedder already has
scripts/download-models.shandmake modelstarget. Add a step inbuild-local.sh(after ONNX runtime download) to:download-models.shto fetch models todist/var/embedder/models/Dockerfile.packto COPY models into the imageFiles
hero_services/docker/build-local.sh— add models download stephero_services/Dockerfile.pack— add COPY for models dirhero_embedder/scripts/download-models.sh— existing download scriptImpact
First-boot time: 3-5 min → ~10s. Login works immediately.
Impact assessment (2026-03-20)
OSIS takes ~2 minutes to download embedder models on first boot. This blocks:
Once models are pre-baked in the image, the entrypoint seeding will work, login will be instant, and seed data can populate all domains.
Signed-off-by: mik-tf
Done
Pre-download BGE embedding models at build time so they are baked into the Docker image. Eliminates the 2-3 min HuggingFace download on first boot.
Changes
dist/var/embedder/models/EMBEDDER_MODELSenv varVerification
/root/hero/var/embedder/models/make smoke: hero_embedder_server /health PASS, OSIS user_count > 0 PASSCommit: hero_services 82cca10
Signed-off-by: mik-tf