Skip to content

webui: Move static build output from repo code to HF Bucket#22937

Open
allozaur wants to merge 40 commits into
ggml-org:masterfrom
allozaur:allozaur/webui-build-strategy
Open

webui: Move static build output from repo code to HF Bucket#22937
allozaur wants to merge 40 commits into
ggml-org:masterfrom
allozaur:allozaur/webui-build-strategy

Conversation

@allozaur
Copy link
Copy Markdown
Contributor

@allozaur allozaur commented May 11, 2026

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

CMake option Local files HF Bucket Result
LLAMA_BUILD_WEBUI=ON (default) exists ignored Uses local tools/server/public/
LLAMA_BUILD_WEBUI=ON + LLAMA_USE_PREBUILT_WEBUI=ON (default) not exists available Downloads from HF Bucket
LLAMA_BUILD_WEBUI=ON + LLAMA_USE_PREBUILT_WEBUI=ON not exists not available Builds without WebUI (warning)
LLAMA_BUILD_WEBUI=OFF - - Builds without WebUI

Runtime behavior while http server is not ready yet:

  • Built with WebUI: loading.html served to browsers (HTTP requests to / or .html), JSON 503 to APIs
  • Built without WebUI: JSON 503 for all requests

CMake examples

  # Default build (WebUI enabled, uses local or HF Bucket)
  cmake -B build

  # Force local WebUI (requires `npm run build` in tools/server/webui)
  cmake -B build -DLLAMA_BUILD_WEBUI=ON -DLLAMA_USE_PREBUILT_WEBUI=OFF

  # Disable WebUI entirely
  cmake -B build -DLLAMA_BUILD_WEBUI=OFF

  # Skip HF Bucket download, fail if local not available
  cmake -B build -DLLAMA_USE_PREBUILT_WEBUI=OFF

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 as webui-build artifact
  • webui-publish.yml: Publishes the built WebUI to a versioned HF Bucket path, accepts version_tag input and hf_token secret

Modified workflows

  • release.yml: All build jobs now depend on webui-build artifact, download it via actions/download-artifact instead of relying on committed files. Added webui-publish job for release publishing
  • server.yml / server-self-hosted.yml: Build jobs now depend on webui-build artifact
  • server-webui.yml: Simplified to call webui-build.yml instead of building WebUI directly

Changes

  • Deleted: tools/server/public/{bundle.js,bundle.css,index.html,loading.html}
  • CMake (tools/server/CMakeLists.txt): Added local-first + HF Bucket download fallback
  • CI workflows: New webui-build.yml, changed to artifact download in release/build jobs
  • Server (server-http.cpp): Loading page logic preserved under #ifdef LLAMA_BUILD_WEBUI
  • Config: Updated .gitignore, removed .gitattributes and editorconfig rules for removed tools/server/public files from the repo

@github-actions github-actions Bot added server/webui examples devops improvements to build systems and github actions server build Compilation issues labels May 11, 2026
@allozaur allozaur force-pushed the allozaur/webui-build-strategy branch 8 times, most recently from fe1e1e3 to 8fe5cbe Compare May 11, 2026 22:51
@allozaur allozaur requested a review from ngxson May 11, 2026 23:29
@allozaur allozaur marked this pull request as ready for review May 11, 2026 23:29
@allozaur allozaur requested a review from ggerganov as a code owner May 11, 2026 23:29
Copilot AI review requested due to automatic review settings May 11, 2026 23:29
@allozaur allozaur requested review from a team as code owners May 11, 2026 23:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-webui to llama-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.

Comment thread tools/server/CMakeLists.txt
Comment thread tools/server/CMakeLists.txt Outdated
Comment thread tools/server/CMakeLists.txt Outdated
Comment thread tools/server/CMakeLists.txt Outdated
Comment thread common/common.h
Comment thread tools/server/server-http.cpp Outdated
Comment thread .github/workflows/server-webui.yml Outdated
Comment thread .github/workflows/server-webui.yml Outdated
@allozaur allozaur requested review from CISC and ServeurpersoCom May 12, 2026 09:48
Comment thread .github/workflows/server-webui.yml Outdated
Comment thread .github/workflows/webui-build.yml Outdated
Comment thread .github/workflows/webui-publish.yml Outdated
Comment thread .github/workflows/webui-publish.yml Outdated
Comment thread .github/workflows/webui-publish.yml Outdated
allozaur and others added 28 commits May 13, 2026 16:22
Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>
Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>
@allozaur allozaur force-pushed the allozaur/webui-build-strategy branch from ade5c7a to f237725 Compare May 13, 2026 14:22
Copy link
Copy Markdown
Contributor

@ngxson ngxson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace unicode arrow with ascii

Suggested change
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}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't trigger this branch to test it, but seems like this should log the URL source to be downloaded, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Compilation issues devops improvements to build systems and github actions examples script Script related server/webui server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Handle building the webui static output via GH Actions workflow

5 participants