Skip to content

ui: move the web UI to ui/apps/chat and call it Llama Chat - #54

Closed
allozaur wants to merge 6 commits into
masterfrom
allozaur/refactor/ui-folders
Closed

allozaur wants to merge 6 commits into
masterfrom
allozaur/refactor/ui-folders

Conversation

@allozaur

@allozaur allozaur commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Overview

The web UI moves from tools/ui to ui/apps/chat, the first app in a new root ui/ folder, without changing any behavior, and it is called Llama Chat from now on: in the docs, the help text, the comments and its package name, @ggml-org/llama-chat. That leaves the Llama UI name to the design system that will live next to it.

Additional information

Part 1 of 12 of a work-in-progress stack on the fork, based on master. Every other layer of the stack sits on top of it. It has the commits of ggml-org/llama.cpp#32032 plus one fork-only commit: the dev proxy calls llama-server without the page's Origin, so vite dev passes the server's cross-origin check from a LAN or Tailscale address. SvelteKit 3 comes next (#70), then Llama UI (ui/lib/ui) with the design system (#22).

This is a mechanical change: files move, paths follow and prose names the app. No application code changes, and no flag, option or setting is renamed. Llama Chat builds, runs and ships exactly as before: a build of the app from this branch is identical to a build from master, apart from the build timestamp.

flowchart LR
    subgraph before["Before"]
        T["tools/ui<br/>the web UI"]
    end
    subgraph after["After: ui/"]
        subgraph apps["ui/apps: apps"]
            C["ui/apps/chat<br/>Llama Chat"]
        end
    end
    T -- "moved, code unchanged" --> C
Loading

Open PRs that touch tools/ui need a rebase, which git's rename detection handles for the moved files.

Why: apps and packages

Until now the web UI was one folder that held both the design system and the chat app. The root ui/ folder draws a line between them:

  • ui/apps holds apps, one folder each. An app owns its state and talks to llama-server. The first is Llama Chat, the web UI that llama-server serves, and this PR moves it there.
  • ui/lib will hold packages, one folder each. A package is something other code installs. The first will be Llama UI (@ggml-org/llama-ui): design tokens, fonts, surfaces and components, with no business logic. It comes in a separate PR, together with Llama Chat moving onto it.
flowchart TB
    S["llama-server<br/>serves the built-in web UI"]
    subgraph apps["ui/apps: apps own the business logic"]
        C["Llama Chat<br/>ui/apps/chat"]
        O["more apps and examples"]:::later
    end
    subgraph lib["ui/lib: packages, in a later PR"]
        L["Llama UI<br/>ui/lib/ui<br/>tokens, components, no business logic"]:::later
    end
    C -- "built and embedded, as today" --> S
    L -. "import, in a later PR" .-> C
    L -.-> O
    classDef later stroke-dasharray: 4 4
    class lib later
Loading

Solid lines are what this PR contains. Dashed lines and boxes are later steps, shown only so the layout makes sense. That leaves room for more apps and packages on the same parts, and lets other projects, such as the llama.app website, install the library on its own.

What changed
  • tools/ui is now ui/apps/chat, with no code changes. In the move commit, 991 files are byte-for-byte renames and nine are edited; those nine are scripts and docs whose own paths changed (.env.example, the READMEs, the demo CLI and config, dev.sh and the git hooks).
  • Everything that pointed at tools/ui points at the new path: CMake adds the app from tools/CMakeLists.txt, with its build output in build/ui/apps/chat, and the Dockerfiles, the Nix package, the workflows, the labeler, CODEOWNERS, .editorconfig and the docs follow. Relative paths that reach outside the app are one level deeper.
  • Llama Chat's own package, which was still named llama-ui, is now @ggml-org/llama-chat, so it no longer shares a name with the design system. It stays private; the app's display name and the llama-ui.zip build artifact are unchanged.
  • Prose that said "Web UI", "web UI" or "WebUI" for the app now says Llama Chat: the server README.md and README-dev.md (including the "Web UI" and "Custom default Web UI preferences" headings), the root README.md screenshot caption, SECURITY.md, the OpenVINO backend doc, the code-review skill, the --ui and --ui-mcp-proxy help text with their rows in the generated arguments table, the LLAMA_BUILD_UI option description, the share-code log line, the Storybook intro and comments in tools/server, the Nix package and the app. This replaces ggml-org/llama.cpp#32118.
  • The code-review skill lists tools/ui/ and tools/server/webui/ as former paths of Llama Chat.
  • Names others depend on stay: the deprecated --webui* flag aliases, the LLAMA_BUILD_WEBUI, LLAMA_USE_PREBUILT_WEBUI, LLAMA_WEBUI_HF_BUCKET and HF_WEBUI_VERSION names, the webui_settings field in /props, the storage migration keys and the Nix package's useWebUi and webui attributes. The app's display name and PWA manifest name are a user-visible change for a separate PR.
Testing
  • No visual change is possible from the move: src, static, tests and .storybook of ui/apps/chat have the same git tree hashes as in tools/ui on master, and so do the Vite, Svelte, TypeScript and shadcn configs.
  • npm run build from master's tools/ui and from this branch's ui/apps/chat, with the same dependencies, gives the same 70 files, checked again after rebasing onto master at a946eb541a. The CSS bundle is byte-identical, and the JS bundle, index.html and the service worker differ only in the build timestamp and the hashes derived from it.
  • The tree hashes and the build comparison above are from the move and the package rename; the naming commit after them changes only prose: docs, help text, comments, one log line and the Storybook intro.
  • ui/apps/chat: npm ci, npm run check, npm run lint, the unit tests and npm run build pass.
  • The changed server sources pass a syntax check; the C++ changes are string literals and comments.
  • CMake configures with the server on, and the llama-ui-assets target embeds the app's dist from ui/apps/chat.
  • The client and E2E suites and the Docker and Nix builds run in CI.

