8000 perf(docker): fetch speech and object models at run time, not at build time by adeelahmad · Pull Request #183 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

perf(docker): fetch speech and object models at run time, not at build time - #183

Merged
adeelahmad merged 4 commits into
mainfrom
claude/whisper-on-demand
Oct 6, 2026
Merged

adeelahmad merged 4 commits into
mainfrom
claude/whisper-on-demand

Conversation

@adeelahmad
@adeelahmad adeelahmad commented Oct 5, 2026 •
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Stacked on #182 (same Dockerfile lines); retarget to main once that merges.

Before: the backend image baked in faster-whisper (ctranslate2, onnxruntime, av: about 225 MB), and the full image also baked in ONNX Runtime and downloaded YOLOX-s, all at build time. A slow link failed the install on these downloads (ctranslate2 on arm64 in Adeel's case), though the worker already fetches each of them on first use.

After: none of them are in the images. A worker fetches what a feature needs in the background, at run time, the first time a job needs it or when it's turned on in Settings → Components (components.py, unchanged). EXTRAS=whisper (or objects) in .env still bakes one in. With components.auto off and no speech engine, the transcribe error points at Settings → Components, Settings → Speech and EXTRAS. Models already in /opt/lens/models are still found.

How: dropped --extra whisper from the uv sync steps and the whole objects/YOLOX step from the full stage in fastapi_backend/Dockerfile; reworded ingest.get_engine's docstring and error and its test, objects.py's comments, and docs/deployment.md / docs/configuration.md. Cloudron and Proxmox packages are unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GP566GcZrYdzeWsGQeDCYA

claude added 2 commits October 5, 2026 09:31
uv gave up on big wheels (ctranslate2 on arm64) after its default 30 s read
timeout, failing the one-command install. Allow 300 s with 5 retries, and give
the image's uv sync steps a BuildKit cache mount so a rerun resumes from what
was already downloaded (the cache stays out of the image).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GP566GcZrYdzeWsGQeDCYA
Light by default: the worker already fetches the configured speech engine on
first use (components.py), and cloud speech needs none, so baking
faster-whisper in (ctranslate2, onnxruntime, av: about 225 MB) only cost
download time and disk. EXTRAS=whisper bakes it back in. The no-engine error
now points at Settings → Components, cloud speech and EXTRAS.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GP566GcZrYdzeWsGQeDCYA
@adeelahmad adeelahmad self-assigned this Oct 5, 2026
…ll image

Same as faster-whisper: components.py already fetches the objects extra and
YOLOX-s into the data folder the first time a job needs them, so the full image
no longer bakes them in at build time.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GP566GcZrYdzeWsGQeDCYA
@adeelahmad adeelahmad changed the title perf(docker): leave faster-whisper out of the base image perf(docker): fetch speech and object models at run time, not at build time Oct 5, 2026
Base automatically changed from claude/project-thread-ew7xm6 to main October 5, 2026 12:38
Copy link
Copy Markdown
Owner Author

FastAPI (embedded SurrealDB) failed on 25373f6 in tests/api/test_routines.py::test_graph_workflows_organise_entities (run_due returned 2, expected 1). This PR doesn't touch routines or the graph workflows; the test passes locally on this exact commit (1 passed in 7.8 s), and the run was the one queued against the old stacked base, on a runner where the slow video tests took 5+ minutes each. No fix exists yet because I can't reproduce it. The PR also conflicts with main now that #182 is squash-merged; CI will run fresh once main is merged into this branch, and a second failure there will be treated as real.


Generated by Claude Code

@adeelahmad
adeelahmad merged commit b891188 into main Oct 6, 2026
8 checks passed
@adeelahmad
adeelahmad deleted the claude/whisper-on-demand branch October 6, 2026 10:13
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.

2 participants

0