webui: Move static build output from repo code to HF Bucket#22937
webui: Move static build output from repo code to HF Bucket#22937allozaur wants to merge 40 commits into
Conversation
fe1e1e3 to
8fe5cbe
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Moves the WebUI static build output out of the repo and into a versioned Hugging Face Bucket, adding build-time fallback logic (local → HF download → no WebUI), plus CI workflow updates to build/distribute WebUI as an artifact.
Changes:
- Add CMake logic to embed WebUI assets from local
tools/server/public/or download prebuilt assets from an HF Bucket. - Restructure GitHub Actions workflows to build WebUI once and reuse it across server/release jobs via artifacts.
- Rename/rebrand WebUI identifiers/docs from
llama.cpp/llama-server-webuitollama-ui.
Reviewed changes
Copilot reviewed 27 out of 31 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/server/webui/vite.config.ts | Removes custom esbuild settings from WebUI build config |
| tools/server/webui/tests/stories/Introduction.mdx | Updates Storybook intro naming/wording |
| tools/server/webui/svelte.config.js | Renames SvelteKit app version name |
| tools/server/webui/src/routes/(chat)/chat/[id]/+page.svelte | Uses APP_NAME in page title and adjusts constants import |
| tools/server/webui/src/lib/services/chat.service.ts | Updates service docstring to new server naming |
| tools/server/webui/src/lib/constants/ui.ts | Changes default app name to llama-ui |
| tools/server/webui/src/lib/components/app/server/ServerLoadingSplash.svelte | Updates loading splash default message |
| tools/server/webui/scripts/install-git-hooks.sh | Stops staging generated tools/server/public/ output in pre-commit |
| tools/server/webui/scripts/dev.sh | Updates script header/comment formatting |
| tools/server/webui/package.json | Renames package to llama-ui |
| tools/server/webui/README.md | Renames and updates WebUI README wording |
| tools/server/server-http.cpp | Adjusts “server not ready” middleware behavior for WebUI/non-WebUI builds |
| tools/server/public/loading.html | Deletes committed static asset (moved out of repo) |
| tools/server/public/index.html | Deletes committed static asset (moved out of repo) |
| tools/server/README.md | Removes legacy Web UI/extension documentation section |
| tools/server/CMakeLists.txt | Adds local-first + HF Bucket download fallback for WebUI assets |
| grammars/README.md | Removes reference to legacy WebUI JS grammar tool path |
| common/common.h | Makes common_params.webui default depend on compile-time macro |
| CMakeLists.txt | Adds LLAMA_USE_PREBUILT_WEBUI option and formats option block |
| .gitignore | Ignores tools/server/public directory now that it’s generated/downloaded |
| .github/workflows/webui-build.yml | New reusable workflow to build and upload WebUI artifacts |
| .github/workflows/server.yml | Adds dependency on WebUI build artifact for server jobs |
| .github/workflows/server-webui.yml | Refactors to call reusable WebUI build workflow and reorganizes tests |
| .github/workflows/server-self-hosted.yml | Adds dependency on WebUI build artifact for self-hosted server builds |
| .github/workflows/release.yml | Adds dependency on WebUI build artifact for release jobs and sets LLAMA_BUILD_TAG |
| .github/labeler.yml | Removes tools/server/public/** from label rules |
| .gitattributes | Removes diff suppression for deleted generated WebUI file |
| .editorconfig | Removes formatting overrides for deleted tools/server/public/** files |
Files not reviewed (1)
- tools/server/webui/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com> Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>
…cket webui downloads
ade5c7a to
f237725
Compare
ngxson
left a comment
There was a problem hiding this comment.
Nice job! It seamlessly run the npm build in my test, so I suppose that should be good enough
[ 98%] Building/provisioning WebUI assets (npm build → HF Bucket fallback)
-- WebUI: building from source in /Users/ngxson/work/llama.cpp/tools/server/webui
-- WebUI: local npm build succeeded
Just leaving some small comments
| "-DSTAMP_FILE=${WEBUI_STAMP}" | ||
| "-DNPM_DIR=${CMAKE_CURRENT_SOURCE_DIR}/webui" | ||
| -P ${PROJECT_SOURCE_DIR}/scripts/webui-download.cmake | ||
| COMMENT "Building/provisioning WebUI assets (npm build → HF Bucket fallback)" |
There was a problem hiding this comment.
replace unicode arrow with ascii
| COMMENT "Building/provisioning WebUI assets (npm build → HF Bucket fallback)" | |
| COMMENT "Building/provisioning WebUI assets (npm build -> HF Bucket fallback)" |
| string(REGEX REPLACE "^([^:]+):.*$" "\\1" url_label "${entry}") | ||
| string(REGEX REPLACE "^[^:]+:(.*)$" "\\1" base_url "${entry}") | ||
|
|
||
| message(STATUS "WebUI: trying ${url_label}: ${base_url}") |
There was a problem hiding this comment.
I couldn't trigger this branch to test it, but seems like this should log the URL source to be downloaded, right?
Overview
Close #17207
Move WebUI static build output files from the repository to a versioned Hugging Face Bucket, with automatic local/HF Bucket fallback during build.
Additional information
Build cases
LLAMA_BUILD_WEBUI=ON(default)tools/server/public/LLAMA_BUILD_WEBUI=ON+LLAMA_USE_PREBUILT_WEBUI=ON(default)LLAMA_BUILD_WEBUI=ON+LLAMA_USE_PREBUILT_WEBUI=ONLLAMA_BUILD_WEBUI=OFFRuntime behavior while http server is not ready yet:
CMake examples
CI/CD changes
WebUI build output is no longer committed to the repo, so CI builds and distributes it as a reusable artifact:
New reusable workflows
webui-build.yml: Builds WebUI from source (Node.js + npm), generates SHA256 checksums, uploads aswebui-buildartifactwebui-publish.yml: Publishes the built WebUI to a versioned HF Bucket path, acceptsversion_taginput andhf_tokensecretModified workflows
release.yml: All build jobs now depend onwebui-buildartifact, download it viaactions/download-artifactinstead of relying on committed files. Addedwebui-publishjob for release publishingserver.yml/server-self-hosted.yml: Build jobs now depend onwebui-buildartifactserver-webui.yml: Simplified to callwebui-build.ymlinstead of building WebUI directlyChanges
tools/server/public/{bundle.js,bundle.css,index.html,loading.html}tools/server/CMakeLists.txt): Added local-first + HF Bucket download fallbackwebui-build.yml, changed to artifact download in release/build jobsserver-http.cpp): Loading page logic preserved under#ifdef LLAMA_BUILD_WEBUI.gitignore, removed.gitattributesandeditorconfigrules for removedtools/server/publicfiles from the repo