Requirements

@allozaur
allozaur added this pull request to stack #53 November 10, 2026 18:06
@github-actions github-actions Bot added documentation Improvements or additions to documentation devops server nix labels Nov 10, 2026
@allozaur
allozaur force-pushed the allozaur/refactor/ui-folders branch from b39a865 to 47e6a83 Compare November 12, 2026 00:09
@allozaur allozaur changed the title ui: move the UI to ui/, with the library in ui/lib and Llama Chat in ui/apps/chat ui: move the UI to ui/, with the packages in ui/lib and Llama Chat in ui/apps/chat Nov 12, 2026
@allozaur
allozaur force-pushed the allozaur/refactor/ui-folders branch 2 times, most recently from ff3daab to 3226e0f Compare November 12, 2026 01:27
@allozaur
allozaur removed this pull request from stack #53 November 12, 2026 01:28
@allozaur
allozaur changed the base branch from allozaur/style/glass-surfaces to master November 12, 2026 01:28
@allozaur
allozaur added this pull request to stack #58 November 12, 2026 01:29
@allozaur
allozaur removed this pull request from stack #58 November 12, 2026 20:54
@allozaur
allozaur added this pull request to stack #59 November 12, 2026 20:55
@allozaur
allozaur removed this pull request from stack #59 November 12, 2026 22:59
@allozaur
allozaur added this pull request to stack #60 November 12, 2026 23:00
@allozaur
allozaur removed this pull request from stack #60 November 13, 2026 20:38
@allozaur
allozaur added this pull request to stack #62 November 13, 2026 20:39
@allozaur
allozaur force-pushed the allozaur/refactor/ui-folders branch 6 times, most recently from 4904de8 to 83c3757 Compare November 16, 2026 10:42
@allozaur allozaur changed the title ui: move the UI to ui/, with the packages in ui/lib and Llama Chat in ui/apps/chat ui: move the web UI to ui/apps/chat, the first app in a new ui/ folder Nov 16, 2026
@allozaur
allozaur force-pushed the allozaur/refactor/ui-folders branch from 83c3757 to 27f7029 Compare November 16, 2026 11:28
@allozaur allozaur changed the title ui: move the web UI to ui/apps/chat, the first app in a new ui/ folder ui: move the web UI to ui/apps/chat and call it Llama Chat Nov 16, 2026
@allozaur
allozaur force-pushed the allozaur/refactor/ui-folders branch from 27f7029 to ebe986f Compare November 16, 2026 11:43
@allozaur
allozaur force-pushed the allozaur/refactor/ui-folders branch from ebe986f to 5cd509d Compare November 16, 2026 11:52
@allozaur
allozaur removed this pull request from stack #62 November 16, 2026 11:56
@allozaur
allozaur added this pull request to stack #66 November 16, 2026 11:57
The chat app moves to its own root folder, ui/apps/chat, as the first step of splitting the UI into one library
(ui/lib) and the apps built on it (ui/apps). The code is unchanged; every path that pointed at tools/ui now points at
ui/apps/chat: CMake adds it from tools/, and the Dockerfiles, the Nix package, the workflows, the labeler, CODEOWNERS,
.editorconfig, the git hooks, the dev and demo scripts and the docs follow it.

Assisted-by: Claude (Opus 5.5 Medium)
It was still called llama-ui, the name of the library that now sits beside it
in ui/lib (@ggml-org/llama-ui). The package stays private; the app's display name
and the llama-ui.zip build artifact are unchanged.

Assisted-by: Claude (Opus 5.5 Medium)
The app in tools/ui is Llama Chat; Llama UI is the component library it is
built from. Prose that said "Web UI", "web UI" or "WebUI" for the app now
names it: the READMEs, SECURITY.md, the --ui help text, the CMake option
description, one server log line, code comments and the Storybook intro.

Names that others depend on are unchanged: the deprecated --webui flag
aliases, the LLAMA_*_WEBUI CMake and environment names, the webui_settings
field, the storage migration keys and the Nix attributes.

Assisted-by: Claude (Opus 5.5 Medium)
…kill

Changes under the old tools/ui path, as well as tools/server/webui, still
get the Llama Chat checklist.

Assisted-by: Claude (Opus 5.5 Medium)
Llama Chat no longer lives under tools/server/, so the exclusion listed
under it now names ui/apps/chat. What is covered stays the same.

Assisted-by: Claude (Opus 5.5 Medium)
@allozaur
allozaur removed this pull request from stack #66 November 16, 2026 13:44
@allozaur
allozaur force-pushed the allozaur/refactor/ui-folders branch from 5cd509d to 1af9309 Compare November 16, 2026 13:44
@allozaur
allozaur added this pull request to stack #68 November 16, 2026 13:45
@allozaur
allozaur force-pushed the allozaur/refactor/ui-folders branch from 1b270ed to 1af9309 Compare November 16, 2026 13:47
llama-server refuses browser requests whose Origin does not match its own
host unless --cors-origins allows it, and the Vite proxy forwarded the
page's Origin (localhost:5173, or a LAN or Tailscale address). Loading a
model, saving tools and /v1 calls failed with 403 under `vite dev`.

The proxy now calls the server with its own Host and no Origin, WebSocket
upgrades included. Sec-Fetch-Site still passes through, so requests from
other sites stay refused.

Assisted-by: Claude (Opus 5.5 Medium)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build devops documentation Improvements or additions to documentation nix OpenVINO server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant