@ggml-org/llama-ui 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,6 +10,7 @@ beside the apps built on it in `ui/apps`.
10
10
  /* app.css */
11
11
  @import 'tailwindcss';
12
12
  @import 'tw-animate-css';
13
+ @import '@ggml-org/llama-brand/css/colors.css';
13
14
  @import '@ggml-org/llama-ui/theme.css';
14
15
  ```
15
16
 
@@ -22,9 +23,9 @@ beside the apps built on it in `ui/apps`.
22
23
  <Badge variant="success">Downloaded</Badge>
23
24
  ```
24
25
 
25
- - `theme.css`: everything: fonts, tokens, surfaces, the Tailwind theme and base styles. It needs Tailwind 4 and
26
- `tw-animate-css`, both peer dependencies, imported before it.
27
- - `tokens.css`: the three tiers of tokens only. `fonts.css`: Llama Sans and Llama Mono. `surfaces.css`: the matte
26
+ - `theme.css`: everything: fonts, tokens, surfaces, the Tailwind theme and base styles. It needs Tailwind 4,
27
+ `tw-animate-css` (both peer dependencies) and `@ggml-org/llama-brand`'s `css/colors.css` imported before it.
28
+ - `tokens.css`: the three tiers of tokens only, also after `@ggml-org/llama-brand`'s `css/colors.css`. `fonts.css`: Llama Sans and Llama Mono. `surfaces.css`: the matte
28
29
  surface utilities.
29
30
  - Dark mode is the `dark` class on `<html>`; the Matte light surfaces are the `theme-matte` class.
30
31
 
@@ -35,16 +36,21 @@ beside the apps built on it in `ui/apps`.
35
36
  - **Components:** every base component of Llama Chat: Alert, AlertDialog, Badge, Button, ButtonGroup, Card, Checkbox,
36
37
  Collapsible, ContextMenu, Dialog, Drawer, DropdownMenu, Empty, HoverCard, Input, Label, Popover, RadioGroup,
37
38
  ScrollArea, Select, Separator, Skeleton, Switch, Table, Tabs, Textarea, Toggle, ToggleGroup and Tooltip. Each is
