* ui: drop component tokens that only alias a semantic token A component token now exists only for what a component decides itself: a value no semantic token has, or one that only this component changes between themes. Components that take a semantic token as it is read it directly, so 88 of the 118 component tokens go, with no change to what is drawn. Also drops semantic tokens that repeat another one (status-* is fill-*, elevation-tooltip is elevation-surface), the unused info lamp tokens and 14 primitives nothing reads, and adds fg-soft for the label of an option that is not the picked one (tabs, toggle group). Assisted-by: Claude (Opus 5.5 Medium) * ui: add a short summary on top of DESIGN.md The rules most changes need, in one screen: components, colour, type, shape, sizes, surfaces, tokens and no arbitrary values. The sections below keep the detail. Assisted-by: Claude (Opus 5.5 Medium) * ui: derive design tokens by rule and drop the alias layers Semantic tokens are either a pick (a primitive per theme) or a derivation, mixed from another semantic token by a fixed rule and declared once: hover fills, status surfaces and lines, dark shadows (--elevation-strength), the middle of a matte edge, a lamp's rim and glyph. Primitives keep colours only. shadcn's colour names stay as Tailwind utilities and no longer exist as variables; neutral semantic utilities that duplicated them are gone. Assisted-by: Claude (Opus 5.5 Medium) * ui: set all text through type roles and move off-scale values onto the scale Tailwind's text sizes and bracketed sizes become the type roles, with a new text-caption-sm (10px) for tags and counts. Body and caption roles no longer set a weight, and line heights are written as Tailwind writes its own, so the swap from text-sm and text-xs changes no pixel. A unit test keeps old sizes from coming back. Arbitrary values with a scale equivalent use it (z-20, max-w-4/5, min-w-32), and the two easing curves repeated across the app are ease-out-quint and ease-sheet. DESIGN.md is updated and regenerated. Assisted-by: Claude (Opus 5.5 Medium) * ui: bump @ggml-org/llama-ui to 0.5.0 Removed and renamed tokens are breaking for an app that reads them. Assisted-by: Claude (Opus 5.5 Medium) * ui: add a display type role for the biggest headline The greeting on a new chat keeps its 30px from md up, now as text-display instead of a Tailwind size. Assisted-by: Claude (Opus 5.5 Medium) * ui: one corner scale, one set of shadows and three more derived tokens Six corner roles named values Tailwind's rounded-md to rounded-4xl already have, and components used the Tailwind names nine times out of ten. The roles are gone; the whole scale is computed from --radius. Tailwind's shadow sizes were restated next to the elevation tokens and did not follow the theme, so they were five times fainter in dark. The five uses take elevation tokens and a unit test keeps both from coming back. A button group's seam is the button's own text colour at 25%, the dark status text is the dark status fill, and the pressed shadow scales with --elevation-strength like the inset one. Assisted-by: Claude (Opus 5.5 Medium)
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/uidraws the parts and handles interaction, with no business logic. It is built with@sveltejs/packageand 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/chattalks to llama-server, stores conversations and runs the agentic loop. CMake builds it into llama-server (seescripts/ui-assets.cmake), and it is published to npm as@ggml-org/llama-chat(withllama-chatas its short name), sonpx llama-chatruns 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>.