Files
llama.cpp/ui
Aleksander Grygier 55b8d8d898 ui: full-screen diagram preview that zooms around what is on screen, inert diagrams (#32591)
* ui: keep Pele diagrams inert

Pele turns a node with `click ... href` into a live link, where Mermaid's
strict security level left diagrams without links. Unwrap every link in
Pele's output, keeping its children, so the inline block, the live-preview
editor, the preview dialog and the downloaded svg stay inert. The Diagrams
story's flowchart now carries click directives and its play test checks
that no link or href is left.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: open diagrams full screen, zoom around what is on screen

The diagram preview dialog fills the window on every device. The preview
places the diagram from its top left corner, so a zoom keeps a screen point
fixed: the wheel and a trackpad pinch zoom around the pointer, the buttons
and +/- keys around the middle of the screen, wherever the diagram has been
panned to. Two-finger pinch, double-click and arrow keys work too. The
diagram opens fitted and keeps fitting until panned or zoomed; Reset view
fits it again.

Adds MermaidPreview and DialogMermaidPreview stories with play tests and a
unit test for the zoom math.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: add a diagrams trace to the demo fixtures

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-20 09:57:44 +01:00
..

ui

The UI of llama.cpp: the packages in lib and the apps built on them.

ui/
├── lib/
│   └── ui/     @ggml-org/llama-ui: design tokens, fonts, surfaces and components
└── apps/
    └── chat/   Llama Chat, the chat app that llama-server serves
  • lib/ui draws the parts and handles interaction, with no business logic. It is built with @sveltejs/package and published to npm as @ggml-org/llama-ui. Apps in this repo skip the package: they compile its sources as part of their own build, so they hold no copy of a component, a token or a font.
  • apps/chat talks to llama-server, stores conversations and runs the agentic loop. CMake builds it into llama-server (see scripts/ui-assets.cmake), and it is published to npm as @ggml-org/llama-chat (with llama-chat as its short name), so npx llama-chat runs it against any llama-server.

Each folder is its own npm package with its own package-lock.json: run npm ci in the one you work on. Building, checking and testing apps/chat needs no install in lib/ui.

Releases

The npm packages are versioned by hand, with semver, and published by CI:

Package Version in Published by
@ggml-org/llama-ui lib/ui/package.json ui-lib-publish.yml
@ggml-org/llama-chat and llama-chat apps/chat/package.json and apps/chat/alias/package.json, always the same ui-chat-publish.yml

To release, bump the version in the PR that should ship the change: a patch for fixes, a minor for new or changed features or API while the version is 0.x. When that PR reaches master with a version npm does not have yet, the workflow builds the package and publishes it; any other commit publishes nothing. A version lower than the one on npm fails the run.

Llama Chat as bundled in llama-server is not versioned this way: it ships in every llama.cpp release, as b<build>.