38
- also its own entry point (`@ggml-org/llama-ui/ui/dialog`), with `cn` and `tv` at `@ggml-org/llama-ui/utils`. Then ActionIcon (an icon button with a tooltip), SearchInput (a search field with a clear button), SyntaxHighlightedCode (code as Llama Chat shows it, in highlight.js's GitHub themes; needs `mode-watcher`) and Logo (the brand mark). `FILTER_TRIGGER_CLASS` and `FILTER_TOGGLE_ITEM_CLASS` style a filters bar the way Llama Chat's Models Manager does.
39
+ also its own entry point (`@ggml-org/llama-ui/ui/dialog`), with `cn` and `tv` at `@ggml-org/llama-ui/utils`. Then ActionIcon (an icon button with a tooltip), SearchInput (a search field with a clear button), SyntaxHighlightedCode (code as Llama Chat shows it, in highlight.js's GitHub themes; needs `mode-watcher`) and Logo (the brand mark, llama-brand's icon), at `@ggml-org/llama-ui/app/actions`, `app/forms`, `app/content` and `app/misc`. `FILTER_TRIGGER_CLASS` and `FILTER_TOGGLE_ITEM_CLASS` style a filters bar the way Llama Chat's Models Manager does.
39
40
  - **App mockups:** MacMenu (Llama for Mac's menu) and WindowsTray (Llama for Windows' tray flyout), the native apps' UIs as the brand's communications draw them, with an `annotate` snippet to pin a page's numbered callouts to their edges.
40
41
  - **Model UI:** how a model is shown in Llama Chat and on llama.app: `ModelCard`, `ModelFamilyCard` (a family as llama.app's catalog
41
42
  shows it), `ModelId` (name, badges, capability,
42
43
  context and size icons), `ModelCapabilityIcons` (icons or labelled badges), `ModelOrgAvatar`, `ModelMetadataItem`,
43
- `ModelQuantOptions`, `ModelQuantChip`, `ModelQuantRow`, plus the formatters and
44
- `minMemoryTierGb` and `summarizeSizes`. They take model data in and report what the user did out; fetching and downloading stay in the
45
- app.
44
+ `ModelQuantOptions`, `ModelQuantChip`, `ModelQuantRow`, `ModelDraftSidecars`, `ModelDownloadProgressBar`, plus the formatters and
45
+ `minMemoryTierGb` and `summarizeSizes`, at `@ggml-org/llama-ui/models`. They take model data in and report what the user did out;
46
+ fetching and downloading stay in the app.
46
47
 
47
- Next: llama.app's model page from its proposal (Scrapbook › UI › llama.app).
48
+ Next: llama.app's model page.
49
+
50
+ The constants, enums and code helpers the components use are entry points too, for an app that shows the same things:
51
+ `@ggml-org/llama-ui/constants` (the shared classes and code-block constants), `@ggml-org/llama-ui/enums` (`ColorMode`,
52
+ `TooltipSide`, `BooleanString`) and `@ggml-org/llama-ui/code` (`highlightCode`, `trimCodePadding`). The model data
53
+ (constants, enums, formatters and types) comes with the Model UI at `@ggml-org/llama-ui/models`.
48
54
 
49
55
  ## How the apps in this repo use it
50
56
 
@@ -55,13 +61,31 @@ shows in the app at once and the app keeps no copy of a component or a token. Fo
55
61
  the app's own `src/lib`.
56
62
  - What they import from npm is listed in `dependencies` or `peerDependencies`: the app reads that list to resolve
57
63
  those packages from its own `node_modules` (`ui/apps/chat/scripts/llama-ui.js`).
58
- - Stylesheets import no package. An app imports Tailwind and `tw-animate-css` itself, before `theme.css`.
64
+ - Stylesheets import no package. An app imports Tailwind, `tw-animate-css` and `@ggml-org/llama-brand`'s `css/colors.css`
65
+ (the brand's colours, under the names the primitives use) itself, before `theme.css`.
59
66
  - A component added with shadcn-svelte (`components.json`) arrives with `$lib` imports: make them relative.
60
67
 
61
68
  ## Development
62
69
 
63
- - `npm run storybook`: a copy of Llama UI's Storybook in llama.cpp, cut down to what the package holds, with the
64
- Scrapbook for proposals
65
- - `npm run dev`: Storybook and a small SvelteKit check page (`src/routes`)
70
+ - `npm run dev`: a small SvelteKit check page (`src/routes`)
66
71
  - `npm run check`: svelte-check
67
72
  - `npm run prepack`: build the library into `dist/` and run publint
73
+ - `node scripts/npm-version-check.mjs`: what the release workflow would make of this folder, against the real registry
74
+
75
+ ## Releases
76
+
77
+ The package is published from here by
78
+ [`ui-lib-publish.yml`](../../../.github/workflows/ui-lib-publish.yml), which runs when a commit reaches `master` with
79
+ `ui/lib/ui` in it. The version in `package.json` is the release: land a bump together with the change that should ship
80
+ and the workflow type-checks, builds, lints and publishes that version to npm, with a provenance attestation. A library
81
+ change that carries no bump publishes nothing and leaves a warning on the run.
82
+
83
+ - `npm version <patch|minor> --no-git-tag-version` and commit: it moves `package.json` and both version fields of the
84
+ lockfile together.
85
+ - Below `1.0`: a breaking change bumps the minor, a feature bumps the patch.
86
+ - A version with a prerelease suffix (`0.5.0-beta.1`) publishes under the `next` tag, so `latest` stays a stable build.
87
+ - Publishing needs no token in the repo: the job trades its OIDC identity for one, so the only place to look when a
88
+ publish is refused is the package's trusted-publisher settings on npm. A publisher names a workflow that must already
89
+ exist under `.github/workflows`, so it is added after this workflow lands, and it allows staged publishing until
90
+ `npm publish` is permitted for it. Provenance is generated without asking, and only on a GitHub-hosted runner: a
91
+ self-hosted one cannot publish this way.
@@ -1,5 +1,9 @@
1
1
  <script>
2
- import logoMark from '../../../assets/logo.svg?raw';
2
+ import icon from '@ggml-org/llama-brand/logo/svg/icon/icon-light.svg?raw';
3
+
4
+ // llama-brand draws the icon in its ink; currentColor lets it follow the text colour.
5
+ const logoMark = icon.replace(/fill="#[0-9a-f]{3,8}"/gi, 'fill="currentColor"');
6
+
3
7
  let { class: className = '', style = '' } = $props();
4
8
  </script>
5
9
 
@@ -0,0 +1,39 @@
1
+ <!--
2
+ A model's draft sidecars, one badge each, titled with the sidecar's own quant when it has one.
3
+ -->
4
+ <script lang="ts">
5
+ import { MODEL_VARIANT_BADGE_CLASS } from '../../models/constants';
6
+ import type { ModelDraftSidecarBadge } from '../../models/types';
7
+ import { SvelteSet } from 'svelte/reactivity';
8
+
9
+ interface Props {
10
+ /** Draft sidecars available for the model, each with its own quant. */
11
+ draftSidecars?: ModelDraftSidecarBadge[];
12
+ }
13
+
14
+ let { draftSidecars = [] }: Props = $props();
15
+
16
+ // an app can learn of the same sidecar from more than one place
17
+ let badges = $derived.by(() => {
18
+ const seen = new SvelteSet<string>();
19
+
20
+ return draftSidecars.filter((badge) => {
21
+ const key = `${badge.kind}:${badge.quant ?? ''}`;
22
+
23
+ if (seen.has(key)) return false;
24
+
25
+ seen.add(key);
26
+
27
+ return true;
28
+ });
29
+ });
30
+ </script>
31
+
32
+ {#each badges as badge (badge.kind + (badge.quant ?? ''))}
33
+ <span
34
+ class={MODEL_VARIANT_BADGE_CLASS}
35
+ title="{badge.kind.toUpperCase()} draft model{badge.quant ? ` at ${badge.quant}` : ''}"
36
+ >
37
+ {badge.kind}
38
+ </span>
39
+ {/each}
@@ -0,0 +1,8 @@
1
+ import type { ModelDraftSidecarBadge } from '../../models/types';
2
+ interface Props {
3
+ /** Draft sidecars available for the model, each with its own quant. */
4
+ draftSidecars?: ModelDraftSidecarBadge[];
5
+ }
6
+ declare const ModelDraftSidecars: import("svelte").Component<Props, {}, "">;
7
+ type ModelDraftSidecars = ReturnType<typeof ModelDraftSidecars>;
8
+ export default ModelDraftSidecars;
@@ -1,10 +1,12 @@
1
1
  <!--
2
- A model's name with its badges (parameters, quantization, drafts, tags) and its capability, context and size icons.
3
- The props-in version of ui/apps/chat's ModelId: the app passes the parts it already knows (a parsed id, a catalog
4
- entry) instead of a raw id read against the user's settings, so the same markup serves Llama Chat and llama.app.
2
+ A model's name with its badges (draft kind, parameters, quantization, drafts, aliases, tags) and its capability,
3
+ context and size icons. The app passes the parts it already knows (a parsed id, a catalog entry) and the user's
4
+ display settings as the props it sets or leaves out, so the same markup serves Llama Chat and llama.app.
5
5
  -->
6
6
  <script lang="ts">
7
7
  import ModelCapabilityIcons from './ModelCapabilityIcons.svelte';
8
+ import ModelDraftSidecars from './ModelDraftSidecars.svelte';
9
+ import * as Tooltip from '../ui/tooltip';
8
10
  import { Database, ScrollText } from '@lucide/svelte';
9
11
  import {
10
12
  MODEL_BADGE_CLASS,
@@ -12,7 +14,7 @@
12
14
  MODEL_VARIANT_BADGE_CLASS
13
15
  } from '../../models/constants';
14
16
  import { formatParameters, formatSizeRange } from '../../models/format';
15
- import type { ModelModalities, ModelSizeRange } from '../../models/types';
17
+ import type { ModelDraftSidecarBadge, ModelModalities, ModelSizeRange } from '../../models/types';
16
18
 
17
19
  interface Props {
18
20
  /** The model's name, e.g. `gemma-4` or `Gemma 4 E4B`. */
@@ -25,8 +27,17 @@
25
27
  activatedParams?: string;
26
28
  /** Quantization, e.g. `Q4_K_M`. */
27
29
  quantization?: string;
28
- /** Draft sidecar kinds the model comes with, e.g. `mtp`, one badge each. */
30
+ /** The draft kind the model itself is, e.g. `mtp` for an MTP head; badged first. */
31
+ sidecar?: string;
32
+ /** Draft sidecar kinds the model comes with, e.g. `mtp`, one badge each and no quant. */
29
33
  draftKinds?: string[];
34
+ /** Draft sidecars the model comes with, badged with their own quant. */
35
+ draftSidecars?: ModelDraftSidecarBadge[];
36
+ /**
37
+ * Names the model is served under. One alias replaces the name, which moves to a badge; more than one are
38
+ * badged after the name, two at most and then `+x more`.
39
+ */
40
+ aliases?: string[];
30
41
  tags?: string[];
31
42
  modalities?: ModelModalities;
32
43
  supportsThinking?: boolean;
@@ -35,6 +46,7 @@
35
46
  contextLength?: number;
36
47
  /** Min/max file size across quants, in bytes; renders a size icon when set. */
37
48
  sizeRange?: ModelSizeRange | null;
49
+ hideName?: boolean;
38
50
  hideOrgName?: boolean;
39
51
  hideCapabilities?: boolean;
40
52
  hideModalities?: boolean;
@@ -44,18 +56,23 @@
44
56
  stackId?: boolean;
45
57
  /** Allow badges to wrap onto new lines instead of truncating. */
46
58
  wrap?: boolean;
47
- /** Native title for the root element. */
59
+ /** Native title for the root element; keeps long lists light where a floating tooltip per row is too costly. */
48
60
  title?: string;
61
+ /** Shown in a tooltip over the name and badges, e.g. the raw id the name was parsed from. */
62
+ tooltip?: string;
49
63
  class?: string;
50
64
  }
51
65
 
52
66
  let {
53
67
  activatedParams,
68
+ aliases = [],
54
69
  class: className = '',
55
70
  contextLength,
56
71
  draftKinds = [],
72
+ draftSidecars = [],
57
73
  hideCapabilities = false,
58
74
  hideModalities = false,
75
+ hideName = false,
59
76
  hideOrgName = false,
60
77
  iconsOnNewLine = false,
61
78
  modalities,
@@ -63,65 +80,126 @@
63
80
  org,
64
81
  params,
65
82
  quantization,
83
+ sidecar,
66
84
  sizeRange,
67
85
  stackId = false,
68
86
  supportsThinking = false,
69
87
  supportsToolUse = false,
70
88
  tags = [],
71
89
  title,
72
- wrap = false
90
+ tooltip,
91
+ wrap = false,
92
+ ...rest
73
93
  }: Props = $props();
74
94
 
95
+ /** Alias badges beyond this many collapse into a single `+x more` badge. */
96
+ const MAX_ALIAS_BADGES = 2;
97
+
98
+ let uniqueAliases = $derived([...new Set(aliases)]);
75
99
  let uniqueTags = $derived([...new Set(tags)]);
76
- let uniqueDraftKinds = $derived([...new Set(draftKinds)]);
100
+ // the model itself can already be one of the kinds
101
+ let uniqueDraftKinds = $derived([...new Set(draftKinds.filter((kind) => kind !== sidecar))]);
102
+
103
+ let primaryAlias = $derived(uniqueAliases.length === 1 ? uniqueAliases[0] : null);
104
+ let displayName = $derived(primaryAlias ?? name);
77
105
 
78
106
  let hasBadges = $derived(
79
- uniqueDraftKinds.length > 0 || params || quantization || uniqueTags.length > 0
107
+ sidecar ||
108
+ uniqueDraftKinds.length > 0 ||
109
+ draftSidecars.length > 0 ||
110
+ params ||
111
+ quantization ||
112
+ primaryAlias ||
113
+ uniqueAliases.length > 1 ||
114
+ uniqueTags.length > 0
80
115
  );
81
116
  </script>
82
117
 
118
+ {#snippet nameAndBadges()}
119
+ {#if !hideName}
120
+ <span class="min-w-0 truncate font-medium {stackId ? 'basis-full' : ''}">
121
+ {#if !hideOrgName && org}{org}/{/if}{displayName}
122
+ </span>
123
+ {/if}
124
+
125
+ {#if hasBadges}
126
+ <!-- the badges keep their width, so a long name truncates around them instead of
127
+ a label being cut in half -->
128
+ <span
129
+ class="inline-flex min-w-0 items-center gap-1 overflow-hidden {wrap
130
+ ? 'flex-wrap'
131
+ : 'shrink-0'}"
132
+ >
133
+ {#if sidecar}
134
+ <span class={MODEL_VARIANT_BADGE_CLASS} title={`${sidecar.toUpperCase()} draft model`}>
135
+ {sidecar}
136
+ </span>
137
+ {/if}
138
+
139
+ {#if params}
140
+ <span class={MODEL_BADGE_CLASS}>
141
+ {params}{activatedParams ? `-${activatedParams}` : ''}
142
+ </span>
143
+ {/if}
144
+
145
+ {#if quantization}
146
+ <span class={MODEL_BADGE_CLASS}>{quantization}</span>
147
+ {/if}
148
+
149
+ {#each uniqueDraftKinds as kind (kind)}
150
+ <span class={MODEL_VARIANT_BADGE_CLASS} title="{kind.toUpperCase()} draft model">
151
+ {kind}
152
+ </span>
153
+ {/each}
154
+
155
+ <ModelDraftSidecars {draftSidecars} />
156
+
157
+ {#if primaryAlias}
158
+ {#if primaryAlias !== name}
159
+ <span class="{MODEL_BADGE_CLASS} max-w-32 truncate" title={name}>{name}</span>
160
+ {/if}
161
+ {:else if uniqueAliases.length > 1}
162
+ {#each uniqueAliases.slice(0, MAX_ALIAS_BADGES) as alias (alias)}
163
+ <span class="{MODEL_BADGE_CLASS} max-w-32 truncate" title={alias}>{alias}</span>
164
+ {/each}
165
+
166
+ {#if uniqueAliases.length > MAX_ALIAS_BADGES}
167
+ <span class={MODEL_BADGE_CLASS} title={uniqueAliases.slice(MAX_ALIAS_BADGES).join(', ')}>
168
+ +{uniqueAliases.length - MAX_ALIAS_BADGES} more
169
+ </span>
170
+ {/if}
171
+ {/if}
172
+
173
+ {#each uniqueTags as tag (tag)}
174
+ <span class={MODEL_TAG_BADGE_CLASS}>{tag}</span>
175
+ {/each}
176
+ </span>
177
+ {/if}
178
+ {/snippet}
179
+
83
180
  <!-- badges, tags and icons do not shrink, so overflow-hidden bounds the name -->
84
181
  <span
85
182
  class="flex min-w-0 items-center gap-1.5 overflow-hidden {wrap ? 'flex-wrap' : ''} {iconsOnNewLine
86
183
  ? 'flex-col items-start'
87
184
  : ''} {className}"
88
185
  {title}
186
+ {...rest}
89
187
  >
90
188
  <span
91
189
  class="flex min-w-0 items-center gap-1.5 max-md:gap-0.5 {wrap || stackId ? 'flex-wrap' : ''}"
92
190
  >
93
- <span class="min-w-0 truncate font-medium {stackId ? 'basis-full' : ''}">
94
- {#if !hideOrgName && org}{org}/{/if}{name}
95
- </span>
191
+ {#if tooltip}
192
+ <Tooltip.Root>
193
+ <Tooltip.Trigger class="flex min-w-0 items-center gap-1.5">
194
+ {@render nameAndBadges()}
195
+ </Tooltip.Trigger>
96
196
 
97
- {#if hasBadges}
98
- <!-- the badges keep their width, so a long name truncates around them instead of
99
- a label being cut in half -->
100
- <span
101
- class="inline-flex min-w-0 items-center gap-1 overflow-hidden {wrap
102
- ? 'flex-wrap'
103
- : 'shrink-0'}"
104
- >
105
- {#if params}
106
- <span class={MODEL_BADGE_CLASS}>
107
- {params}{activatedParams ? `-${activatedParams}` : ''}
108
- </span>
109
- {/if}
110
-
111
- {#if quantization}
112
- <span class={MODEL_BADGE_CLASS}>{quantization}</span>
113
- {/if}
114
-
115
- {#each uniqueDraftKinds as kind (kind)}
116
- <span class={MODEL_VARIANT_BADGE_CLASS} title="{kind.toUpperCase()} draft model">
117
- {kind}
118
- </span>
119
- {/each}
120
-
121
- {#each uniqueTags as tag (tag)}
122
- <span class={MODEL_TAG_BADGE_CLASS}>{tag}</span>
123
- {/each}
124
- </span>
197
+ <Tooltip.Content>
198
+ <p>{tooltip}</p>
199
+ </Tooltip.Content>
200
+ </Tooltip.Root>
201
+ {:else}
202
+ {@render nameAndBadges()}
125
203
  {/if}
126
204
 
127
205
  {#if !iconsOnNewLine}
@@ -1,4 +1,4 @@
1
- import type { ModelModalities, ModelSizeRange } from '../../models/types';
1
+ import type { ModelDraftSidecarBadge, ModelModalities, ModelSizeRange } from '../../models/types';
2
2
  interface Props {
3
3
  /** The model's name, e.g. `gemma-4` or `Gemma 4 E4B`. */
4
4
  name: string;
@@ -10,8 +10,17 @@ interface Props {
10
10
  activatedParams?: string;
11
11
  /** Quantization, e.g. `Q4_K_M`. */
12
12
  quantization?: string;
13
- /** Draft sidecar kinds the model comes with, e.g. `mtp`, one badge each. */
13
+ /** The draft kind the model itself is, e.g. `mtp` for an MTP head; badged first. */
14
+ sidecar?: string;
15
+ /** Draft sidecar kinds the model comes with, e.g. `mtp`, one badge each and no quant. */
14
16
  draftKinds?: string[];
17
+ /** Draft sidecars the model comes with, badged with their own quant. */
18
+ draftSidecars?: ModelDraftSidecarBadge[];
19
+ /**
20
+ * Names the model is served under. One alias replaces the name, which moves to a badge; more than one are
21
+ * badged after the name, two at most and then `+x more`.
22
+ */
23
+ aliases?: string[];
15
24
  tags?: string[];
16
25
  modalities?: ModelModalities;
17
26
  supportsThinking?: boolean;
@@ -20,6 +29,7 @@ interface Props {
20
29
  contextLength?: number;
21
30
  /** Min/max file size across quants, in bytes; renders a size icon when set. */
22
31
  sizeRange?: ModelSizeRange | null;
32
+ hideName?: boolean;
23
33
  hideOrgName?: boolean;
24
34
  hideCapabilities?: boolean;
25
35
  hideModalities?: boolean;
@@ -29,8 +39,10 @@ interface Props {
29
39
  stackId?: boolean;
30
40
  /** Allow badges to wrap onto new lines instead of truncating. */
31
41
  wrap?: boolean;
32
- /** Native title for the root element. */
42
+ /** Native title for the root element; keeps long lists light where a floating tooltip per row is too costly. */
33
43
  title?: string;
44
+ /** Shown in a tooltip over the name and badges, e.g. the raw id the name was parsed from. */
45
+ tooltip?: string;
34
46
  class?: string;
35
47
  }
36
48
  declare const ModelId: import("svelte").Component<Props, {}, "">;
@@ -3,6 +3,7 @@
3
3
  * what the user did out; fetching, downloading and loading models stay in each app.
4
4
  */
5
5
  export { default as ModelCard } from './ModelCard.svelte';
6
+ export { default as ModelDraftSidecars } from './ModelDraftSidecars.svelte';
6
7
  export { default as ModelCapabilityIcons } from './ModelCapabilityIcons.svelte';
7
8
  export { default as ModelDownloadProgressBar } from './ModelDownloadProgressBar.svelte';
8
9
  export { default as ModelFamilyCard } from './ModelFamilyCard.svelte';
@@ -12,3 +13,4 @@ export { default as ModelOrgAvatar } from './ModelOrgAvatar.svelte';
12
13
  export { default as ModelQuantChip } from './ModelQuantChip.svelte';
13
14
  export { default as ModelQuantOptions } from './ModelQuantOptions.svelte';
14
15
  export { default as ModelQuantRow } from './ModelQuantRow.svelte';
16
+ export * from '../../models/index.js';
@@ -3,6 +3,7 @@
3
3
  * what the user did out; fetching, downloading and loading models stay in each app.
4
4
  */
5
5
  export { default as ModelCard } from './ModelCard.svelte';
6
+ export { default as ModelDraftSidecars } from './ModelDraftSidecars.svelte';
6
7
  export { default as ModelCapabilityIcons } from './ModelCapabilityIcons.svelte';
7
8
  export { default as ModelDownloadProgressBar } from './ModelDownloadProgressBar.svelte';
8
9
  export { default as ModelFamilyCard } from './ModelFamilyCard.svelte';
@@ -12,3 +13,5 @@ export { default as ModelOrgAvatar } from './ModelOrgAvatar.svelte';
12
13
  export { default as ModelQuantChip } from './ModelQuantChip.svelte';
13
14
  export { default as ModelQuantOptions } from './ModelQuantOptions.svelte';
14
15
  export { default as ModelQuantRow } from './ModelQuantRow.svelte';
16
+ // the data they take: constants, enums, formatters and types
17
+ export * from '../../models/index.js';
@@ -1,3 +1,3 @@
1
- // The enums the copied ui/apps/chat components import from `$lib/enums` (llama-ui only).
1
+ // The enums the components share with the apps built on them.
2
2
  export { BooleanString } from './boolean-string.enums.js';
3
3
  export { ColorMode, TooltipSide } from './ui.enums.js';
package/dist/index.d.ts CHANGED
@@ -37,4 +37,3 @@ export * as ToggleGroup from './components/ui/toggle-group/index.js';
37
37
  export * as Tooltip from './components/ui/tooltip/index.js';
38
38
  export * from './components/mockups/index.js';
39
39
  export * from './components/models/index.js';
40
- export * from './models/index.js';
package/dist/index.js CHANGED
@@ -39,4 +39,3 @@ export * as ToggleGroup from './components/ui/toggle-group/index.js';
39
39
  export * as Tooltip from './components/ui/tooltip/index.js';
40
40
  export * from './components/mockups/index.js';
41
41
  export * from './components/models/index.js';
42
- export * from './models/index.js';
@@ -27,8 +27,8 @@ export const MODALITY_FLAG_KEYS = {
27
27
  };
28
28
  export const MODALITY_ORDER = [
29
29
  ModelModality.VISION,
30
- ModelModality.AUDIO,
31
- ModelModality.VIDEO
30
+ ModelModality.VIDEO,
31
+ ModelModality.AUDIO
32
32
  ];
33
33
  export const CAPABILITY_ICONS = {
34
34
  [ModelCapability.REASONING]: ReasoningIcon,
@@ -17,6 +17,11 @@ export interface ModelQuantCompanion {
17
17
  sizeBytes?: number;
18
18
  onDisk?: boolean;
19
19
  }
20
+ /** A draft sidecar a model comes with, badged with its own quant when its file names one. */
21
+ export interface ModelDraftSidecarBadge {
22
+ kind: string;
23
+ quant?: string | null;
24
+ }
20
25
  export interface ModelDownloadProgress {
21
26
  downloadedBytes: number;
22
27
  totalBytes: number;
@@ -1,11 +1,13 @@
1
1
  /*
2
2
  * Llama UI's theme: fonts, tokens, surfaces and the Tailwind theme the components read.
3
- * Consumers import it after Tailwind and tw-animate-css, which the components' enter and exit
4
- * animations come from (a peer dependency, like Tailwind: an app that compiles these sources
5
- * itself resolves it from its own node_modules):
3
+ * Consumers import it after Tailwind, tw-animate-css, which the components' enter and exit
4
+ * animations come from (a peer dependency, like Tailwind), and @ggml-org/llama-brand's colours,
5
+ * which the primitives build on. Stylesheets here import no package, so an app that compiles
6
+ * these sources itself resolves all three from its own node_modules:
6
7
  *
7
8
  * @import 'tailwindcss';
8
9
  * @import 'tw-animate-css';
10
+ * @import '@ggml-org/llama-brand/css/colors.css';
9
11
  * @import '@ggml-org/llama-ui/theme.css';
10
12
  *
11
13
  * Dark mode is the `dark` class on <html>; the Matte light surfaces are the `theme-matte` class.
@@ -14,6 +14,8 @@
14
14
  --chat-form-edge-mid-focus: var(--edge-focus-mid);
15
15
  --chat-form-highlight: var(--highlight-inner);
16
16
  --chat-form-shadow: var(--elevation-soft);
17
+ /* the keys inside it: the add key and the model selector */
18
+ --chat-form-key-shadow: var(--elevation-key);
17
19
  --chat-form-radius: var(--radius-surface);
18
20
  --chat-form-radius-compact: var(--radius-surface-lg);
19
21
 
@@ -1,26 +1,14 @@
1
1
  /*
2
2
  * Tier 1: primitives. Raw values named by what they are, never by where they are used.
3
3
  * Only semantic tokens (semantic.css) reference these; components never do.
4
+ *
5
+ * The brand's own colours come from @ggml-org/llama-brand's css/colors.css, under the same names: the neutral greys
6
+ * (Tailwind's neutral scale plus four in-between steps), sand for communications, and the artwork colours (the day and
7
+ * night skies, cinder) with the skies' gradients. An app imports it before theme.css (see there); this file adds what
8
+ * only the interface needs.
4
9
  */
5
- :root {
6
- /* neutral greys: Tailwind's neutral scale plus four in-between steps */
7
- --neutral-0: oklch(1 0 0);
8
- --neutral-25: oklch(0.988 0 0);
9
- --neutral-50: oklch(0.985 0 0);
10
- --neutral-100: oklch(0.97 0 0);
11
- --neutral-150: oklch(0.95 0 0);
12
- --neutral-200: oklch(0.922 0 0);
13
- --neutral-300: oklch(0.87 0 0);
14
- --neutral-400: oklch(0.708 0 0);
15
- --neutral-500: oklch(0.556 0 0);
16
- --neutral-600: oklch(0.439 0 0);
17
- --neutral-700: oklch(0.371 0 0);
18
- --neutral-750: oklch(0.29 0 0);
19
- --neutral-800: oklch(0.269 0 0);
20
- --neutral-900: oklch(0.205 0 0);
21
- --neutral-925: oklch(0.16 0 0);
22
- --neutral-950: oklch(0.145 0 0);
23
10
 
11
+ :root {
24
12
  /* cool greys (hue 250) for hairline edges */
25
13
  --cool-gray-50: oklch(0.958 0.002 250);
26
14
  --cool-gray-100: oklch(0.938 0.004 250);
@@ -28,30 +16,9 @@
28
16
  --cool-gray-300: oklch(0.86 0.007 250);
29
17
  --cool-gray-400: oklch(0.81 0.01 250);
30
18
 
31
- /* sand: a warm neutral for communications (posters, boards, the site), after the type specimen's In use sand;
32
- the UI itself stays on the greys */
33
- --sand-50: oklch(0.965 0.01 80);
34
- --sand-100: oklch(0.936 0.015 81);
35
- --sand-200: oklch(0.89 0.02 80);
36
- --sand-400: oklch(0.72 0.025 76);
37
- --sand-900: oklch(0.272 0.013 72);
38
-
39
- /* artwork: the day sky and the night sky, llama.app's light and dark hero grounds, and cinder, the accent orange; with
40
- the greys and sand, the whole communications palette. Never for status, which keeps its own colours */
41
- --art-day-sky: oklch(0.78 0.075 245);
42
- --art-night-sky: oklch(0.33 0.07 256);
43
- /* the skies as grounds: the day deeper blue at the top and light at the horizon, the night darkest at the top and
44
- lifting a little towards the horizon, with a faint glow there */
45
- --art-day-sky-gradient:
46
- radial-gradient(ellipse at 15% 10%, #dcecfb 0%, transparent 55%),
47
- radial-gradient(ellipse at 90% 95%, #e8f2fc 0%, transparent 50%),
48
- linear-gradient(160deg, #c4ddf6 0%, #d0e4f7 55%, #dfecf9 100%);
49
- --art-night-sky-gradient:
50
- radial-gradient(ellipse 120% 60% at 50% 115%, rgb(46 70 104 / 0.35) 0%, transparent 70%),
51
- linear-gradient(180deg, #0f1a2b 0%, #13213a 55%, #182a45 100%);
52
- /* cinder: the brand's one accent orange, warm next to the day sky and the sand (#ee6c1e) */
53
- --art-cinder: oklch(0.68 0.18 46);
54
- --art-cinder-light: oklch(0.85 0.065 46);
19
+ /* the skies as grounds, by llama-brand's gradients */
20
+ --art-day-sky-gradient: var(--gradient-day-sky);
21
+ --art-night-sky-gradient: var(--gradient-night-sky);
55
22
 
56
23
  /* red, yellow and green: each scale keeps the hue of its root (red-500, yellow-400, green-500) */
57
24
  --red-400: oklch(0.69 0.2 27);
@@ -108,6 +108,9 @@
108
108
  --elevation-raised:
109
109
  0 2px 4px rgb(0 0 0 / 0.04), 0 6px 12px -3px rgb(0 0 0 / 0.06),
110
110
  0 16px 28px -6px rgb(0 0 0 / 0.08);
111
+ /* a key on a white surface, like the chat form's: a hairline all round and a drop of 1px, so it stands apart
112
+ without the control elevation's soft spread, which blends into the white */
113
+ --elevation-key: 0 0 0 0.5px rgb(0 0 0 / 0.08), 0 1px 1.5px rgb(0 0 0 / 0.08);
111
114
  /* softer steps: the chat form floats only a little, its shadow close and tight (smooth near layers, nothing
112
115
  reaching past 6px); a message bubble barely lifts */
113
116
  --elevation-soft:
@@ -209,6 +212,7 @@
209
212
  0 0.5px 1px rgb(0 0 0 / 0.3), 0 1px 2px rgb(0 0 0 / 0.25), 0 2px 4px -1px rgb(0 0 0 / 0.25);
210
213
  --elevation-raised:
211
214
  0 2px 4px rgb(0 0 0 / 0.25), 0 6px 12px -3px rgb(0 0 0 / 0.3), 0 16px 28px -6px rgb(0 0 0 / 0.4);
215
+ --elevation-key: var(--elevation-control);
212
216
  --elevation-soft:
213
217
  0 0.5px 1px rgb(0 0 0 / 0.25), 0 1px 3px rgb(0 0 0 / 0.25), 0 2px 6px -2px rgb(0 0 0 / 0.25),
214
218
  0 6px 16px -10px rgb(0 0 0 / 0.35);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ggml-org/llama-ui",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Shared UI library for llama.cpp frontend apps.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -34,6 +34,26 @@
34
34
  "types": "./dist/components/ui/*/index.d.ts",
35
35
  "svelte": "./dist/components/ui/*/index.js"
36
36
  },
37
+ "./app/*": {
38
+ "types": "./dist/components/app/*/index.d.ts",
39
+ "svelte": "./dist/components/app/*/index.js"
40
+ },
41
+ "./constants": {
42
+ "types": "./dist/constants/index.d.ts",
43
+ "svelte": "./dist/constants/index.js"
44
+ },
45
+ "./enums": {
46
+ "types": "./dist/enums/index.d.ts",
47
+ "svelte": "./dist/enums/index.js"
48
+ },
49
+ "./code": {
50
+ "types": "./dist/utils/index.d.ts",
51
+ "svelte": "./dist/utils/index.js"
52
+ },
53
+ "./models": {
54
+ "types": "./dist/components/models/index.d.ts",
55
+ "svelte": "./dist/components/models/index.js"
56
+ },
37
57
  "./utils": {
38
58
  "types": "./dist/components/ui/utils.d.ts",
39
59
  "svelte": "./dist/components/ui/utils.js"
@@ -45,7 +65,7 @@
45
65
  "./surfaces.css": "./dist/styles/surfaces.css"
46
66
  },
47
67
  "scripts": {
48
- "dev": "bash scripts/dev.sh",
68
+ "dev": "vp dev",
49
69
  "build": "vp build && npm run prepack",
50
70
  "preview": "vp preview",
51
71
  "prepare": "svelte-kit sync || echo ''",
@@ -54,18 +74,9 @@
54
74
  "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
55
75
  "test:unit": "vp test",
56
76
  "test": "npm run test:unit -- --run",
57
- "storybook": "storybook dev -p 6006",
58
- "build-storybook": "storybook build",
59
77
  "watch:package": "svelte-kit sync && svelte-package -w"
60
78
  },
61
79
  "devDependencies": {
62
- "@chromatic-com/storybook": "latest",
63
- "@storybook/addon-a11y": "^10.6.2",
64
- "@storybook/addon-docs": "^10.6.2",
65
- "@storybook/addon-mcp": "10.6.2",
66
- "@storybook/addon-svelte-csf": "latest",
67
- "@storybook/addon-vitest": "^10.6.2",
68
- "@storybook/sveltekit": "^10.6.2",
69
80
  "@sveltejs/adapter-auto": "^8.0.0",
70
81
  "@sveltejs/kit": "^3.0.0",
71
82
  "@sveltejs/package": "^2.5.8",
@@ -74,11 +85,9 @@
74
85
  "@types/node": "^24",
75
86
  "@vitest/browser-playwright": "5.0.5",
76
87
  "@vitest/coverage-v8": "5.0.5",
77
- "mdsvex": "0.12.7",
78
88
  "mode-watcher": "^1.1.0",
79
89
  "playwright": "^1.60.0",
80
90
  "publint": "^0.3.21",
81
- "storybook": "^10.6.2",
82
91
  "svelte": "^5.57.1",
83
92
  "svelte-check": "^4.6.0",
84
93
  "tailwindcss": "^4.3.3",
@@ -105,6 +114,7 @@
105
114
  "bits-ui": "2.18.1",
106
115
  "clsx": "^2.1.1",
107
116
  "highlight.js": "^11.11.1",
117
+ "@ggml-org/llama-brand": "https://codeload.github.com/ggml-org/llama-brand/tar.gz/f05540643c1ca2a18d732ed6491c839686da9a3a",
108
118
  "tailwind-merge": "^3.7.0",
109
119
  "tailwind-variants": "^3.3.1",
110
120
  "vaul-svelte": "1.0.0-next.7"
@@ -1,4 +0,0 @@
1
- <svg width="600" height="600" viewBox="0 0 600 600" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M600 392L504.249 558L504.137 557.929C487.252 584.069 458.193 600 426.864 600H120L240 392H600Z" fill="currentColor"/>
3
- <path d="M240 392H0L199.602 46.0254C216.032 17.5463 246.411 3.25756e-05 279.29 0H466.154L240 392Z" fill="currentColor"/>
4
- </svg>