Skip to content

ui: PWA support#23871

Merged
allozaur merged 49 commits into
ggml-org:masterfrom
allozaur:allozaur/llama-ui-pwa
Jun 12, 2026
Merged

ui: PWA support#23871
allozaur merged 49 commits into
ggml-org:masterfrom
allozaur:allozaur/llama-ui-pwa

Conversation

@allozaur

@allozaur allozaur commented May 29, 2026

Copy link
Copy Markdown
Contributor

Overview

Close #23060

  • Shared build utility functions (version resolution, bundle path rewriting, SW content fixing, splash link generation)
  • PWA installability: manifest.webmanifest, service worker (sw.js), icons, dark mode support, standalone display mode
  • Service worker: Workbox-powered, auto-generated via SvelteKitPWA, precaches all static assets
  • Automatic update detection: useRegisterSW() polls every 60s for new SW version; shows "Update available" card when ready
  • Build version injection: LLAMA_UI_VERSION env var (from CMake) > git hash + epoch > fallback; used as cache-busting query param on bundles and in SW precache
  • Static bundle naming: SvelteKit's hashed bundle.<hash>.js/css replaced with bundle.js?v=<version> in index.html, SW, and bundle files; _app/ directory eliminated from output
  • Auto-generating PWA icons and + Apple splash screens: generated for all iPhone/iPad sizes (portrait + landscape, light + dark) via apple-splash-*.png files with proper media queries
  • Toggleable build version display: new settings key showBuildVersion; shows version string in bottom-right corner when enabled
  • Runtime API caching: Workbox NetworkFirst strategy for /v1/* and static endpoints (/health, /props, /models, etc.) with 24h TTL and 50-entry max

Additional information

  • Upgraded many dev dependencies (svelte 5.55.7 -> 5.56.1, tailwindcss 4.1.11 -> 4.3.0, typescript 5.8.3 -> 5.9.3, etc.)
  • Added workbox-window as explicit dep
  • New favicon SVGs: clean geometric Llama logo (light #111111 + dark #FAFAFA variants) replacing the old complex screenshot SVG

iOS Demo

pwa-ios-demo.mp4

macOS Demo

pwa-macos-demo.mp4

Requirements

@github-actions github-actions Bot added script Script related examples devops improvements to build systems and github actions server server/ui labels May 29, 2026

@allozaur allozaur left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

wip

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

let's make sure we've got this file properly updated in the light of PWA implementation

Comment thread .github/workflows/ui-build.yml Outdated
Comment thread scripts/ui-assets.cmake
Comment thread tools/server/server-http.cpp Outdated
Comment thread tools/server/server-http.cpp Outdated
Comment thread tools/ui/src/app.html Outdated
Comment thread tools/ui/pwa-assets.config.ts Outdated
Comment thread tools/ui/pwa-assets.config.ts Outdated
Comment thread tools/ui/vite.config.ts Outdated
Comment thread tools/ui/vite.config.ts Outdated
@allozaur allozaur force-pushed the allozaur/llama-ui-pwa branch 2 times, most recently from ca56cf5 to 28cdbcb Compare May 29, 2026 18:25
Comment thread tools/ui/pwa-assets.config.ts Outdated
Comment thread tools/ui/vite.config.ts Outdated
Comment thread tools/ui/vite.config.ts Outdated
@allozaur allozaur force-pushed the allozaur/llama-ui-pwa branch from 28cdbcb to c7f42bb Compare May 29, 2026 19:12

@allozaur allozaur left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Last todos:

  • Version info in UI
  • Improve Reload alert UI

@allozaur allozaur force-pushed the allozaur/llama-ui-pwa branch from aa0e72b to 917edae Compare June 12, 2026 08:45
@ServeurpersoCom

Copy link
Copy Markdown
Contributor

Testing is underway for the bug in the update warning popup with relatives urls

@ServeurpersoCom

ServeurpersoCom commented Jun 12, 2026

Copy link
Copy Markdown
Contributor
Sans titre

99b8e5a
WDYT ?

Keep the PWA hook object intact instead of destructuring needRefreshByStorage,
which freezes the reactive getter. Also exclude loading.html from PWA
precache to prevent 404 errors and broken SW installation.
@allozaur allozaur merged commit f7ca93d into ggml-org:master Jun 12, 2026
30 checks passed
@CISC

CISC commented Jun 12, 2026

Copy link
Copy Markdown
Member

Server CIs broke:
https://github.com/ggml-org/llama.cpp/actions/runs/27420106883/job/81043112834#step:5:540

@ServeurpersoCom

Copy link
Copy Markdown
Contributor

Server CIs broke: https://github.com/ggml-org/llama.cpp/actions/runs/27420106883/job/81043112834#step:5:540

I think it's the pre-built asset bucket that's lagging behind the merge.

@CISC

CISC commented Jun 12, 2026

Copy link
Copy Markdown
Member

Server CIs broke: https://github.com/ggml-org/llama.cpp/actions/runs/27420106883/job/81043112834#step:5:540

I think it's the pre-built asset bucket that's lagging behind the merge.

That would explain it as release is broken, see my PR. :)

@aldehir

aldehir commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

I'm not sure the prebuilt UI path is going to work as intended. The ASSETS define what to download from the HF bucket, but if the bundle.*.js and bundle.*.css files are resolved from the build dir, then those will never get pulled down from the bucket.

Probably needs to grab the list from the checksum file and pull those on download. Or better, pull an archive but that has some implications w.r.t cross-platform compatibilityCMake 3.18 has ARCHIVE_EXTRACT support.

@ngxson

ngxson commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

@aldehir hmm I can confirm that bundle.js|css and index.html are missing from the download: https://github.com/ggml-org/llama.cpp/actions/runs/27450671336/job/81145091244?pr=24550

well I guess, maybe simply rename the file back to the old bundle.js|css after the build, then have the server to automatically route them back to the correct path; trying to do that on #24550

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

Labels

devops improvements to build systems and github actions examples python python script changes script Script related server/ui server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: llama-ui minimal PWA config

7 participants