llama.cpp/ui/README.md
Aleksander Grygier fa9f928f25
ui: move the demo harness to ui/lib/demo and render videos on the Llama brand (#33125)
* ui: render demo videos in a window on a brand ground

A demo video is now rendered from the recorded frames: the app in a rounded window on a Llama brand ground, camera zooms with motion blur, captions under the window, and an optional logo card. DEMO_POLISH=0 gives the plain screencast as before.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: let demos mock llama-server and record Storybook stories

Assisted-by: Claude (Opus 5.5 Medium)

* ui: check chat search end to end against a mocked llama-server

Assisted-by: Claude (Opus 5.5 Medium)

* ui: add a skill to demo, test and document Llama Chat and Llama UI changes

Assisted-by: Claude (Opus 5.5 Medium)

* ui: describe the demo render in the README and the ui-demo skill

Assisted-by: Claude (Opus 5.5 Medium)

* ui: zoom the whole stage in demo videos, show taps on touch demos

The camera now moves over the stage, so the window comes closer with its corners and the ground round it. The render runs in a Chromium of its own at 1x. A touch device shows a fingertip tap in place of the cursor.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: make the demo camera moves shorter and snappier

Assisted-by: Claude (Opus 5.5 Medium)

* ui: fix tiled shadows when the demo camera zooms in

Each copy of the window is now laid out where the camera puts it instead of scaled with a transform: Chromium cut the scaled shadow into tiles, which left light rectangles round a zoomed window. The motion blur now spans half a frame, like a 180 degree shutter.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: draw the zoomed demo window on one canvas

The motion blur copies are drawn on one stage canvas, with the squircle corners and the shadow in 2D, instead of as one layer each: twelve large layers overran Chromium's tile memory while the camera moved, and the dropped tiles showed as light blocks round the window.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: leave phone demos unzoomed in the ui-demo skill and README

Assisted-by: Claude (Opus 5.5 Medium)

* ui: show each demo video beside its description in the PR

A test's description annotation is written to the video manifest; when the tests have one, the Demo section puts one video to a row with its title and description.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: move the demo harness to ui/lib/demo

The recorder, the render, the Demo driver, storage and the pr and docs commands are now @ggml-org/llama-demo in ui/lib/demo, for any app in the suite. It imports only Playwright's types: the app passes in its page, so it runs from source with nothing installed. Llama Chat keeps its fixtures, servers and traces command in its demo folder.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: harden the demo render and the pr command

The render cleans up after a failure and removes the part-written mp4. A page the render cannot frame records plainly instead of losing its captions, demos fail early outside Chromium, and the render's extra time is added after the demo, so a test.setTimeout() in it cannot take it away. demo:pr finds the app in the worktree from git's own prefix, a description's line breaks stay inside its table cell, zoomIn scrolls its target into view, and a quick second tap keeps its fingertip.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: teach the ui-demo skill to shape, check and publish a demo

Assisted-by: Claude (Opus 5.5 Medium)

* ui: import the demo harness as @ggml-org/llama-demo

Llama Chat adds ui/lib/demo as a local file: dependency, which npm links, and imports it by name instead of by relative path. Nothing is published; npm ci leaves a link that only the demo commands follow.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-26 17:15:39 +01:00

3.5 KiB

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
│   ├── voice/    @ggml-org/llama-voice: microphone capture, transcription and dictation
│   ├── harness/  @ggml-org/llama-harness: the agentic loop, headless
│   └── demo/     @ggml-org/llama-demo: scripted demo videos for PRs and docs
└── 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.
  • lib/voice records the microphone and turns speech into text through llama-server, with no UI: Llama UI draws the voice parts. It is plain TypeScript built with tsc, plus a Svelte entry (@ggml-org/llama-voice/svelte). Apps in this repo compile its sources too. It is not published to npm yet.
  • lib/harness is the agentic loop: plain TypeScript with no UI and no dependencies. An app gives it an inference client and tools, and reads its events.
  • lib/demo records scripted demo videos of the apps for PRs and docs, and renders them on the Llama brand. It is Node TypeScript that an app adds as a local file: dependency and imports by name, with the app's own Playwright; it is private, not published to npm.
  • apps/chat talks to llama-server, stores conversations and runs the agentic loop through the harness. 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, lib/voice, lib/harness or lib/demo.

The split between library and app is not finished. Llama Chat takes its tokens, fonts, surfaces and base components from lib/ui, but still has its own versions of what the library holds above those (ActionIcon, SearchInput, Logo, SyntaxHighlightedCode and the Model UI), and DESIGN.md, BRAND.md and the full Storybook still sit beside the app.

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>.