@ggml/llama-ui
v0.2.0
Published
Shared UI library for llama.cpp frontend apps.
Readme
@ggml/llama-ui
Llama UI, the design system of Llama Chat and the Llama apps, as a package: its tokens, fonts, surfaces and
components, for llama.pages (llama.app) first and Llama Chat (tools/ui in llama.cpp) later. The rules are in
tools/ui's DESIGN.md and BRAND.md; SYNC.md says what was taken from there and how to keep the two in
step.
Use
/* app.css */
@import 'tailwindcss';
@import '@ggml/llama-ui/theme.css';<script lang="ts">
import { Badge, Button } from '@ggml/llama-ui';
</script>
<Button variant="secondary">View on Hugging Face</Button>
<Badge variant="success">Downloaded</Badge>theme.css: everything: fonts, tokens, surfaces, the Tailwind theme and base styles. It needs Tailwind 4.tokens.css: the three tiers of tokens only.fonts.css: Llama Sans and Llama Mono.surfaces.css: the matte surface utilities.- Dark mode is the
darkclass on<html>; the Matte light surfaces are thetheme-matteclass.
What's in it
- Foundations: the primitive, semantic and component tokens, the type roles (
text-body,text-label…), corner, icon and control-height roles, the matte surfaces and elevations, Llama Sans and Llama Mono. - Components: Button, Badge, Card, Input, Label, Popover, Select, Separator, Switch, Toggle, ToggleGroup, Tooltip, ActionIcon (an icon button with a tooltip), SearchInput (a search field with a clear button) and Logo (the brand mark).
FILTER_TRIGGER_CLASSandFILTER_TOGGLE_ITEM_CLASSstyle a filters bar the way Llama Chat's Models Manager does. - Model UI: how a model is shown in Llama Chat and on llama.app:
ModelCard,ModelFamilyCard(a family as llama.app's catalog shows it),ModelId(name, badges, capability, context and size icons),ModelCapabilityIcons(icons or labelled badges),ModelOrgAvatar,ModelMetadataItem,ModelQuantOptions,ModelQuantChip,ModelQuantRow, plus the formatters andminMemoryTierGbandsummarizeSizes. They take model data in and report what the user did out; fetching and downloading stay in the app.
Next: Tabs and Separator, and llama.app's model page from its proposal (Scrapbook › UI › llama.app).
Development
npm run storybook: a copy of Llama UI's Storybook in llama.cpp, cut down to what the package holds, with the Scrapbook for proposalsnpm run dev: Storybook and a small SvelteKit check page (src/routes)npm run check: svelte-checknpm run prepack: build the library intodist/and run publint
