Skip to content

ui: run Llama Chat apart from llama-server, named in config.json or npx --server - #32945

Merged
allozaur merged 3 commits into
ggml-org:masterfrom
allozaur:allozaur/feat/ui-server-origin
Nov 24, 2026
Merged

allozaur merged 3 commits into
ggml-org:masterfrom
allozaur:allozaur/feat/ui-server-origin

Conversation

@allozaur

@allozaur allozaur commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Llama Chat can run apart from llama-server: on a static host, through npx llama-chat --server <url>, or from a build of the repo, talking to a llama-server at another address.

flowchart LR
    A["llama serve --port N<br/>(built-in UI)"] -->|"config.json: {}"| C{"Llama Chat<br/>reads config.json<br/>on start"}
    B["npx llama-chat --server URL<br/>or a static host"] -->|"config.json: { server: URL }"| C
    C -->|"no server named"| D["API on the app's own address<br/>(follows --port)"]
    C -->|"server named"| E["API on the llama-server at URL"]
Loading

Additional information

Carries the E2E test fix from #32959 so CI passes here; it drops out on a rebase once #32959 merges.

Until now the app could only reach the llama-server that serves it; the README already described the separate setup. Nothing changes for the app llama-server embeds.

What changed
  • The app reads config.json, a file next to index.html, once before it starts. { "server": "http://localhost:8080" } sends every API request there instead of to the app's own origin: /props, /v1, /models, /tools, the CORS proxy and the realtime socket. An empty or missing file keeps today's behaviour. The build ships an empty one.
  • npx llama-chat --server <url> answers config.json itself, and npx llama-chat build --server <url> writes it into the output folder. The CLI still forwards nothing.
  • The service worker leaves config.json out of its cache and the CLI serves it revalidated, so a host can change it without a new build.
  • It is a file on the app's own origin, not a URL parameter or a stored setting, so a link cannot point someone's app, and their API key, at another server.
  • @ggml-org/llama-chat and llama-chat go to 0.2.0, so the publish workflow ships --server to npx once this reaches master; 0.1.0, on npm now, does not have it.
  • The README's npx and self-hosting sections describe --server and config.json in place of adding servers by URL in the app, which is not in the app.
Testing
  • Unit tests for the config module (URL normalizing, serverUrl, loading) and for the CLI (--server parsing, the answered config.json, build --server); vitest --project=unit passes.
  • Built the app and loaded it from the CLI's server in headless Chromium against a llama-server on another port. With --server, only config.json came from the app's address and /props, /v1/models, /models/sse and /tools went to llama-server, with no "Server unavailable"; without it, every request stayed on the app's address as before.
  • The CLI still forwards nothing with --server: as ui: run Llama Chat with npx @ggml-org/llama-chat #32524 settled with ServeurpersoCom, the browser talks to llama-server directly, so llama-server's own origin and key rules apply. A CLI test now checks that, given a server, it still answers 404 for API paths and 405 for anything but GET and HEAD.
  • /tools answered 403 there, llama-server's own origin rule for tools without --cors-origins.
  • Not verified: sending a chat message in that setup, the realtime voice socket, and the app embedded in llama-server with the new empty config.json.

Requirements

@github-actions github-actions Bot added documentation Improvements or additions to documentation server/ui labels Nov 24, 2026
@allozaur
allozaur marked this pull request as ready for review November 24, 2026 16:29
@allozaur
allozaur requested a review from a team as a code owner November 24, 2026 16:29
The app reads config.json, a file next to index.html, once before it
starts. A "server" URL in it sends every API request there instead of
to the app's own origin: /props, /v1, /models, /tools, the CORS proxy
and the realtime socket. Without one nothing changes.

npx llama-chat --server <url> answers that file itself, and
npx llama-chat build --server <url> writes it. The service worker
leaves it out of its cache, so a host can change it without a new
build.

Assisted-by: Claude (Fable 5.2)
Bumps @ggml-org/llama-chat and llama-chat to 0.2.0 so the publish
workflow ships the --server flag to npx once this reaches master.

Assisted-by: Claude (Opus 5.5 Medium)
ggml-org#32890 named the PWA Llama Chat by default, but the E2E test still
expected llama-ui, so the UI workflow failed on master and on every UI PR.

Assisted-by: Claude (Opus 5.5 Medium)
@allozaur
allozaur force-pushed the allozaur/feat/ui-server-origin branch from 5b47146 to 91b1789 Compare November 24, 2026 16:32
@allozaur
allozaur merged commit 0ce7f21 into ggml-org:master Nov 24, 2026
9 of 10 checks passed
abeloin added a commit to abeloin/llama.cpp-mix that referenced this pull request Nov 25, 2026
…owner 2026-11-25)

Base b12723 (merge a940ab9), pin ggml-org#401 removed (80211b4), RoPE
multi-section fusion from upstream ggml-org#32500 (owner's decision), MIX.md
(3563400). Build gate: test-backend-ops ROCm 21878/21878, bench r17
(llama-mix-notes, mesures/2026.md): Inkling tg +4.5 % [bon], Qwen3.6 and
Gemma 4 without regression.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QBjnvFCJ83vkmygsLNv5cu

* mix/wip-b12723: (55 commits)
  mix: MIX.md — base b12723 (branche wip), retrait du pin ggml-org#401, conflit RoPE tranché (amont ggml-org#32500)
  revert: pin: CUDA: fuse the row L2 clip chain (unslothai#401, commit 6c0e84d)
  model : inkling2 graph with fewer ops in mix() and control() (ggml-org#32948)
  opencl: add clc coopmat moe kernel for q4_0/q4_1/q4_k/q5_0/q5_1/q5_k/q6_k/mxfp4 (ggml-org#32971)
  tests : fix MSVC static build of test-batch-alloc and test-server-component (ggml-org#32870)
  feat: Inkling 2 DSpark support (ggml-org#32218)
  cuda : fix int overflow of the MMVF matrix offsets (ggml-org#32965)
  docs : describe SpacemiT runtime environment variables (ggml-org#32452)
  ggml : fix SpacemiT flash attention null mask, ALiBi and softcap (ggml-org#32182)
  cmake : include the llguidance header from the source tree (ggml-org#32928)
  ci : move some jobs to gb10 runners (ggml-org#32968)
  ui: run Llama Chat apart from llama-server, named in config.json or npx --server (ggml-org#32945)
  ui: fix prebuilt UI download in shallow clones (ggml-org#32952)
  convert : fix qwen3-omni conversion (ggml-org#32941)
  ggml-cpu: repack kernels for targets without dotprod (ARMv8.0 64-bit) for Q4_0/Q8_0 (ggml-org#32142)
  ui: expect the Llama Chat name in the PWA manifest e2e test (ggml-org#32959)
  ggml-cpu: add SVE-optimized q5_0 and q5_1 dot-product kernels (ggml-org#30867)
  server : include MCP image and audio data in tool results (ggml-org#32064)
  context : prevent excessive CPU polling without OpenMP (ggml-org#32378)
  metal : reserve the top-k scratch only for short rows (ggml-org#32942)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation server/ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants