diff --git a/ui/apps/chat/.storybook/manager-head.html b/ui/apps/chat/.storybook/manager-head.html index 5964c8fa3cb4..b57dd131536f 100644 --- a/ui/apps/chat/.storybook/manager-head.html +++ b/ui/apps/chat/.storybook/manager-head.html @@ -16,6 +16,10 @@ 'brand-colors-primitives--primitives': 'llama-ui-foundations-colors--primitives', 'brand-logo-app-icons--splash-screens': 'llama-chat-foundations-brand--splash-screens', 'brand-logo-usage--splash-screens': 'llama-chat-foundations-brand--splash-screens', + 'introduction-design-philosophy--design-philosophy': 'philosophy-design--design', + 'philosophy--design': 'philosophy-design--design', + 'philosophy--ideology': 'philosophy-ideology--ideology', + 'philosophy--product': 'philosophy-product--product', 'introduction-design-guidelines--docs': 'agents-design-guidelines--docs' }; diff --git a/ui/apps/chat/.storybook/preview.ts b/ui/apps/chat/.storybook/preview.ts index 7e7a58d167a8..118704673a89 100644 --- a/ui/apps/chat/.storybook/preview.ts +++ b/ui/apps/chat/.storybook/preview.ts @@ -26,7 +26,7 @@ const preview: Preview = { }, options: { - // sidebar sections: the introduction and the guidelines for agents, then the two layers as the code has them. + // sidebar sections: the introduction, the guidelines for agents, the philosophy and the architecture, then the two layers as the code has them. // Llama UI is the library (ui/lib/ui): its foundations, base components, app components, Model UI and mockups. // Llama Chat is the app (ui/apps/chat): its own foundations, then one folder per src/lib/components/app/, // the full chat screen leading Chat. The brand and communications are in llama-brand's Storybook @@ -35,6 +35,10 @@ const preview: Preview = { 'Introduction', 'Agents', ['Design guidelines'], + 'Philosophy', + ['Ideology', 'Product', 'Design'], + 'Architecture', + ['Stack', 'Chat', 'Extensions', 'Channels'], 'Llama UI', [ 'Foundations', diff --git a/ui/apps/chat/AGENTS.md b/ui/apps/chat/AGENTS.md index f585ec54fec8..c1215b163451 100644 --- a/ui/apps/chat/AGENTS.md +++ b/ui/apps/chat/AGENTS.md @@ -3,6 +3,7 @@ These add to the repository's [AGENTS.md](../../../AGENTS.md) for work in `ui/apps/chat`: **Llama Chat**, the chat client that llama-server bundles. **Llama UI**, the library, is `ui/lib/ui` (`@ggml-org/llama-ui`): Chat imports its tokens, fonts and base components from there (`@ggml-org/llama-ui/ui/`) and keeps no copy of them. `DESIGN.md` and the Storybook live here; the brand book, `BRAND.md`, and the brand and communications pages are in [ggml-org/llama-brand](https://github.com/ggml-org/llama-brand), with their own Storybook. - **Design:** [DESIGN.md](DESIGN.md) holds the tokens, roles and rules, written for agents. Follow it for anything visual. Its token sections (`colors`, `typography`, `rounded`) are generated from the CSS with `npm run design:tokens`, and CI checks they are current; the rest is written by hand, and when it and the CSS disagree, the CSS wins and DESIGN.md is updated. +- **Why:** Storybook's **Philosophy** section explains the reasons, for people: **Ideology** ([Ideology.svx](tests/stories/philosophy/Ideology.svx)), **Product** ([Product.svx](tests/stories/philosophy/Product.svx)) and **Design** ([Design.svx](tests/stories/philosophy/Design.svx)). - **Stories:** a story lives with the code it shows. Llama UI's (its foundations, base components, app components and Model UI) are in `ui/lib/ui/tests/stories`, titled `Llama UI/...`, and run as the library's tests; this app's Storybook shows them too. Llama Chat's are in `tests/stories/`, one folder per `src/lib/components/app/` (`chat/` has one per Chat folder), titled `Llama Chat//`. An accessibility story sits next to its component's, as `.a11y.stories.svelte`, titled `...//Accessibility`. The story helpers both Storybooks use (the Editorial the prose pages are set in, `StateGallery`) live with the library's stories and are imported here as `$llama-ui-stories/...`; reuse them rather than copying them here. - **Components:** the `SKILL.md` next to a component folder (such as [src/lib/components/app/SKILL.md](src/lib/components/app/SKILL.md)) holds that folder's conventions. @@ -12,7 +13,7 @@ Anything that is mostly content (a doc, an overview, a showcase or a Storybook p - Write the prose as plain Markdown, so it reads well as source, for people and for agents alike. - Put each custom piece in its own `.svelte` file and import it in the page's ` + + + + + + diff --git a/ui/apps/chat/tests/stories/architecture/Channels.svx b/ui/apps/chat/tests/stories/architecture/Channels.svx new file mode 100644 index 000000000000..5701645d6b47 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/Channels.svx @@ -0,0 +1,92 @@ + + + + +

Architecture · Distribution · Llama Chat

+ +# One build, three channels + +Llama Chat is a SvelteKit app built with `adapter-static`: plain HTML, JS and CSS in one `dist` folder. Each release builds it once and ships the same folder three ways. Only the thing serving it changes. + + +They carry the UI and nothing else: no llama-server, no models, no inference. On first open they are connected to nothing; you add a llama-server by URL, or pair one through Llama Connect, before you can chat. Only the bundled channel comes with its own server. + + + + +## How the channels differ + +The app works out its mode at runtime: if same-origin `/props` answers as llama.cpp it runs bundled; otherwise it runs hosted and opens on "add a server or pair one through Llama Connect". No build flags. + +| | Bundled in llama-server | npx llama-chat | chat.llama.app | +| --- | --- | --- | --- | +| Served by | llama-server, or `llama serve` in the macOS and Windows apps (the same server) | a static file server in the package (UI only) | the static host | +| Origin | the server's own address | `http://localhost:` | `https://chat.llama.app` | +| Comes with a server | yes, it is the server | no: UI only, add a llama-server | no: UI only, add a llama-server | +| Needs | llama-server, or a native app | Node | a browser | +| Reaches servers | its own, same origin; others via Providers | localhost and plain `http://` LAN servers by URL | `https://` and localhost by URL; anything else through Llama Connect | +| Response headers | set in `server-http.cpp` | set by the CLI | what the host allows | +| Chats stored | per server address | per localhost port | at chat.llama.app | +| Best for | "I run llama-server" or a native app | a server elsewhere on my network, offline use | trying it with no install, phones, Llama Connect | + +## Llama Connect + +Llama Connect pairs an app with a llama-server it cannot reach by URL: one started with `--connect` shows a code or QR, the app scans or types it, and the two talk directly over WebRTC. It is how chat.llama.app reaches a server behind a home router, and how a phone reaches the laptop next to it. + +Conversations come with it. Chats stored on the device that runs the server, a laptop say, can be shared through Llama Connect and continued on a phone, then picked up again on the laptop. + + + +## The npx command + +Why npx still matters next to the hosted site: a llama-server on the LAN usually answers on plain `http://`, and an `https://` page cannot call it (browsers block it as mixed content). The same UI served from `http://localhost` can. + + + +Bare `npx llama-chat` starts it. One job, no verb, like `npx serve` or `npx http-server`; a required `start` would turn many first runs into a help screen. + +```bash +# serve and open the browser +npx llama-chat + +# connect to a server on launch +npx llama-chat --server http://192.168.1.20:8080 + +# reachable from other devices, no browser +npx llama-chat --host 0.0.0.0 --port 3000 --no-open +``` + +| Flag | Default | What it does | +| --- | --- | --- | +| `--server ` | `http://127.0.0.1:8080` | The llama-server the UI talks to. Today the CLI forwards the app's API calls to it; once the app can add servers by URL, it adds and selects that server instead, and without the flag the UI opens on the add-server screen | +| `--port ` | `3000` | Fixed, so the origin and the chats stored under it stay the same between runs | +| `--host ` | `127.0.0.1` | `0.0.0.0` to open it to the LAN | +| `--open` / `--no-open` | open | Opens the default browser once it listens | +| `--version`, `--help` | | As usual | + +- **Package:** `@ggml-org/llama-chat` with `"bin": {"llama-chat": "./bin/cli.js"}`, plus an unscoped `llama-chat` that depends on it at the same version and only runs its CLI, so `npx llama-chat` stays short. +- **What it runs:** a static file server (`node:http`) for `dist`, no dependencies: no llama-server, no models, no Vite or SvelteKit. Until the app can add servers by URL, paths with no file in `dist` go to the `--server` llama-server, without an `Origin`, as the Vite dev proxy sends them; the hash router needs no fallback. +- **Headers:** the same set llama-server sends, so the app behaves the same in both. +- **Later verbs** (`doctor`, `update`) keep the bare command as the default; `start` is an accepted alias, not the documented form. + +## The hosted site + +The static `dist` deploys as is: relative paths and the hash router work at the domain root. The host sends the same response headers llama-server does, so the app behaves the same in every channel; hashed assets can be cached for good, while `sw.js`, the manifest and `version.json` are never cached. + +## Release flow + +One CI job per llama.cpp release, after the build: + +1. Upload `dist` to the Hugging Face bucket `ggml-org/llama-ui` (`b`), which llama-server's CMake build embeds. +2. Publish `@ggml-org/llama-chat` and `llama-chat` to npm: `dist` plus the CLI, versioned with the release. +3. Deploy `dist` to chat.llama.app. + +chat.llama.app always runs the latest UI against servers of any version, so it needs feature detection through `/props` and a minimum-server-version message. diff --git a/ui/apps/chat/tests/stories/architecture/Chat.stories.svelte b/ui/apps/chat/tests/stories/architecture/Chat.stories.svelte new file mode 100644 index 000000000000..1958bed58d94 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/Chat.stories.svelte @@ -0,0 +1,19 @@ + + + + + + + diff --git a/ui/apps/chat/tests/stories/architecture/Chat.svx b/ui/apps/chat/tests/stories/architecture/Chat.svx new file mode 100644 index 000000000000..80aa20ebe8e9 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/Chat.svx @@ -0,0 +1,103 @@ + + + + +

Architecture · ui/apps/chat · on the Llama UI stack

+ +# Llama Chat + +

The first app on Llama UI, and the reference for the line between library and app. It runs local models through llama-server, with tools, MCP servers, projects, a prompt library, a models manager and several servers.

+ +## Its areas + + + + +`/chat/[id]` + +Tabs, branching, regenerate, reasoning blocks, right-click message actions, expandable composer. + + + + +`/projects/[id]` + +Instructions, context files, a working directory; chats inside. + + + + +`/library` + +Prompts: reusable system messages. + + + + +`/models` + +Manager, Discover from Hugging Face, downloads, configuration pane. + + + + +`/servers` + +llama.cpp servers by URL or through Llama Connect, paired by code or QR. + + + + +`/mcp-servers …` + +MCP servers and resources, settings sections, conversation search. + + + + +## How a message travels + +The agentic loop runs in the browser, through [Llama Harness](/stack/) (`@ggml-org/llama-harness`, in `ui/lib/harness`). It streams from the active server and runs any tool the model calls: in the browser, on llama-server, or on an MCP server. Chat gives the harness its chat service and its tools, each behind the permission gate, and stores the messages it reports. + + + +## Layers in the code + +`ui/apps/chat/src` runs one way: routes, components, hooks, stores, services, then storage or the server. Tags show where each layer lands: UI and UX go to `ui/lib/ui`; everything that decides what happens stays in `ui/apps/chat`. + + +/ /chat/[id] /projects/[projectId]/chat/[id] /library /models /servers /mcp-servers /settings /search +chat (ChatScreen, ChatForm, ChatMessages, ChatTabs), navigation, projects, models (manager, Discover, configuration), servers, mcp, settings, dialogs. Their presentational parts (model selector, model card, badges, quant rows) move to the library as Model UI. +shadcn-svelte on bits-ui: alert, button, card, context-menu, dialog, drawer, dropdown-menu, input, popover, select, switch, table, tabs, tooltip and more. +use-chat-screen-active-model, use-processing-state, use-context-gauge, use-models-selector, use-tools-panel. Interaction hooks go with their components; hooks that read app stores stay in the app. +chat, conversations, agentic, tools, permissions, mcp, models, models-discover, servers, remote-access, projects, groups, prompts, tabs, settings. +Llama Harness: streams a turn, runs the tools the model called, repeats until it answers without one. The agentic store drives it and keeps the tools, permissions and storage. +chat, models, props, database, mcp, tools, sandbox, servers, huggingface, settings, conversation-transfer. +"Matte Glass" tokens in three tiers: primitives, semantic (light and dark), components. Documented in DESIGN.md and Storybook. +IndexedDB for conversations, projects, groups, prompts; localStorage for settings and permissions; llama-server /v1, /props, /models, /tools, /slots. + + +## What Chat keeps, what it hands off + + +All business logic: conversations, tabs, groups, search, tools and permission gates, projects, the models manager, Discover, downloads, model configuration and Servers. MCP is the first feature that plugs in as an [extension](/extensions/). +The agentic loop, as `@ggml-org/llama-harness`: headless, no UI. Chat keeps the tools and the approval gate above it. +Presentation only: thread, composer, tool-call blocks, permission prompt, model selector, model card, capability badges. They take data in and report what the user did out. + + +## Parts other apps reuse + + +Any app with a conversation reuses the thread and composer, and the Markdown renderer and editor with them. +An app runs the same loop through Llama Harness, or puts its own behind the same interface, and shows tool calls and permission prompts with the same library components. +The model selector, model card and badges serve every app and llama.app. Other apps call llama-server's OpenAI-compatible endpoints themselves; the full manager and Servers stay in Chat. + diff --git a/ui/apps/chat/tests/stories/architecture/Extensions.stories.svelte b/ui/apps/chat/tests/stories/architecture/Extensions.stories.svelte new file mode 100644 index 000000000000..0e9d6867b627 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/Extensions.stories.svelte @@ -0,0 +1,19 @@ + + + + + + + diff --git a/ui/apps/chat/tests/stories/architecture/Extensions.svx b/ui/apps/chat/tests/stories/architecture/Extensions.svx new file mode 100644 index 000000000000..09d20f2e1287 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/Extensions.svx @@ -0,0 +1,123 @@ + + + + +

Architecture · ui/apps/chat/src/lib/extensions · inside Llama Chat

+ +# Extensions + +

Llama Chat is a small core and the features that plug into it. A feature that plugs in is an extension: it adds its parts through extension points, it can be switched off in Settings, and the core never imports its code. MCP is the first one.

+ +## The rule + + + + +Conversations, the thread and composer, attachments, settings, the server connection, the agentic flow and the permission gate make up the core. It reads what extensions contribute from the registry and knows nothing else about them. ESLint enforces it: a file outside `src/lib/extensions//` cannot import from that folder. + + + + +An extension is trusted code with the same access as the core: its stores, services and components, and Llama UI. All of its own code sits in one folder, `src/lib/extensions//`. + + + + +## What an extension is + +A manifest the app knows before any of the extension's code runs, and one function that adds its contributions. + +```ts +// builtin.ts: the extensions this app is composed with +{ id: 'mcp', name: 'MCP', description: '…', load: () => import('./mcp') } + +// mcp/index.ts +const mcp: Extension = { + activate(ctx) { + ctx.contribute('tools', provider); // an extension point and what goes into it + ctx.onDeactivate(() => mcpStore.shutdown()); // whatever contribute does not cover + } +}; +``` + +At startup the registry activates the extensions that are switched on. Switching one off removes its contributions at once and runs its cleanups; the choice is kept in localStorage. Nothing of an extension runs while it is off. llama-server embeds the app as a single bundle, so there its code ships either way; a build that splits chunks fetches it only on activation. + +## Extension points + +Each is a typed slot in `points/`. The core decides where a contribution shows and when it runs; the extension decides what it is. + + +Tools the model can call: the extension lists them in groups, runs the calls and names the groups. Keys for switching a tool or a group off keep their stored shape. +A hook around every agentic flow: called when it starts, and what it returns runs when it ends. +An entry in the sidebar: a page on a phone, a dialog on a desktop or tablet. +A page at a path of its own, shown by one generic route. A path nothing contributes is a 404. +A slash command in the chat form's / picker. +A popover picker the form mounts and a command opens, with a handle to add files to the message. +Attachments kept outside the form's files, drawn under the input and added to the message when it is sent. +Claims a message and draws it in place of the default. +Claims an attachment and draws its chip; it stays out of the built-in preview. +Prompts offered as system messages in the chat form's System message list, beside the prompt library, and the card of a system message made from one. + + +A setting can also name the extension it belongs to: its field shows only while that extension is on, and the stored value stays either way. + +## MCP, the first extension + +`src/lib/extensions/mcp/` holds all of it: the client on MCP SDK v2 (`services/`), the host that keeps the connections (`stores/`), every component, and the glue that contributes to each point above. With MCP switched off the sidebar entry, the `/prompt` command, MCP's tools and its page are gone and its connections are closed. Old messages keep their MCP attachments, drawn as plain text attachments. + + + +Shared data, so conversations and settings read the same with MCP on or off: the attachment and tool-source kinds, the stored message formats, MCP's types, constants and settings keys, and the export that strips server headers. + + + +## Next: Models, Projects, Library + +The same contract is meant for the other features. None of this is built: the cards say which points each one can use today and what it still needs. + + + + +Uses `navigation` and `pages` for its sidebar entry, dialog and `/models`. The model list and selection stay in the core. + +Needs: a keyboard shortcut for its entry, and a way to add its actions to the model selector. + + + + +Uses `tools` for the project tools, `flow` and `navigation`. + +Needs: pages with paths below their own (`/projects/[id]/chat/[id]`), a sidebar section, its own tables in storage, and a say in what a conversation sends. + + + + +Uses `pages`, `navigation` and the renderers. + +Needs: its own tables in storage, and entries in the composer's + menu for the system message submenu. + + + + + + + +`sidebarSections`, `storage`, `composerMenu`, `shortcuts`, nested pages, settings sections and panels. Each arrives with the first feature that needs it. + + + + +Extensions that are not built in: installed at runtime, by people or by their agents, trusted after the user approves them. They use the same contract and the same points. + + + diff --git a/ui/apps/chat/tests/stories/architecture/Frame.svelte b/ui/apps/chat/tests/stories/architecture/Frame.svelte new file mode 100644 index 000000000000..560b08d9bd6d --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/Frame.svelte @@ -0,0 +1,43 @@ + + + +
+ {@render children()} +
diff --git a/ui/apps/chat/tests/stories/architecture/Stack.stories.svelte b/ui/apps/chat/tests/stories/architecture/Stack.stories.svelte new file mode 100644 index 000000000000..6a99c1c2fbd8 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/Stack.stories.svelte @@ -0,0 +1,19 @@ + + + + + + + diff --git a/ui/apps/chat/tests/stories/architecture/Stack.svx b/ui/apps/chat/tests/stories/architecture/Stack.svx new file mode 100644 index 000000000000..795af3f3e9e6 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/Stack.svx @@ -0,0 +1,107 @@ + + + + +

Architecture · Llama UI and the apps

+ +# One library, many apps + +Llama UI is the design system and component library: UI and UX, no business logic. [Llama Chat](/chat/) is one application built on it, the WebUI we ship today. Other apps can follow on the same parts. The llama.app website uses the same library, so models look and behave the same everywhere. The agentic loop is a package of its own, Llama Harness (`@ggml-org/llama-harness`), so an app can run it or bring its own. Splitting library, harness and apps lets anyone build their own app on the Llama stack, and lets Chat ship in more places. + + + + + + +Components, design tokens and the logic inside them: multi-step flows, drag to reorder, keyboard navigation, validation as you type, formatting a file size, checking whether a model fits in memory. +Talking to llama-server, storing conversations and notes, running the agentic loop through Llama Harness and gating its tools, managing models and servers. Components get data in and report what the user did out. + + + + + +The packages live in `ui/lib`, one folder each, and the apps built on them in `ui/apps`. Llama Chat imports both packages: its tokens, fonts and base components come from `ui/lib/ui`, its agentic loop from `ui/lib/harness`. This Storybook still lives in `ui/apps/chat`. + +```text +ui/ +├── lib/ +│ ├── ui/ @ggml-org/llama-ui +│ └── harness/ @ggml-org/llama-harness +└── apps/ + └── chat/ @ggml-org/llama-chat + (private, not published) + +still to come +ui/ +├── lib/ +│ └── ui/ → ui.llama.app +└── apps/ + ├── chat/ published, + npx llama-chat + │ → chat.llama.app + ├── / other apps of ours + └── / many, any use case +``` + +Stays in the llama.cpp repo. npm packages give outside projects a clean import without a separate GitHub repo. The llama.app website stays in ggml-org/llama-pages and installs @ggml-org/llama-ui. + + + + +The library draws the parts and handles interaction. The app owns the state and talks to llama-server. Llama Chat is the polished version of this. Examples in `ui/apps` stay small and developer-facing. + +```svelte + + + + + + send(model, text, messages)} /> +``` + +Illustrative only. Component names and API are not final; the first example app in ui/apps would pin this down. + + + + +## Where the docs live + +Two hosted Storybooks, one for each audience: + +- **ui.llama.app** documents the `@ggml-org/llama-ui` package for the people building on it: components, tokens, patterns and usage, built from `ui/lib/ui` and versioned with llama.cpp's releases. +- **brand.llama.app** is the brand alone: the philosophy, the logo, the type, the colours and communications, built from `ggml-org/llama-brand`. It pulls in ui.llama.app through Storybook's composition, so one sidebar shows both, while the package's docs stay lean. + +For now both live in this one Storybook, in `ui/apps/chat`. + +## Llama Harness + +The agentic loop is its own package, `@ggml-org/llama-harness`, in `ui/lib/harness`: headless TypeScript, no UI and no DOM. It needs an OpenAI-compatible endpoint, not llama-server specifically; model loading, `/props` and server tools are capabilities it detects and works without. The same loop runs in the browser, in Node and in the native apps. + +```ts +interface Harness { + run(messages, tools, signal): AsyncIterable +} + +// HarnessEvent +text · reasoning · tool_call · tool_result · done · error +``` + +The loop is swappable: an app can put its own behind the same contract, so Llama Chat can run another harness such as `pi` while Llama Harness stays the minimal default. The tools and the approval gate sit above it, so every loop gets the same ones: built-in tools in the app, `server.*` tools listed by llama-server, `mcp..*` tools from the MCP servers you add, and tools declared in JSON. One loop owns approvals, cancellation and history; llama-server offers tools but never runs a loop of its own. diff --git a/ui/apps/chat/tests/stories/architecture/architecture.css b/ui/apps/chat/tests/stories/architecture/architecture.css new file mode 100644 index 000000000000..093dcf220ec7 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/architecture.css @@ -0,0 +1,99 @@ +/* + * The Architecture pages. Their parts name colours and fonts themselves (--bg, --fg, --app, --lib …); here those + * point at Llama UI's tokens, and the pages' global styles are scoped to .architecture so no other story sees them. + * Diagram hues are the brand's art colours: apps in cinder, the library in the skies, the backend in grey. + */ +.architecture { + --bg: var(--surface-page); + --surface: var(--surface-raised); + --fg: var(--fg-default); + --muted: var(--fg-muted); + --line: var(--line-default); + --rule: var(--edge-rest-side); + --display: var(--font-sans); + --sans: var(--font-sans); + --mono: var(--font-mono); + + /* apps, library, backends: a strong colour for lines and labels, a soft one for fills */ + --app: color-mix(in oklab, var(--art-cinder) 80%, black); + --app-bg: color-mix(in oklab, var(--art-cinder) 12%, var(--surface-page)); + --lib: var(--art-night-sky); + --lib-bg: color-mix(in oklab, var(--art-day-sky) 24%, var(--surface-page)); + --be: var(--neutral-600); + --be-bg: var(--surface-muted); + + font-size: 15px; + line-height: 1.6; +} + +.dark .architecture { + --app: var(--art-cinder); + --app-bg: color-mix(in oklab, var(--art-cinder) 16%, var(--surface-page)); + --lib: var(--art-day-sky); + --lib-bg: color-mix(in oklab, var(--art-night-sky) 55%, var(--surface-page)); + --be: var(--neutral-300); +} + +/* the Editorial's text column, a little wider for pages of tables and cards; every block that isn't running text + (cards, diagrams, tables) takes the wide column */ +.architecture .editorial.editorial { + --text: min(44rem, calc(100% - 32px)); +} +.architecture .editorial > :not(p, ul, ol, h1, h2, h3, h4, blockquote, hr, .kicker, .lead) { + grid-column: wide; +} +.architecture .editorial > h3 { + font-size: 20px; + font-weight: 600; + margin-top: 32px; +} +.architecture .editorial > blockquote { + padding: 14px 18px; + border-left: 2px solid var(--art-cinder); + color: var(--fg-default); +} + +/* tables in the Markdown: hairline rows, labels in Mono, scrolling sideways on a phone */ +.architecture .editorial > table { + display: block; + overflow-x: auto; + border-collapse: collapse; + font-size: 15px; + line-height: 1.5; +} +.architecture .editorial > table :is(th, td) { + min-width: 8rem; + padding: 10px 14px 10px 0; + border-bottom: 1px solid var(--line-default); + text-align: left; + vertical-align: top; +} +.architecture .editorial > table th { + color: var(--fg-muted); + font: 500 11px / 1.4 var(--font-mono); + letter-spacing: 0.06em; + text-transform: uppercase; +} +.architecture .editorial > table td:first-child { + font-weight: 600; +} + +/* code blocks */ +.architecture pre { + margin: 0; + padding: 14px 16px; + overflow-x: auto; + border-radius: var(--radius-panel, 10px); + background: var(--surface-code); + font: 12.5px / 1.6 var(--font-mono); +} +.architecture pre code { + padding: 0; + background: none; + font-size: inherit; +} + +/* links drawn in the diagrams underline only the text that says so, not the whole box */ +.architecture .editorial svg a { + text-decoration: none; +} diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/channels/ConnectFigure.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/channels/ConnectFigure.svelte new file mode 100644 index 000000000000..b039877fcffb --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/channels/ConnectFigure.svelte @@ -0,0 +1,341 @@ + + + +
+ + + + + + + + + + + + + + + + + + Llama Chat + + {#each chats as chat, i (chat)} + {#if i === 0}{/if} + + {chat} + {/each} + + Qwen3 8B · this laptop + + + + Three days in Lisbon? + + + + + + + + + Pair a device + + + + {#each [[0, 0], [N - 7, 0], [0, N - 7]] as [fx, fy] (fx + '-' + fy)} + + + + {/each} + + {#each modules as [x, y] (x + '-' + y)} + + {/each} + + K7Q-4ME + + + + + + + + + chat.llama.app + + + + ‹ Trip to Lisbon + + + + Three days in… + + + + + + And a day trip? + + + + + + + + + + + + + 2 + + The phone scans the code + + + + 1 + + + + + + 3 + + WebRTC, direct + + prompts in, replies out, + + and the conversations + + + Laptop + + The Llama app runs llama-server with --connect and the model; + + Llama Chat keeps the conversations here, and shows the code (1). + + Smartphone + + chat.llama.app, the UI only; + + the model and the chats + + stay on the laptop + +
+ + diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/channels/LocalhostFigure.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/channels/LocalhostFigure.svelte new file mode 100644 index 000000000000..547f99da0139 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/channels/LocalhostFigure.svelte @@ -0,0 +1,220 @@ + + + +{#snippet browser(x: number, y: number, url: string)} + + + + + {#each [0, 1, 2] as i (i)}{/each} + + + + {url} + + + + + + + + +{/snippet} + +
+ + + + + + + CHAT.LLAMA.APP + + {@render browser(20, 34, 'https://chat.llama.app')} + + + + + + + + + + blocked: an https page can't + + call a plain http server + + + NPX LLAMA-CHAT + + + + $ npx llama-chat --server + + http://192.168.1.20:8080 + + Llama Chat on http://localhost:3000 + + + + {@render browser(20, 296, 'http://localhost:3000')} + + + + + + + + + + allowed: http to http, + + from localhost + + + + + {#each [0, 1, 2, 3, 4] as i (i)} + + {/each} + + + + llama-server + + 192.168.1.20:8080 + + on the home network, + + plain http + +
+ + diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/channels/ReleaseDiagram.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/channels/ReleaseDiagram.svelte new file mode 100644 index 000000000000..265219f9e116 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/channels/ReleaseDiagram.svelte @@ -0,0 +1,116 @@ + + + +
+ + + + ONCE PER LLAMA.CPP RELEASE + + + + Build + + vite build · adapter-static + + one dist/, hash router, + + relative paths + + + + + + + + + + + + same dist + + CHANNEL + + + + Bundled in llama-server + + via the HF bucket; native apps: llama serve in the llama binary + + + + npx llama-chat + + npm package llama-chat: the UI only, served from localhost; add your server + + + + chat.llama.app + + the UI only, nothing to install; it uses the server you add + +
+ + diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/chat/Layer.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/chat/Layer.svelte new file mode 100644 index 000000000000..f8107d610827 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/chat/Layer.svelte @@ -0,0 +1,74 @@ + + + +
+
{name}{tag}
+ +
{@render children()}
+
+ + diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/chat/Layers.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/chat/Layers.svelte new file mode 100644 index 000000000000..163ea1b7d267 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/chat/Layers.svelte @@ -0,0 +1,14 @@ + + + +
{@render children()}
+ + diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/chat/MessageFlow.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/chat/MessageFlow.svelte new file mode 100644 index 000000000000..1d1969342f2e --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/chat/MessageFlow.svelte @@ -0,0 +1,183 @@ + + + +
+ + + + + + IN THE BROWSER + + + + ACTIVE LLAMA-SERVER + + + + EXTERNAL + + + + Compose + + Live-preview Markdown + + editor, attachments, + + @ MCP resources, + + project + cwd chips + + + + Agentic loop + + chatStore + agenticStore + + Streams the reply, runs each tool call the model + + makes, feeds the result back, repeats. + + Permission gates: once, always, deny. + + model, server and tools from the chat + + + + Chat completions + + /v1/chat/completions + + Streamed. Local, by URL, + + or a --connect tunnel. + + + + + + + + + + Render + save + + Markdown, reasoning, + + KaTeX, Mermaid, code + + IndexedDB (Dexie) + + + + + + Browser tools + + run_javascript in a sandbox, + + read_media, get_datetime, + + project tools + + + + + + Server tools + + read, write, edit file; grep, + + glob, exec_shell_command + + in the working directory + + + + MCP servers + + Their tools, plus resources + + you @-mention in a message + + + + + + tool calls + +
+ + diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/stack/AppsBand.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/stack/AppsBand.svelte new file mode 100644 index 000000000000..09142426f019 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/stack/AppsBand.svelte @@ -0,0 +1,63 @@ + + + + +APPS · llama.cpp/ui/apps · BUSINESS LOGIC LIVES HERE + + + + + Llama Chat + + ui/apps/chat ↗ + + Tools, MCP, projects; + + manages models, servers. + + + +Other apps +ui/apps/<app> +More first-party apps on the same parts, once Chat is in place. +Each keeps its own business logic and talks to llama-server. + + +Platform examples +ui/apps/<example> +Many, any use case. +For developers, unpolished. + + +llama.app website +ggml-org/llama-pages +Model catalog and model +pages from the same parts. + + +Your app +npm i @ggml-org/llama-ui +Outside the repo: third-party tools and partner products +built on the same library and design language. diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/stack/ArchitectureDiagram.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/stack/ArchitectureDiagram.svelte new file mode 100644 index 000000000000..fbf836414f11 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/stack/ArchitectureDiagram.svelte @@ -0,0 +1,154 @@ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/stack/BrandBand.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/stack/BrandBand.svelte new file mode 100644 index 000000000000..9f1106e5fc35 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/stack/BrandBand.svelte @@ -0,0 +1,12 @@ + + + + + +THE ONE SHARED DEPENDENCY · BRAND + DESIGN LANGUAGE +llama.cpp apps and examples · ui.llama.app docs · llama.app website · promotional content · + native apps, within menubar and platform constraints diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/stack/Legend.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/stack/Legend.svelte new file mode 100644 index 000000000000..e79c20b1d369 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/stack/Legend.svelte @@ -0,0 +1,33 @@ + +
+ Llama UI UI and UX only, no + business logic + + Apps own the business logic + + Backends and docs +
+ + diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/stack/LibraryBand.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/stack/LibraryBand.svelte new file mode 100644 index 000000000000..500d865e3106 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/stack/LibraryBand.svelte @@ -0,0 +1,36 @@ + + + + + + + +IMPORT + + +LIBRARY · llama.cpp/ui/lib/ui · NO BUSINESS LOGIC +Llama UI +@ggml-org/llama-ui +UI and UX only: components, tokens, interaction logic. + +Design tokens +Colour, type, spacing, +themes, brand assets + +Components +Buttons, forms, dialogs +Svelte + shadcn-svelte + +Model UI +Catalog, model card, +quant picker, fit check + +UX patterns +Thread, composer, +attachments + +UX logic +Flows, interactions, +small computations diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/stack/Note.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/stack/Note.svelte new file mode 100644 index 000000000000..a68c94cdc05b --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/stack/Note.svelte @@ -0,0 +1,22 @@ + + + +
{@render children()}
+ + diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/stack/Rule.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/stack/Rule.svelte new file mode 100644 index 000000000000..efcefa6649f4 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/stack/Rule.svelte @@ -0,0 +1,51 @@ + + + +
+
+ The rule + +

{title}

+
+ +
{@render children()}
+
+ + diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/stack/RuleSide.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/stack/RuleSide.svelte new file mode 100644 index 000000000000..4a9ca32da5f0 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/stack/RuleSide.svelte @@ -0,0 +1,29 @@ + + + +
+ {title} + +
{@render children()}
+
+ + diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/stack/ShipsRow.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/stack/ShipsRow.svelte new file mode 100644 index 000000000000..3e171484f6bb --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/stack/ShipsRow.svelte @@ -0,0 +1,38 @@ + + + + +WHERE LLAMA CHAT SHIPS + +chat.llama.app +Hosted static build; +user adds their own server + +npx llama-chat +UI only, from npm; +you add a server + +llama-server +Built-in web UI, +same as today + +macOS + Windows apps +llama binary: llama serve +is llama-server + this UI + + + + + + + + +LLAMA CHAT: BUILD + PUBLISH diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/stack/SideColumn.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/stack/SideColumn.svelte new file mode 100644 index 000000000000..8b321c378cb8 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/stack/SideColumn.svelte @@ -0,0 +1,39 @@ + + + +KEY +Library (one package) +Apps built on the library +Backends and docs +Lives outside the llama.cpp repo + + +INFERENCE BACKEND +Every app talks to it the same way + +llama-server +by URL: https:// or localhost + +Llama Connect +paired by code or QR + + + +DOCS +ui.llama.app +Storybook for the library: +every component and state, +usage docs, visual tests. +brand.llama.app +The brand alone, from llama-brand. + diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/ui/Callout.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/ui/Callout.svelte new file mode 100644 index 000000000000..c0a4da641528 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/ui/Callout.svelte @@ -0,0 +1,32 @@ + + + + + + diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/ui/Card.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/ui/Card.svelte new file mode 100644 index 000000000000..9cb50e6eb166 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/ui/Card.svelte @@ -0,0 +1,76 @@ + + + +
+ {#if kicker || planned} +

+ {#if kicker}{kicker}{/if} + + {#if planned}Not built yet{/if} +

+ {/if} + + {#if title}

{title}

{/if} + + {#if children}
{@render children()}
{/if} +
+ + diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/ui/Cards.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/ui/Cards.svelte new file mode 100644 index 000000000000..fe6b913b6c90 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/ui/Cards.svelte @@ -0,0 +1,25 @@ + + + +
{@render children()}
+ + diff --git a/ui/apps/chat/tests/stories/architecture/lib/components/ui/Figure.svelte b/ui/apps/chat/tests/stories/architecture/lib/components/ui/Figure.svelte new file mode 100644 index 000000000000..2d17c3a23f58 --- /dev/null +++ b/ui/apps/chat/tests/stories/architecture/lib/components/ui/Figure.svelte @@ -0,0 +1,31 @@ + + + + + + diff --git a/ui/apps/chat/tests/stories/brand/communications/Boards.svelte b/ui/apps/chat/tests/stories/brand/communications/Boards.svelte new file mode 100644 index 000000000000..7e91a117f47f --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/Boards.svelte @@ -0,0 +1,485 @@ + + + +
+ +
+
+

Llama Sans
UI

+ +

Published
in 2026

+ +

For llama.cpp

+
+ +
+

{upper}

+ +

{lower}

+ +

{figures}

+
+ +
    + {#each rows as w, i (i)} +
  • + The Llama Sans design keeps a quiet, even colour from labels to long reading.Aa +
  • + {/each} +
+ +

Abcdefg

+
+ + +
+
+

{upper}

+ +

{lower}

+ +

{figures}

+
+ +

Llama Sans

+ +
+

Designed for
Llama Chat

+ +

Published by ggml
in 2026

+
+
+ + +
+
+

Llama Sans
Display
ABCDEFGHIJKLMN
OPQRSTUVWXYZ

+ +

Published
in 2026
abcdefghijklmn
opqrstuvwxyz()&?!

+ +

+ The Display version tightens tracking and kerning for headlines.Aa +

+
+ + +
+ + +
+ {#each wall as w (w.caption)} +
+ + +
+ +

{w.caption}26

+
+ {/each} +
+ + +
+

Explorations in light

+ +

An exhibition of type

+ +
+ +

+ Set in Llama Sans
Display & UI
11
26
+

+
+ + +
+
+ +

Llama
Sans

+ +

A quiet classic

+
+ + +
+

Llama Sans

+ +

+ The Llama Sans design is a neo-grotesk with an even stroke, round bowls and open, angle-cut + terminals. It was drawn to carry an interface without asking for attention, and to read as + calmly in a long article as in a button. +

+ +

Draft 0.6 · 975 glyphs

+
+
+ + diff --git a/ui/apps/chat/tests/stories/brand/communications/layouts/Product.svelte b/ui/apps/chat/tests/stories/brand/communications/layouts/Product.svelte new file mode 100644 index 000000000000..ce14208b5c12 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/layouts/Product.svelte @@ -0,0 +1,118 @@ + + + + +
+
+ + +

{headline}

+ + {#if lede}

{lede}

{/if} + + {#if caption}

{caption}

{/if} +
+ +
+ +
+
+
+ + diff --git a/ui/apps/chat/tests/stories/brand/communications/layouts/Roster.svelte b/ui/apps/chat/tests/stories/brand/communications/layouts/Roster.svelte new file mode 100644 index 000000000000..b6940a7fa487 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/layouts/Roster.svelte @@ -0,0 +1,142 @@ + + + + + + +
+ + + {#if motif}
{@render motif()}
{/if} +
+ + {#if label} +
+

{label}

+ + {#if link}{link}{/if} +
+ {/if} + +
{@render cards()}
+ + {#if footer}{/if} +
+ + diff --git a/ui/apps/chat/tests/stories/brand/communications/layouts/Statement.svelte b/ui/apps/chat/tests/stories/brand/communications/layouts/Statement.svelte new file mode 100644 index 000000000000..045a0d4925c8 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/layouts/Statement.svelte @@ -0,0 +1,130 @@ + + + + + + +
+ {#if motif}
{@render motif()}
{/if} + +
+

{headline}

+ + {#if lede}

{lede}

{/if} + + {#if command}{/if} +
+
+ + {#if footer}{/if} +
+ + diff --git a/ui/apps/chat/tests/stories/brand/communications/layouts/layout.ts b/ui/apps/chat/tests/stories/brand/communications/layouts/layout.ts new file mode 100644 index 000000000000..4730ff8a9150 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/layouts/layout.ts @@ -0,0 +1,17 @@ +// What every key visual takes: its format and ground, the grid overlay, and the top and bottom rows. +import type { FormatKey, Ground } from '../posts/post'; + +export interface Header { + brand: 'icon' | 'Llama' | 'llama.cpp'; + kicker?: string; + pill?: string; + url?: string; +} + +export interface LayoutProps { + footer?: [string, string]; + format: FormatKey; + header: Header; + overlay?: boolean; + tone: Ground; +} diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/AppPanel.svelte b/ui/apps/chat/tests/stories/brand/communications/posts/AppPanel.svelte new file mode 100644 index 000000000000..2f675b6a65b6 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/AppPanel.svelte @@ -0,0 +1,381 @@ + + + +
+ {#if platform === 'windows'} + +
+ + + + + {ICON} + + + + + + + + + + 10:2406/11/2026 +
+ {:else} +
+ {ICON} + + + + + + + + + + + + + Fri 6 Nov10:24 +
+ {/if} + +
+
+

Llama

+ +

localhost:9931

+ + Open chat +
+ +

Installed models

+ + {#each installed as m (m.name)} +
+ {m.name[0]} + + {m.name} {m.params}{m.size} + + +
+ {/each} + +

Recommended for this {platform === 'windows' ? 'PC' : 'Mac'}

+ +
+ g + + gemma-4 12B7.22 GB + + +
+ +
+ + + Browse modelsFull catalog on the web +
+ +
+ llama.cpp b6123 + + Settings + + Quit +
+
+
+ + diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/BranchMotif.svelte b/ui/apps/chat/tests/stories/brand/communications/posts/BranchMotif.svelte new file mode 100644 index 000000000000..bd64b388e121 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/BranchMotif.svelte @@ -0,0 +1,134 @@ + + + + + + diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/Command.svelte b/ui/apps/chat/tests/stories/brand/communications/posts/Command.svelte new file mode 100644 index 000000000000..775fd6c35977 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/Command.svelte @@ -0,0 +1,37 @@ + + + +
{#if prompt}$ {/if}{command}
+ + diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/HeadlineBlock.svelte b/ui/apps/chat/tests/stories/brand/communications/posts/HeadlineBlock.svelte new file mode 100644 index 000000000000..d8e4e695c7f1 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/HeadlineBlock.svelte @@ -0,0 +1,49 @@ + + + +
+ {#if label}

{label}

{/if} + +

{headline}

+ + {#if lede}

{lede}

{/if} + + {#if chips.length} +
+ {#each chips as chip (chip)}{chip}{/each} +
+ {/if} +
+ + diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/LinkPreview.svelte b/ui/apps/chat/tests/stories/brand/communications/posts/LinkPreview.svelte new file mode 100644 index 000000000000..69469ea02dc2 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/LinkPreview.svelte @@ -0,0 +1,40 @@ + + + +{#if kind === 'og'} + +{:else} + +{/if} diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/ModelCard.svelte b/ui/apps/chat/tests/stories/brand/communications/posts/ModelCard.svelte new file mode 100644 index 000000000000..36b9b3b32513 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/ModelCard.svelte @@ -0,0 +1,170 @@ + + + + +{#snippet repo(id: string)}{id.slice(0, id.indexOf('/') + 1)}{id.slice( + id.indexOf('/') + 1 + )}{/snippet} + +
+ {#if model.tag} + {model.tag} + {/if} + + {#if model.about || aside} +

+ {model.about}{#if aside}{aside}{/if} +

+ {/if} + +

+ {model.name}{#if model.badge}{model.badge}{/if} +

+ + {#if model.stats?.length} +

+ {#each model.stats as stat (stat.value)}{stat.value} {stat.label}{/each} +

+ {/if} + + {#if model.description}

{model.description}

{/if} + + {#if model.meta?.length || (model.repo && !model.stats?.length)} +

+ + {#if model.meta?.length}{#each model.meta as fact, i (fact)}{i ? ' · ' : ''}{fact}{/each}{/if} + + {#if model.repo}{@render repo(model.repo)}{/if} +

+ {:else if model.repo} +

{@render repo(model.repo)}

+ {/if} + + {#if children}{@render children()}{/if} +
+ + diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/ModelDropPost.svelte b/ui/apps/chat/tests/stories/brand/communications/posts/ModelDropPost.svelte new file mode 100644 index 000000000000..256cface6207 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/ModelDropPost.svelte @@ -0,0 +1,123 @@ + + + +{#if slide === 0} + + {#snippet motif()}{/snippet} + + {#snippet cards()} +
    + {#each copy.models as m (m.name)} +
  1. + {m.name} + + {#if m.tag}{m.tag}{/if} +
  2. + {/each} +
+ {/snippet} +
+{:else if model} + + + + +
+
+

{copy.section}

+ + {copy.url} +
+ + +
+
+{/if} + + diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/PostChip.svelte b/ui/apps/chat/tests/stories/brand/communications/posts/PostChip.svelte new file mode 100644 index 000000000000..95300de1dcd9 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/PostChip.svelte @@ -0,0 +1,41 @@ + + + +{@render children()} + + diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/PostFooter.svelte b/ui/apps/chat/tests/stories/brand/communications/posts/PostFooter.svelte new file mode 100644 index 000000000000..2d21c0b0bcac --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/PostFooter.svelte @@ -0,0 +1,28 @@ + + + +
+ {left} + + {#if right}{right}{/if} +
+ + diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/PostFrame.svelte b/ui/apps/chat/tests/stories/brand/communications/posts/PostFrame.svelte new file mode 100644 index 000000000000..e7e82dc8e053 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/PostFrame.svelte @@ -0,0 +1,129 @@ + + + + +
+
+
{@render children()}
+ + {#if overlay} + + {/if} +
+
+ + diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/PostHeader.svelte b/ui/apps/chat/tests/stories/brand/communications/posts/PostHeader.svelte new file mode 100644 index 000000000000..88636758412c --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/PostHeader.svelte @@ -0,0 +1,99 @@ + + + +
+ {#if brand === 'icon'} + {ICON} + {:else if brand === 'Llama'} + {LOCKUP}Llama + {:else} + {LOCKUP}llama.cpp + {/if} + + {#if kicker}{kicker}{/if} + + {#if pill} + {#if brand !== 'icon'}{/if} + + {pill} + {/if} + + {#if url}{url}{/if} +
+ + diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/ProductShot.svelte b/ui/apps/chat/tests/stories/brand/communications/posts/ProductShot.svelte new file mode 100644 index 000000000000..d129389d719a --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/ProductShot.svelte @@ -0,0 +1,27 @@ + + + + +
+ + diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/grounds.css b/ui/apps/chat/tests/stories/brand/communications/posts/grounds.css new file mode 100644 index 000000000000..565ab9850fb1 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/grounds.css @@ -0,0 +1,153 @@ +/* + Communications' grounds and type scale. A ground sets a piece's background and its inks as variables, which every + element and module reads (--p-bg, --p-base (a flat colour of the ground, for shapes that hide what is behind + them), --p-ink, --p-muted, --p-line, --p-card, --p-inset, --p-solid, --p-solid-ink, + --p-link). The type scale is in units (--u, a 24th of the format's short side), so a headline is the same weight of + the piece in a square post and on a billboard. +*/ + +.ground { + --sans: 'Llama Sans', var(--font-sans); + --mono: 'Llama Mono', var(--font-mono); + background: var(--p-bg); + color: var(--p-ink); + font: 400 calc(var(--u) * 0.62) / 1.4 var(--sans); + /* figures, meta lines and repo ids keep their columns */ + font-variant-numeric: tabular-nums; + /* the text stack's rhythm, in every layout: a label to its headline, a headline to its lede, and the lede to what + follows it (a command, chips, a caption) */ + --stack-label: calc(var(--u) * 0.6); + --stack: calc(var(--u) * 1.2); + --stack-after: calc(var(--u) * 1.6); +} + +.ground-light { + --p-base: #fafafa; + --p-bg: #fafafa; + --p-ink: #111111; + --p-muted: rgb(17 17 17 / 0.62); + --p-line: rgb(17 17 17 / 0.1); + --p-card: #ffffff; + --p-inset: var(--neutral-100); + --p-solid: #111111; + --p-solid-ink: #fafafa; + --p-link: var(--art-night-sky); +} +.ground-dark { + --p-base: #111111; + --p-bg: #111111; + --p-ink: #fafafa; + --p-muted: rgb(250 250 250 / 0.62); + --p-line: rgb(250 250 250 / 0.13); + --p-card: rgb(250 250 250 / 0.04); + --p-inset: rgb(250 250 250 / 0.06); + --p-solid: #fafafa; + --p-solid-ink: #111111; + --p-link: var(--art-day-sky); +} +.ground-sand { + --p-base: var(--sand-50); + --p-bg: var(--sand-50); + --p-ink: var(--sand-900); + --p-muted: color-mix(in oklab, var(--sand-900) 66%, transparent); + --p-line: color-mix(in oklab, var(--sand-900) 12%, transparent); + --p-card: var(--sand-100); + --p-inset: var(--sand-200); + --p-solid: var(--sand-900); + --p-solid-ink: var(--sand-50); + --p-link: var(--art-night-sky); +} +/* the day sky: llama.app's hero, deeper blue at the top and light at the horizon */ +.ground-day { + --p-base: #d0e4f7; + --p-bg: + radial-gradient(ellipse at 15% 10%, #dcecfb 0%, transparent 55%), + radial-gradient(ellipse at 90% 95%, #e8f2fc 0%, transparent 50%), + linear-gradient(160deg, #c4ddf6 0%, #d0e4f7 55%, #dfecf9 100%); + --p-ink: #111111; + --p-muted: rgb(17 17 17 / 0.62); + --p-line: rgb(17 17 17 / 0.1); + --p-card: rgb(255 255 255 / 0.9); + --p-inset: rgb(17 17 17 / 0.05); + --p-solid: #111111; + --p-solid-ink: #fafafa; + --p-link: var(--art-night-sky); +} +/* the night sky: darkest at the top, lifting a little towards the horizon, with a faint glow there; the steps are + small, so it reads as one dark blue */ +.ground-night { + --p-base: #13213a; + --p-bg: + radial-gradient(ellipse 120% 60% at 50% 115%, rgb(46 70 104 / 0.35) 0%, transparent 70%), + linear-gradient(180deg, #0f1a2b 0%, #13213a 55%, #182a45 100%); + --p-ink: #fafafa; + --p-muted: rgb(250 250 250 / 0.66); + --p-line: rgb(250 250 250 / 0.14); + --p-card: rgb(17 26 42 / 0.82); + --p-inset: rgb(250 250 250 / 0.07); + --p-solid: #fafafa; + --p-solid-ink: #111111; + --p-link: var(--art-day-sky); +} +/* the type scale, at a low specificity so a layout sets its own margins */ +:where(.ground) :where(.t-label) { + margin: 0; + color: var(--p-muted); + font: 500 calc(var(--u) * 0.54) / 1 var(--mono); + letter-spacing: 0.12em; + text-transform: uppercase; +} +:where(.ground) :where(.t-body) { + margin: 0; + font-size: calc(var(--u) * 0.62); + line-height: 1.4; + text-wrap: pretty; +} +/* a lede keeps to about 40 characters a line, so it doesn't run up to what stands beside it */ +:where(.ground) :where(.t-lede) { + max-width: calc(var(--u) * 17); + margin: 0; + color: var(--p-muted); + font-size: calc(var(--u) * 0.84); + line-height: 1.3; + text-wrap: pretty; +} +:where(.ground) :where(.t-headline, .t-display, .t-figure) { + margin: 0; + font-family: var(--sans); + font-weight: 700; + white-space: pre-line; + text-wrap: balance; +} +:where(.ground) :where(.t-headline) { + font-size: calc(var(--u) * 2); + line-height: 0.98; + letter-spacing: -0.02em; +} +:where(.ground) :where(.t-display) { + font-size: calc(var(--u) * 3.2); + line-height: 0.92; + letter-spacing: -0.035em; +} +:where(.ground) :where(.t-figure) { + font-size: calc(var(--u) * 5); + line-height: 0.85; + letter-spacing: -0.04em; +} +:where(.ground) :where(.t-mono) { + margin: 0; + font: 400 calc(var(--u) * 0.58) / 1.2 var(--mono); +} + +/* a box a motif fills: the SVG takes the box's size, whatever the format, rather than growing with its width */ +.fill { + position: relative; + min-width: 0; + min-height: 0; +} +.fill > svg { + position: absolute; + inset: 0; + width: 100%; + height: 100%; +} diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/motifs/Laptop.svelte b/ui/apps/chat/tests/stories/brand/communications/posts/motifs/Laptop.svelte new file mode 100644 index 000000000000..3927fb304c44 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/motifs/Laptop.svelte @@ -0,0 +1,70 @@ + + + + diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/motifs/Server.svelte b/ui/apps/chat/tests/stories/brand/communications/posts/motifs/Server.svelte new file mode 100644 index 000000000000..165ee95707c3 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/motifs/Server.svelte @@ -0,0 +1,55 @@ + + + + diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/motifs/Solid.svelte b/ui/apps/chat/tests/stories/brand/communications/posts/motifs/Solid.svelte new file mode 100644 index 000000000000..e30dfe77a568 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/motifs/Solid.svelte @@ -0,0 +1,13 @@ + + + +{#each faces(box, view).filter((f) => !flat || f.name === 'front') as f (f.name)} + + + +{/each} diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/motifs/WorkstationSmall.svelte b/ui/apps/chat/tests/stories/brand/communications/posts/motifs/WorkstationSmall.svelte new file mode 100644 index 000000000000..9597ef7af774 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/motifs/WorkstationSmall.svelte @@ -0,0 +1,51 @@ + + + + diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/motifs/box.ts b/ui/apps/chat/tests/stories/brand/communications/posts/motifs/box.ts new file mode 100644 index 000000000000..9bc685d7db0a --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/motifs/box.ts @@ -0,0 +1,113 @@ +// Boxes for the machine motifs: a box's three faces the viewer sees (its top, its front and its right side, with the +// camera turned as in `device`), shaded by which way they face, and a way to draw on a face in its own units, so a +// fan, a vent or a key sits flat on the surface it belongs to. +import { type Point3, project, pts, type View } from './project'; + +/** the camera every machine is drawn with: from the front left, a little above, nearly without perspective */ +export const device = (scale: number, cy = 160): View => ({ + cx: 200, + cy, + distance: 30, + pitch: 0.5, + scale, + yaw: -0.6 +}); + +/** the camera for a machine's flat version: straight at its front, without perspective */ +export const front = (scale: number, cy = 160): View => ({ + cx: 200, + cy, + distance: 1000, + pitch: 0, + scale, + yaw: 0 +}); + +export interface Box { + max: Point3; + min: Point3; +} + +export type FaceName = 'front' | 'right' | 'top'; + +/** how light each face is: the ink laid over the ground, from the top (lightest) to the right side (darkest) */ +export const SHADE: Record = { front: 0.14, right: 0.3, top: 0.04 }; + +/** a point on a face, `u` across and `v` up (on the top, `v` runs away from the front), in world units from its corner */ +export function on(b: Box, face: FaceName, u: number, v: number): Point3 { + const [x0, y0, z0] = b.min; + const [x1, y1] = b.max; + + if (face === 'front') return [x0 + u, y0 + v, z0]; + + if (face === 'right') return [x1, y0 + v, z0 + u]; + + return [x0 + u, y1, z0 + v]; +} + +/** a face's size, across and up */ +export function size(b: Box, face: FaceName): [number, number] { + const [dx, dy, dz] = [b.max[0] - b.min[0], b.max[1] - b.min[1], b.max[2] - b.min[2]]; + + return face === 'front' ? [dx, dy] : face === 'right' ? [dz, dy] : [dx, dz]; +} + +/** a drawing pen for a box under a view: points, lines, rectangles and circles on its faces, as SVG points */ +export function pen(b: Box, view: View) { + const at = (face: FaceName, u: number, v: number) => project(on(b, face, u, v), view); + + return { + /** a point on a face */ + at: (face: FaceName, u: number, v: number) => at(face, u, v).slice(0, 2) as [number, number], + /** a circle on a face, as polygon points */ + circle: (face: FaceName, u: number, v: number, r: number, n = 36) => + pts( + Array.from({ length: n }, (_, i) => { + const a = (i / n) * Math.PI * 2; + + return at(face, u + r * Math.cos(a), v + r * Math.sin(a)); + }) + ), + /** the whole face, as polygon points */ + face: (face: FaceName) => { + const [w, h] = size(b, face); + + return pts([at(face, 0, 0), at(face, w, 0), at(face, w, h), at(face, 0, h)]); + }, + /** a line on a face, as polyline points */ + line: (face: FaceName, u0: number, v0: number, u1: number, v1: number) => + pts([at(face, u0, v0), at(face, u1, v1)]), + /** a path of points on a face */ + path: (face: FaceName, list: [number, number][]) => pts(list.map(([u, v]) => at(face, u, v))), + /** a rectangle on a face */ + rect: (face: FaceName, u: number, v: number, w: number, h: number) => + pts([at(face, u, v), at(face, u + w, v), at(face, u + w, v + h), at(face, u, v + h)]) + }; +} + +/** the faces a box shows, back to front, as polygon points with their shade */ +export function faces(b: Box, view: View) { + const p = pen(b, view); + + return (['top', 'front', 'right'] as FaceName[]).map((name) => ({ + name, + points: p.face(name), + shade: SHADE[name] + })); +} + +/** a soft shadow on the floor under a box, a little larger than it */ +export function shadow(b: Box, view: View, grow = 0.12) { + const y = b.min[1]; + + return pts( + ( + [ + [b.min[0] - grow, y, b.min[2] - grow], + [b.max[0] + grow, y, b.min[2] - grow], + [b.max[0] + grow, y, b.max[2] + grow], + [b.min[0] - grow, y, b.max[2] + grow] + ] as Point3[] + ).map((q) => project(q, view)) + ); +} diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/motifs/motif.css b/ui/apps/chat/tests/stories/brand/communications/posts/motifs/motif.css new file mode 100644 index 000000000000..6be162a036c1 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/motifs/motif.css @@ -0,0 +1,70 @@ +/* + The motifs' shared drawing: lines in the ground's ink, round caps, labels in Llama Mono in the muted ink, and one + cinder detail per motif. Each motif is an SVG that fills its box (see .fill in grounds.css). +*/ +.motif-svg { + display: block; + width: 100%; + height: 100%; + overflow: visible; +} +.motif-svg .ink { + fill: none; + stroke: var(--p-ink); + stroke-width: 7; + stroke-linecap: round; + stroke-linejoin: round; +} +.motif-svg .thin { + fill: none; + stroke: var(--p-ink); + stroke-width: 3; + stroke-linecap: round; + opacity: 0.3; +} +.motif-svg .solid { + fill: var(--p-ink); +} +.motif-svg .soft { + fill: var(--p-inset); +} +.motif-svg .accent { + fill: var(--art-cinder); +} +.motif-svg .accent-line { + fill: none; + stroke: var(--art-cinder); + stroke-width: 7; + stroke-linecap: round; + stroke-linejoin: round; +} +.motif-svg text { + fill: var(--p-muted); + font: 500 24px var(--mono); +} + +/* the machines: faces filled with the ground's flat colour, then shaded with ink; edges in ink */ +.motif-svg .face { + fill: var(--p-base); +} +.motif-svg .shade { + fill: var(--p-ink); + stroke: var(--p-ink); + stroke-width: 2.2; + stroke-linejoin: round; +} +.motif-svg .detail { + fill: none; + stroke: var(--p-ink); + stroke-width: 1.6; + stroke-linecap: round; + stroke-linejoin: round; +} +.motif-svg .hole { + fill: var(--p-ink); + opacity: 0.55; +} +.motif-svg .floor { + fill: var(--p-ink); + opacity: 0.06; +} diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/motifs/project.ts b/ui/apps/chat/tests/stories/brand/communications/posts/motifs/project.ts new file mode 100644 index 000000000000..ff0d3cbe4cbf --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/motifs/project.ts @@ -0,0 +1,47 @@ +// A small 3D projection for the motifs: points in a unit space (y up) turned by a yaw and a pitch and drawn with a +// gentle perspective into a 400 × 300 SVG, with their depth, so lines and dots can fade and shrink with distance. + +export type Point3 = [number, number, number]; + +export interface View { + cx: number; + cy: number; + /** the camera's distance; larger is flatter */ + distance: number; + /** how far the camera looks down onto the scene, in radians */ + pitch: number; + scale: number; + /** the turn around the vertical axis, in radians */ + yaw: number; +} + +/** a point on the page and its depth: 0 at the centre, positive away from the viewer */ +export function project([x, y, z]: Point3, v: View): [number, number, number] { + const x1 = x * Math.cos(v.yaw) - z * Math.sin(v.yaw); + const z1 = x * Math.sin(v.yaw) + z * Math.cos(v.yaw); + // a positive pitch looks down onto the scene: what is higher comes nearer + const y1 = y * Math.cos(v.pitch) + z1 * Math.sin(v.pitch); + const z2 = -y * Math.sin(v.pitch) + z1 * Math.cos(v.pitch); + const f = v.distance / (v.distance + z2); + + return [v.cx + x1 * v.scale * f, v.cy - y1 * v.scale * f, z2]; +} + +/** how far back a depth is, from 0 (nearest) to 1 (farthest), over a range */ +export const far = (depth: number, range = 1.6) => + Math.min(1, Math.max(0, (depth + range / 2) / range)); + +/** a points list for a polyline or polygon */ +export const pts = (list: number[][]) => + list.map(([x, y]) => `${x.toFixed(1)},${y.toFixed(1)}`).join(' '); + +/** a repeatable pseudo-random sequence, for scattering points the same way on every render */ +export function random(seed: number) { + let s = seed; + + return () => { + s = (s * 1103515245 + 12345) % 2147483648; + + return s / 2147483648; + }; +} diff --git a/ui/apps/chat/tests/stories/brand/communications/posts/post.ts b/ui/apps/chat/tests/stories/brand/communications/posts/post.ts new file mode 100644 index 000000000000..a593b0a927e8 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/posts/post.ts @@ -0,0 +1,546 @@ +// The social post and link preview templates: their formats, tones and the copy they ship with. The copy is the +// stories' args, so it can be rewritten in Storybook's controls before a post is exported. + +/** + * The grounds a piece is set on. The neutrals (light, dark) take either lockup; the day sky (llama.app's hero) and + * the night sky, and sand take the Llama lockup only. Cinder is never a ground: it is the one accent on top of them + */ +export type Ground = 'dark' | 'day' | 'light' | 'night' | 'sand'; +/** the older name, kept for the post templates */ +export type PostTone = Ground; + +export const GROUNDS: Record = { + dark: { lockups: 'Llama, llama.cpp', name: 'Dark', note: 'Ink, for the developer side' }, + day: { + lockups: 'Llama', + name: 'Day sky', + note: "llama.app's hero: deeper at the top, light at the horizon" + }, + light: { lockups: 'Llama, llama.cpp', name: 'Light', note: 'The default: neutral 50 with ink' }, + night: { + lockups: 'Llama', + name: 'Night sky', + note: 'Darkest at the top, a faint glow at the horizon' + }, + sand: { lockups: 'Llama', name: 'Sand', note: 'The warm neutral, with its own ink' } +}; + +export interface PostFormat { + height: number; + name: string; + /** the pixels at the top and bottom the platform covers with its own bars */ + safe?: { bottom: number; top: number }; + /** where it goes */ + use?: string; + width: number; +} + +export const FORMATS = { + billboard: { height: 800, name: 'Billboard 3:1', use: 'Banners, screens at events', width: 2400 }, + landscape: { height: 900, name: 'Landscape 16:9', use: 'X, Bluesky, slides', width: 1600 }, + /** the Mac App Store's screenshots: 16:10 at the largest size Apple takes, a 1440 × 900 screen at 2x */ + macScreenshot: { + height: 1800, + name: 'Mac App Store screenshot 16:10', + use: 'Mac App Store screenshots, up to ten', + width: 2880 + }, + /** the Microsoft Store's listing: artwork, screenshots and logos; the Store may lay text over the bottom quarter */ + msHero: { + height: 1080, + name: 'Super hero art 16:9', + safe: { bottom: 270, top: 0 }, + use: 'The top of the Microsoft Store listing', + width: 1920 + }, + msPoster: { + height: 1080, + name: 'Poster art 2:3', + use: 'The Microsoft Store’s main logo', + width: 720 + }, + msScreenshot: { + height: 1080, + name: 'Store screenshot 16:9', + safe: { bottom: 270, top: 0 }, + use: 'Microsoft Store screenshots, four or more', + width: 1920 + }, + msTile: { height: 300, name: 'App tile icon', use: 'The Microsoft Store’s tile', width: 300 }, + og: { height: 630, name: 'Open Graph', use: 'Link previews on llama.app', width: 1200 }, + portrait: { height: 1350, name: 'Portrait 4:5', use: 'Instagram, LinkedIn', width: 1080 }, + poster: { height: 1754, name: 'Poster A-series', use: 'Print, at 150 dpi', width: 1240 }, + repo: { height: 640, name: 'GitHub social preview', use: 'The repo’s link preview', width: 1280 }, + square: { height: 1080, name: 'Square', use: 'Instagram, LinkedIn, X', width: 1080 }, + story: { + height: 1920, + name: 'Story 9:16', + safe: { bottom: 320, top: 220 }, + use: 'Instagram and TikTok stories, Shorts', + width: 1080 + } +} satisfies Record; + +export type FormatKey = keyof typeof FORMATS; + +export type Shape = 'square' | 'tall' | 'wide'; + +export interface Grid { + /** the column count: six on square and tall formats, twelve on wide ones */ + columns: number; + /** the space between columns, half a unit */ + gutter: number; + /** the margin on every side, two units (plus the safe area) */ + margin: number; + shape: Shape; + /** + * the unit: a 24th of the short side, or a 48th of the long side on a format wider than 2:1. Every size in a piece + * (type, spacing, radii) is a multiple of it + */ + unit: number; +} + +/** + * The grid for a format: one unit tied to its short side, so a layout scales across formats rather than being redrawn. + * `unit` fixes it instead, for a specimen tile sized to its content + */ +export function grid({ height, width }: PostFormat, unit?: number): Grid { + unit ??= Math.max(Math.min(width, height) / 24, Math.max(width, height) / 48); + const shape: Shape = width / height >= 1.5 ? 'wide' : height / width >= 1.3 ? 'tall' : 'square'; + + return { columns: shape === 'wide' ? 12 : 6, gutter: unit / 2, margin: unit * 2, shape, unit }; +} + +/** the lockup glyph, U+E002: the icon with the lockup's gap built in, typed straight before the name */ +export const LOCKUP = ''; +/** the icon on its own, U+E001: the capital form, for a header without the name */ +export const ICON = ''; + +export interface Stat { + label: string; + value: string; +} + +export interface Model { + /** a short line over the name: the maker and what it is for */ + about?: string; + /** the tag over the name, in cinder when `accent` */ + accent?: boolean; + /** a Mono tag at the card's top right: its modality or kind */ + badge?: string; + description?: string; + /** Mono facts under the description: size, quant, licence */ + meta?: string[]; + name: string; + repo?: string; + stats?: Stat[]; + tag?: string; +} + +export interface ModelDropCopy { + chips: string[]; + headline: string; + kicker: string; + lede: string; + models: Model[]; + section: string; + url: string; +} + +export const modelDrop: ModelDropCopy = { + chips: ['route a ticket', 'moderate content', 'pick an agent’s next step'], + headline: 'Decision models, running locally, a click away.', + kicker: 'From the llama.cpp team & Hugging Face', + lede: 'Give a model a document and typed questions. Get back a calibrated probability for every option, lightning fast.', + models: [ + { + accent: true, + description: + 'From vLLM-SR’s Decision 3.0 family, #1 on the Jev Decision Index. Reads text, JSON, images and video.', + meta: ['9B', '6.6 GB Q4_K_M', 'Apache-2.0'], + name: 'd3-flash', + repo: 'ggml-org/vllm-d3-flash-GGUF', + tag: 'Decision Index leader' + }, + { + description: + 'Liquid AI’s omni decision model. Text, images, audio and video, even spoken questions, in 2B.', + meta: ['2B', '1.85 GB Q8_0', 'runs on a laptop'], + name: 'd1-Omni-2B', + repo: 'LiquidAI/d1-Omni-2B-GGUF', + tag: 'Every modality' + } + ], + section: 'Fresh drops', + url: 'llama.app/models' +}; + +export interface WhatsNewCopy { + family: { about: string; aside: string; models: Model[]; name: string }; + footer: [string, string]; + headline: string; + lede: string; + models: Model[]; + pill: string; + url: string; +} + +export const whatsNew: WhatsNewCopy = { + family: { + about: 'Liquid AI · small and multimodal', + aside: 'Built for on-device', + models: [ + { + badge: 'text', + description: 'Small chat model in 16 languages. Runs on CPU or GPU.', + name: 'LFM3-1.7B' + }, + { + badge: 'omni', + description: 'A small model that can see, watch, hear and talk back.', + name: 'LFM3-Omni-2B' + }, + { + badge: 'audio', + description: 'Takes text and audio, outputs text or speech.', + name: 'LFM3-Audio-2B' + }, + { + badge: 'decision', + description: 'Yes/no, choice and score answers over text, image and video.', + name: 'd1-2B' + } + ], + name: 'LFM3' + }, + footer: ['By the llama.cpp team and Hugging Face', 'Free · Open source · Works offline'], + headline: 'New in Llama.\nOn your computer.', + lede: 'Liquid AI’s LFM3 family, Mistral Large 4 and Recursive’s Flint now run in the Llama app. Pick one from Models and start chatting.', + models: [ + { + about: 'Mistral AI · frontier scale', + description: + 'The 2-bit quant fits in 512 GB of unified memory. Strong in cybersecurity and agentic coding.', + name: 'Mistral Large 4', + repo: 'ggml-org/Mistral-Large-4-1T-A52B-GGUF', + stats: [ + { label: 'params, ~52B active', value: '1T' }, + { label: 'context, image input', value: '1M' } + ] + }, + { + about: 'Recursive · for coding agents', + description: + 'Investigates codebases, fixes bugs and writes tests, with reasoning and tool use.', + name: 'Flint', + repo: 'ggml-org/Flint-GGUF', + stats: [ + { label: 'active of 39.8B', value: '2.5B' }, + { label: 'SWE-bench Verified', value: '74.2%' } + ] + } + ], + pill: 'New models available today', + url: 'llama.app' +}; + +export interface LinkPreviewCopy { + caption: string; + command: string; + headline: string; + repoHeadline: string; + repoLede: string; +} + +export const linkPreview: LinkPreviewCopy = { + caption: 'Llama · Your AI, on your computer', + command: 'llama-server -hf ggml-org/gemma-4-E4B-it-GGUF', + headline: 'Your AI.\nOn your computer.', + repoHeadline: 'LLM inference\nin C/C++', + repoLede: 'Run open models on your own hardware, from a laptop to a server.' +}; + +export interface ReceiptCopy { + footer: [string, string]; + headline: string; + rows: [string, string][]; + title: string; +} + +/** an early llama.app ad, said plainly: the headline states it, the receipt makes the point about paying per token */ +export const openModels: ReceiptCopy = { + footer: ['Free AI for everyone', 'Open source · Works offline'], + headline: '100,000+ open models.\nOne computer: yours.', + rows: [ + ['tokens generated', '1,284,902'], + ['account', 'none'], + ['total', '$0.00'] + ], + title: 'Your AI bill, today' +}; + +export interface AgentsCopy { + agents: { name: string; note: string }[]; + command: string; + endpoint: string; + footer: [string, string]; + headline: string; + lede: string; + url: string; +} + +/** + * Llama serving agents, after Merve's post: the endpoint any agent can point at, and how four of them connect. Her + * copy, but for the lede's onboarding sentence, which the Hermes card says; it is set large for a phone and tracked + * tighter to fit + */ +export const agentsPost: AgentsCopy = { + agents: [ + { name: 'OpenClaw', note: 'OpenAI-compatible API' }, + { name: 'Hermes', note: 'Set up during onboarding' }, + { name: 'Pi', note: '/login llama.cpp' }, + { name: 'Codex', note: '~/.codex/config.toml' } + ], + command: 'base_url = "http://127.0.0.1:9931/v1"', + endpoint: ':9931/v1', + footer: ['By the llama.cpp team and Hugging Face', 'Free · Open source · Works offline'], + headline: 'Any agent.\nOn your computer.', + lede: 'Llama serves open models at an OpenAI-compatible endpoint. Point your coding agent at it and keep working, even offline.', + url: 'llama.app/docs/agents' +}; + +export interface VirtualModelsCopy { + /** the harness the model is picked in, and the model's id */ + from: { model: string; name: string }; + /** each model it can send a query to: where it runs, its name, and what runs it */ + routes: { label: string; name: string; runner: 'Hugging Face' | 'llama.cpp' }[]; + title: string; +} + +/** + * Pi's Virtual Models, after Julien's post: one model picked in Pi that sends a simple question to a model in + * llama.cpp on your computer and a hard one to a hosted model on Hugging Face. His title and his two models, the + * local one first + */ +export const virtualModels: VirtualModelsCopy = { + from: { model: 'hybrid/auto', name: 'Pi' }, + routes: [ + { label: 'Local', name: 'Qwen3.8 27B', runner: 'llama.cpp' }, + { label: 'Remote', name: 'GLM-5.3', runner: 'Hugging Face' } + ], + title: 'Virtual Models' +}; + +export interface StoreLine { + headline: string; + lede?: string; +} + +/** a version of a screenshot's copy: one of several to compare, or to A/B test in a Store product page experiment */ +export interface StoreVariant extends StoreLine { + /** a short name for it, A, B and so on */ + id: string; + /** what it leans on */ + note: string; +} + +/** + * The Microsoft Store listing, in the order the Store shows it (ten screenshots, its most): each one practical thing + * the app does on Windows, said so that what we stand for comes through (yours, private, for everyone) without + * preaching it, and only what the app already does (its release notes, its README). The opener and the chat come in + * several versions, the opener's mostly leading with privacy; all in the voice: sentence case, full stops, no + * superlatives + */ +export interface MicrosoftStoreCopy { + apps: StoreLine; + /** the chat, each version with its own conversation (a Store scene) */ + chats: (StoreVariant & { scene: 'chat' | 'document' | 'screenshot' })[]; + gpu: StoreLine; + models: StoreLine; + openers: StoreVariant[]; + privacy: StoreLine; + quick: StoreLine; + speed: StoreLine & { figureLabel: string; value: string }; + tray: StoreLine; + verdicts: StoreLine; +} + +export const microsoftStore: MicrosoftStoreCopy = { + apps: { + headline: 'Works with the apps\nyou already use.', + lede: 'Any app that speaks the OpenAI API can use your models, right on your PC.' + }, + chats: [ + { + headline: 'Help with everyday things,\neven offline.', + id: 'A', + lede: 'Your conversations stay on your PC.', + note: 'Writing', + scene: 'chat' + }, + { + headline: 'Your documents\nstay on your PC.', + id: 'B', + lede: 'Summarize a lease, a bill or a letter, even offline.', + note: 'Documents', + scene: 'document' + }, + { + headline: 'Ask about what’s\non your screen.', + id: 'C', + lede: 'Share a screenshot for a plain answer. It never leaves your PC.', + note: 'Screenshots', + scene: 'screenshot' + } + ], + gpu: { + headline: 'Runs on the graphics card\nyou already have.', + lede: 'NVIDIA, AMD or Intel, or on the processor alone.' + }, + models: { + headline: 'The models you choose\nstay yours.', + lede: 'Each one is a file on your PC: open its folder, run it or delete it. No one else can change it.' + }, + openers: [ + { + headline: 'Your AI.\nOn your PC.', + id: 'A', + lede: 'Free and open source. No account, no subscription.', + note: 'Ownership' + }, + { + headline: 'Chat with AI,\nprivately.', + id: 'B', + lede: 'It runs on your PC. Your conversations stay with you.', + note: 'Privacy, as what you do' + }, + { + headline: 'Run your own AI.\nLocal and private.', + id: 'C', + lede: 'On your PC, even offline. No account, no subscription.', + note: 'Privacy, with ownership' + }, + { + headline: 'Local AI.\nFree and private.', + id: 'D', + lede: 'Run open models from Hugging Face on your PC.', + note: 'Privacy, with price' + }, + { + headline: 'Private AI,\nright on your PC.', + id: 'E', + lede: 'Your conversations stay on it. Free, and it works offline.', + note: 'Privacy, with place' + } + ], + privacy: { + headline: 'No telemetry.\nNone.', + lede: 'No events, no analytics, no install ID. Your prompts and replies stay on your PC.' + }, + quick: { + headline: 'A quick chat,\nfrom any app.', + lede: 'Esc hides it, and your conversation waits for the next time.' + }, + speed: { + figureLabel: 'faster, with the same answers', + headline: 'Faster replies,\nsame answers.', + lede: 'Models that can draft ahead do it on their own. Nothing to set up.', + value: 'Up to 2×' + }, + tray: { + headline: 'Good models to start with,\nright in the tray.', + lede: 'Llama runs the server for you. Pick one, or search all of Hugging Face.' + }, + verdicts: { + headline: 'Know before\nyou download.', + lede: 'Every version says whether it fits your PC, from what it needs and what your PC has.' + } +}; + +/** + * The Mac App Store listing: the same voice as the Microsoft Store's, for Llama for Mac and what it does that the + * Windows app doesn't (its menu bar, a Safari web app in the Dock, its models reached from a phone), from its release + * notes and README. It claims nothing about telemetry: the Mac app reports crashes + */ +export interface MacAppStoreCopy { + apps: StoreLine; + chats: (StoreVariant & { scene: 'chat' | 'document' })[]; + hardware: StoreLine; + menu: StoreLine; + openers: StoreVariant[]; + phone: StoreLine; + size: StoreLine & { figureLabel: string; value: string }; +} + +export const macAppStore: MacAppStoreCopy = { + apps: { + headline: 'Works with the apps\nyou already use.', + lede: 'Any app that speaks the OpenAI API can use your models, right on your Mac.' + }, + chats: [ + { + headline: 'Chat in a window\nof its own.', + id: 'A', + lede: 'Add Llama to the Dock as a Safari web app. Your conversations stay on your Mac.', + note: 'Writing', + scene: 'chat' + }, + { + headline: 'Your documents\nstay on your Mac.', + id: 'B', + lede: 'Summarize a lease, a bill or a letter, even offline.', + note: 'Documents', + scene: 'document' + } + ], + hardware: { + headline: 'Runs on the Mac\nyou already have.', + lede: 'Recommended for your Mac lists the models that fit its memory.' + }, + menu: { + headline: 'Lives in your\nmenu bar.', + lede: 'Llama runs the server for you and suggests a first model that fits your Mac.' + }, + openers: [ + { + headline: 'Your AI.\nOn your Mac.', + id: 'A', + lede: 'Free and open source. No account, no subscription.', + note: 'Ownership' + }, + { + headline: 'Chat with AI,\nprivately.', + id: 'B', + lede: 'It runs on your Mac. Your conversations stay with you.', + note: 'Privacy, as what you do' + }, + { + headline: 'Run your own AI.\nLocal and private.', + id: 'C', + lede: 'On your Mac, even offline. No account, no subscription.', + note: 'Privacy, with ownership' + }, + { + headline: 'Local AI.\nFree and private.', + id: 'D', + lede: 'Run open models from Hugging Face on your Mac.', + note: 'Privacy, with price' + }, + { + headline: 'Private AI,\nright on your Mac.', + id: 'E', + lede: 'Your conversations stay on it. Free, and it works offline.', + note: 'Privacy, with place' + } + ], + phone: { + headline: 'Your models,\non your phone too.', + lede: 'Scan the code in the menu. Over Tailscale, only your own devices can reach them.' + }, + size: { + figureLabel: 'a native Mac app', + headline: 'Small, and\nmade for the Mac.', + lede: 'It shares one llama.cpp with your terminal, and your models with your other tools.', + value: '4 MB' + } +}; diff --git a/ui/apps/chat/tests/stories/brand/communications/store/MacMenu.svelte b/ui/apps/chat/tests/stories/brand/communications/store/MacMenu.svelte new file mode 100644 index 000000000000..c92ce26903b8 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/store/MacMenu.svelte @@ -0,0 +1,417 @@ + + + + + +{#snippet title(row: Row)} + + {row.name}{#if row.params}{row.params}{/if}{#if row.quant}{row.quant}{/if}{#if row.vision}{/if} + +{/snippet} + +{#snippet modelRow(row: Row, trailing: 'chevron' | 'install', progress?: number)} +
+ {@html row.logo} + + + {@render title(row)} + + {row.subtitle} + + + {#if trailing === 'chevron'} + + {:else if progress !== undefined} + {Math.round(progress * 100)}% + + + {:else} + + {/if} +
+{/snippet} + + + + diff --git a/ui/apps/chat/tests/stories/brand/communications/store/assets/qr-network.svg b/ui/apps/chat/tests/stories/brand/communications/store/assets/qr-network.svg new file mode 100644 index 000000000000..2c42cff1c7c1 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/store/assets/qr-network.svg @@ -0,0 +1 @@ + diff --git a/ui/apps/chat/tests/stories/brand/communications/store/logos/gemma.svg b/ui/apps/chat/tests/stories/brand/communications/store/logos/gemma.svg new file mode 100644 index 000000000000..c750e840316c --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/store/logos/gemma.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/ui/apps/chat/tests/stories/brand/communications/store/logos/gpt.svg b/ui/apps/chat/tests/stories/brand/communications/store/logos/gpt.svg new file mode 100644 index 000000000000..187c7768d1d2 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/store/logos/gpt.svg @@ -0,0 +1,3 @@ + + + diff --git a/ui/apps/chat/tests/stories/brand/communications/store/logos/liquid.svg b/ui/apps/chat/tests/stories/brand/communications/store/logos/liquid.svg new file mode 100644 index 000000000000..6df35fc6d911 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/store/logos/liquid.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/ui/apps/chat/tests/stories/brand/communications/store/logos/qwen.svg b/ui/apps/chat/tests/stories/brand/communications/store/logos/qwen.svg new file mode 100644 index 000000000000..efff7e958ca8 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/store/logos/qwen.svg @@ -0,0 +1,3 @@ + + + diff --git a/ui/apps/chat/tests/stories/brand/communications/swag/Tee.svelte b/ui/apps/chat/tests/stories/brand/communications/swag/Tee.svelte new file mode 100644 index 000000000000..fb116155f5f3 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/swag/Tee.svelte @@ -0,0 +1,93 @@ + + + + + + + + + {#if guides} + {#each PLACEMENTS as p (p.id)} + {@const a = area(p)} + + {/each} + {:else if box && artwork} + {#if artwork.src} + + {:else} + + {@html quantized(fabric.tone, `q${uid}`)} + + {/if} + {/if} + + + diff --git a/ui/apps/chat/tests/stories/brand/communications/swag/prints.ts b/ui/apps/chat/tests/stories/brand/communications/swag/prints.ts new file mode 100644 index 000000000000..9ac31485bbca --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/swag/prints.ts @@ -0,0 +1,70 @@ +// The swag prints, fabrics and placements, as the Swag Creator (ggml-org/swag-creator, src/lib/prints.ts and +// garments.ts) defines them: every print but the quantized L comes from llama-brand, and placements are measured as a +// print shop does, in centimetres from the centre front of the neckline. +import type { Tone } from './quantized'; +import iconDark from '@ggml-org/llama-brand/logo/svg/icon/icon-dark.svg?url'; +import iconLight from '@ggml-org/llama-brand/logo/svg/icon/icon-light.svg?url'; +import llamaDark from '@ggml-org/llama-brand/logo/svg/lockup/llama/logo-llama-dark.svg?url'; +import llamaLight from '@ggml-org/llama-brand/logo/svg/lockup/llama/logo-llama-light.svg?url'; +import llamaCppDark from '@ggml-org/llama-brand/logo/svg/lockup/llama-cpp/logo-llama-cpp-dark.svg?url'; +import llamaCppLight from '@ggml-org/llama-brand/logo/svg/lockup/llama-cpp/logo-llama-cpp-light.svg?url'; + +export interface Artwork { + id: string; + label: string; + /** the placements it may be printed at; any when omitted */ + placements?: string[]; + /** scales the placement's print area for this artwork */ + printScale?: { height: number; width: number }; + /** a llama-brand file per tone; the quantized L is drawn in code instead */ + src?: Record; +} + +export const ARTWORKS: Artwork[] = [ + { id: 'icon', label: 'Llama icon', src: { dark: iconDark, light: iconLight } }, + { id: 'llama-logo', label: 'Llama logo', src: { dark: llamaDark, light: llamaLight } }, + { + id: 'llama-cpp-logo', + label: 'llama.cpp logo', + src: { dark: llamaCppDark, light: llamaCppLight } + }, + // its detail only reads at the large centre size; the legend makes it 1.5 times wider than tall + { + id: 'quantized', + label: 'L · Quantized', + placements: ['center'], + printScale: { height: 0.8, width: 1.2 } + } +]; + +export interface Fabric { + id: string; + label: string; + /** how the fabric reads, for a flat swatch */ + swatch: string; + /** which print variant reads on it: `light` has dark ink */ + tone: Tone; +} + +export const FABRICS: Fabric[] = [ + { id: 'white', label: 'White', swatch: '#f5f5f3', tone: 'light' }, + { id: 'melange', label: 'Melange', swatch: '#bdbdbb', tone: 'light' }, + { id: 'black', label: 'Black', swatch: '#1c1c1c', tone: 'dark' } +]; + +export interface Placement { + height: number; + id: string; + label: string; + /** distance from the neckline down to the print's top edge */ + top: number; + width: number; + /** the print centre's offset; positive is the wearer's left, the viewer's right */ + x: number; +} + +export const PLACEMENTS: Placement[] = [ + { height: 5, id: 'collar', label: 'Below collar', top: 5, width: 8, x: 0 }, + { height: 2.5, id: 'left-chest', label: 'Left chest', top: 10, width: 5, x: 11.5 }, + { height: 17, id: 'center', label: 'Center', top: 12, width: 17, x: 0 } +]; diff --git a/ui/apps/chat/tests/stories/brand/communications/swag/quantized.ts b/ui/apps/chat/tests/stories/brand/communications/swag/quantized.ts new file mode 100644 index 000000000000..947555519b51 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/communications/swag/quantized.ts @@ -0,0 +1,134 @@ +// The quantized L, the one swag print drawn in code rather than taken from llama-brand. Ported from the Swag Creator +// (huggingface.co/spaces/ggml-org/swag-creator, src/lib/artworks/generative.ts): the same 40 px grid, the same layer +// ladder and the same legend, with two changes for the design system: the legend's accent is cinder (art-cinder, +// #EE6C1E; the app uses #F65E00) and it is set in Llama Mono. The geometry stays as the app draws it. + +export type Tone = 'dark' | 'light'; + +const SIZE = 600; +const PIXEL = 40; +const LEGEND_WIDTH = 900; +const ACCENT = '#EE6C1E'; +/** The icon's two pieces, verbatim from llama-brand icon/icon-*.svg */ +const STROKE_PATH = + 'M240 392H0L199.602 46.0254C216.032 17.5463 246.411 3.25756e-05 279.29 0H466.154L240 392Z'; +const FOOT_PATH = + 'M600 392L504.249 558L504.137 557.929C487.252 584.069 458.193 600 426.864 600H120L240 392H600Z'; + +type Point = [number, number]; + +/** polygon approximations of the pieces, for deciding which cells fall inside */ +const STROKE: Point[] = [ + [240, 392], + [0, 392], + [199.6, 46], + [216, 17.5], + [246.4, 0], + [279.3, 0], + [466.2, 0] +]; +const FOOT: Point[] = [ + [600, 392], + [504.2, 558], + [487.3, 584.1], + [458.2, 600], + [426.9, 600], + [120, 600], + [240, 392] +]; + +export interface QuantizationLayer { + label: string; + /** how many rows of base pixels the layer covers, top to bottom */ + rows: number; + /** squares per base pixel side, or `smooth` for the true vector outline */ + splits: 'smooth' | number; +} + +/** llama.cpp's everyday ladder, F16 → Q8 → Q4 → Q2: the true logo at the top, half the precision each step down */ +export const QUANTIZATION_LAYERS: QuantizationLayer[] = [ + { label: '16-bit', rows: 4, splits: 'smooth' }, + { label: '8-bit', rows: 4, splits: 4 }, + { label: '4-bit', rows: 4, splits: 2 }, + { label: '2-bit', rows: 3, splits: 1 } +]; + +/** the artwork's size in its own units: the L and the legend beside it, 1.5 times wider than tall */ +export const QUANTIZED_SIZE = { height: SIZE, width: LEGEND_WIDTH }; + +const ink = (tone: Tone) => (tone === 'light' ? '#111111' : '#FAFAFA'); + +function insidePolygon([x, y]: Point, polygon: Point[]) { + let inside = false; + + for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) { + const [xi, yi] = polygon[i]; + const [xj, yj] = polygon[j]; + + if (yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi) inside = !inside; + } + + return inside; +} + +const insideL = (point: Point) => insidePolygon(point, STROKE) || insidePolygon(point, FOOT); + +/** + * The quantized L's markup, for an with viewBox 0 0 900 600: `light` has dark ink for light fabric, `dark` light + * ink for dark fabric. `id` keeps its clip paths apart when several sit on one page. + */ +export function quantized(tone: Tone, id: string, layers = QUANTIZATION_LAYERS) { + // a grey close to the ink fills the gaps, which keeps the squares apart without a flickering grid + const gapColor = tone === 'light' ? '#4d4d4d' : '#c4c4c4'; + const guide = tone === 'light' ? '#999999' : '#808080'; + const sections = layers.map((layer, index) => { + const from = layers.slice(0, index).reduce((sum, { rows }) => sum + rows, 0) * PIXEL; + + return { ...layer, from, to: Math.min(SIZE, from + layer.rows * PIXEL) }; + }); + const dash = `stroke="${guide}" stroke-width="4" stroke-dasharray="14 10"`; + const lines = sections + .slice(1) + .map(({ from }) => ``); + const labels = sections.map( + ({ from, label, to }) => + `${label}` + ); + const layersMarkup = sections + .map(({ from, splits, to }, index) => { + if (splits === 'smooth') { + const clip = `${id}-layer-${index}`; + + return ``; + } + + const cell = PIXEL / splits; + // finer squares get proportionally thinner gaps, so they don't fade into grey + const gap = cell >= 10 ? Math.max(1.5, cell / 12) : cell * 0.18; + const squares: string[] = []; + + for (let y = from; y < to; y += PIXEL) { + for (let x = 0; x < SIZE; x += PIXEL) { + if (!insideL([x + PIXEL / 2, y + PIXEL / 2])) continue; + + for (let i = 0; i < splits; i++) { + for (let j = 0; j < splits; j++) { + const sx = x + i * cell; + const sy = y + j * cell; + + squares.push( + ``, + `` + ); + } + } + } + } + + return squares.join(''); + }) + .join(''); + + // lines first, so the pixels sit on top of them + return `${lines.join('')}${layersMarkup}${labels.join('')}`; +} diff --git a/ui/apps/chat/tests/stories/introduction/Introduction.svx b/ui/apps/chat/tests/stories/introduction/Introduction.svx index 86c2e818be17..a97dbf02bfe7 100644 --- a/ui/apps/chat/tests/stories/introduction/Introduction.svx +++ b/ui/apps/chat/tests/stories/introduction/Introduction.svx @@ -35,6 +35,8 @@ The component library **Llama UI**, built on the **Llama Brand** (the icon, Llam ## How we think +The short version of **Philosophy**; the reasons are in **Ideology**, **Product** and **Design**. +
diff --git a/ui/apps/chat/tests/stories/introduction/Sections.svelte b/ui/apps/chat/tests/stories/introduction/Sections.svelte index baa8b68dac70..5c3ff1a661ca 100644 --- a/ui/apps/chat/tests/stories/introduction/Sections.svelte +++ b/ui/apps/chat/tests/stories/introduction/Sections.svelte @@ -1,17 +1,20 @@

Philosophy · Design

+ +# Design + +

Why the brand, Llama UI and Llama Chat look the way they do. The three share one set of decisions; the rules themselves are in Design guidelines.

+ +## Recognisable, easy to change + +The character lives in three places: the icon, the details of the type and one accent colour. Everything else is neutral, so an app built on Llama UI can add its own colour or logo without undoing ours. + +
+ +
+ +## Function first + +Every element has a job and a reason for its size and place. Proportion and finish do the rest; there is no ornament. That is the approach of Swiss typography and the Bauhaus. + +In practice the system has few roles and uses them everywhere. A button has no height, radius or icon size of its own; it takes the control's, so buttons, fields and toggles line up. + +
+ +
+ +## A little shape + +Shadows are subtle. Where it helps, an element gets a little shape: a soft shadow, a matte glass panel, or a hairline edge that melts into its shadow. It is a light touch of the physical, never decoration for its own sake. + +The shape follows the job. A raised button reads as something to press, a recessed field as somewhere to type, a lifted card as one thing, a menu as floating above the page. Depth tells elements and their roles apart, shows which sits above which, and leads the eye. + +
+ +
+ +## The crystal goblet + +In *The Crystal Goblet*, Beatrice Warde compared good typography to a clear wine glass: it shows the wine, not itself. In Llama Chat the wine is the conversation. The interface around it is grey, its surfaces are matte, and its type is set for reading. + +
+ +
+ +Colour or weight in the interface always means something: a status, a selection, focus or an action that can't be undone. + +## Design lives in code + +The tokens are CSS, and when the docs and the CSS disagree, the CSS wins. Every component and screen in this Storybook is the real implementation, and the key visuals in **Communications** are built from real Llama Chat screens, so they can't show what the app doesn't do. + +
+ +
+ +The brand assets are generated too. Scripts build the fonts from their sources, and the lockups, app icons, profile pictures and headers from the icon and the fonts. A change to a source is made once, and every file is rebuilt from it. + +
+ +
+ +## The icon at every size + +The icon is one solid shape: straight lines and two rounded corners. It reads the same from a 14px favicon to a 7500px cover, in one colour, on light or dark. It is also a glyph in both fonts (U+E000 to U+E002), so it can be typed inline and takes the colour and weight of the text around it. + +
+ +
+ +## Playing with the mark + +The outline is simple enough to stay recognisable whatever fills it, so artwork can fill it. The filling has to explain something true about llama.cpp. + +The quantized L is the first example: the icon quantized the way llama.cpp quantizes a model. The exact outline at 16 bits at the top, then half the precision at each step, through 8 and 4 bits, to whole pixels at 2 bits at the foot. It reads as the icon, explains quantization, and asks how much detail a shape can lose before it stops being itself. + +
+ +
+ +The outline stays exact, the colours stay ink and cinder, and the idea has to be accurate. + +## Grotesque type + +Llama Sans is a grotesque, the family that began with Akzidenz-Grotesk in 1898 and Neue Haas Grotesk in 1957, renamed Helvetica in 1960. Grotesques set Müller-Brockmann's Tonhalle posters, the American Airlines logo, the New York subway signs, the first iPhone and Apple's San Francisco. They have lasted because they are plain and neutral enough for any message. + +
+ +
+ +Llama Sans is built from Geist, an open neo-grotesk, with changes drawn from Akzidenz-Grotesk and Neue Haas Grotesk: rounder curves, open angled terminals, a tailless a and a narrow t. It is one variable font with an optical-size axis, so the browser picks UI or Display spacing from the font size. Llama Mono has the same letters in a fixed width, and keeps l, 1, I and | distinct. Both are under the SIL Open Font License. + +## Neutral by default + +Most of the interface is grey. Each group of colours has one job: + +- **Greys:** pages, surfaces, lines and text, in light and dark. +- **Status colours** (green, amber, red and blue): status only. Each has one root colour that its surfaces, lines and lamps derive from. +- **Art colours:** the day sky and the night sky, for grounds and illustrations in communications. There is no red, so artwork never looks like an error. +- **Cinder** (#EE6C1E): the one accent, for the .cpp in the llama.cpp logotype and small details such as the section numbers on this page. + +
+ +
+ +Backgrounds are neutral too. Only the Llama lockup goes on colour: the day sky and the night sky. + +Beyond the greys, communications have four colours, each from the world llama.cpp runs in. **Sand** is the warm ground for posters and boards, and a nod to silicon, made from sand, that every chip is built on. **Day sky** and **night sky** are llama.app's hero by day and after dark, the grounds Llama goes on. **Cinder** is the one warm accent. + +
+ +
+ +## Two names, one family + +**Llama** is the product: capital L, Llama Sans, allowed on colour. **llama.cpp** is the engine: lowercase, Llama Mono Bold, .cpp in cinder, on neutral grounds only. Both use the same icon glyph, which ties the two lockups together. + +
+ +
+ +## Communications + +Posts, link previews, posters and the site follow the app's rules: neutral grounds, Llama Sans and Llama Mono, typed lockups, and colour only from sand, the two skies and cinder. Llama posts may use the day sky and the night sky; llama.cpp posts stay on light and dark. + +Each post is a Svelte template with its copy kept as data, and the key visuals use real Llama Chat screens, so a new post is new copy, not a new design. + +
+ +
+ +Artwork has more room. The specimen boards follow the Swiss format: one face set large on sand, sky or grey grounds, with cinder as the only warm accent. + +
+ +
+ +## When something new comes up + +1. Reuse an existing role before adding a token, and an existing component before writing a new one. +2. Give every colour and effect a job, or leave it out. +3. Prefer generated or derived values to hand-tuned ones, and note the reason next to the value. +4. Keep it in code, in this Storybook. + +

Set in Llama Sans and Llama Mono. Every figure is drawn with the real components, fonts and tokens.

diff --git a/ui/apps/chat/tests/stories/philosophy/Ideology.stories.svelte b/ui/apps/chat/tests/stories/philosophy/Ideology.stories.svelte new file mode 100644 index 000000000000..8ca87ff75ffe --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/Ideology.stories.svelte @@ -0,0 +1,21 @@ + + + seedChatStory()} name="Ideology"> + + + + diff --git a/ui/apps/chat/tests/stories/philosophy/Ideology.svx b/ui/apps/chat/tests/stories/philosophy/Ideology.svx new file mode 100644 index 000000000000..d6eb712bc96c --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/Ideology.svx @@ -0,0 +1,108 @@ + + + + +

Philosophy · What we stand for

+ +# Ideology + +

Why llama.cpp, Llama UI and the apps exist. Product covers how they fit together, Design how they look.

+ +## Personal and private + +The model runs on a device you already own: your phone, laptop or desktop. It starts with sensible choices made for you, and every one of them can be changed if you want to. + +Your conversations stay on that device, and everything works offline, without an account. There is nothing to sign in to and nothing to send, so what you ask stays private and secure by default. That is what personal AI means here. + +
+ +
+ +## Open to everyone + +Open models run on hardware people already have, from a phone to a server. Making them run well there means capable AI doesn't depend on a subscription, a fast connection or a data centre. + +Access to AI should be as open as access to information: available to anyone, wherever they live and whatever they can pay. Running it well on ordinary machines is how llama.cpp works towards that. + +
+ +
+ +## Simple by default, powerful on request + +Most people want help with a letter, a photo or a question, not a lesson in GGUF and quantization. Others want to tune every part. Both should feel at home. + +
+ +
+ +Nothing comes pre-installed. The first run is a recommendation and one click, and Llama Chat opens on a conversation, not on settings. + +
+ +
+ +Where exactly the line between the two sits is still open. + +## Shared + +Everything can stay on one device, fully local. It can also be shared, at home, at work or beyond. Your phone can pick up the conversations you started on your laptop1; a home server can run bigger models for the whole family; an office can run one server for everyone who works there. + +And compute can be shared with other people. Those who have the hardware can open it to those who don't, so they can use capable models too. + +
+ +
+ +

1 Planned. Picking up a conversation on another device needs sessions that persist on the server, and a way to reach them from an app that only connects to it.

+ +## Three layers + +Between a person and the AI are three layers, and they are different kinds of thing. + +- **Model:** the weights. They are research output, closer to science than to a product: on their own they have no user and no interface, and everything else is built on them. That is why they stay open; closing them would hold back everything built on top. +- **Inference:** the engine and the server that run the model. Elsewhere this layer is a provider's API, with its terms and its monitoring. In the Llama stack it is llama-server on your own hardware, or on a server someone you trust shares, so you are the provider. +- **Application:** where AI meets people and their work. This is where what the AI does has real effects, so this is where most of the responsibility lies. + +It is the difference between steel and a car, as [Clément Delangue put it](https://x.com/ClementDelangue/status/2084992457674990033): you test the car on the road, not the steel at the mill. + +So the application is the layer that most needs to be built in the open: its code public, its behaviour tested and judged by the people who use it, and anyone free to change it. That is why Llama Chat and Llama UI are open source. + +The **harness**, the agentic loop and the tools it can call, bridges the application and inference: the loop runs in the app, as its own package, Llama Harness, and its tools run in the app or in llama-server. + +
+ +
+ +## Voice + +We say what the product does, with real numbers, and show the real product. No hype, no fear, no superlatives. + +
+ +
+ +## In practice + +- **Product:** choices made in advance for people starting out, and every setting for those who want it. It always shows which model runs on which server, needs no account and works offline. +- **Design:** neutral, so the conversation stands out, and open, so anyone can restyle it. +- **Communications:** the real app, real figures and the same plain voice. + +
+ +
+ +

Set in Llama Sans and Llama Mono. The three layers follow Clément Delangue’s comparison of model weights to steel.

diff --git a/ui/apps/chat/tests/stories/philosophy/Product.stories.svelte b/ui/apps/chat/tests/stories/philosophy/Product.stories.svelte new file mode 100644 index 000000000000..2796878ccaf8 --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/Product.stories.svelte @@ -0,0 +1,20 @@ + + + + + + + diff --git a/ui/apps/chat/tests/stories/philosophy/Product.svx b/ui/apps/chat/tests/stories/philosophy/Product.svx new file mode 100644 index 000000000000..961d667105e9 --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/Product.svx @@ -0,0 +1,69 @@ + + + + +

Philosophy · How it fits together

+ +# Product + +

One design system, several apps. Llama UI draws the interface and handles interaction; each app owns its state and talks to llama-server.

+ +## The Llama stack + +- **llama.cpp** runs models locally; **llama-server** is its HTTP server. +- **Llama UI** is the component library this Storybook documents. +- **Llama Chat** is the chat client built from it. It replaces the legacy web UI and ships inside llama-server. +- **Llama for Mac** and **Llama for Windows** run llama-server from the menu bar or the system tray and open Llama Chat. On a Mac it opens in a new tab of the default browser, and gets a window of its own when added to the Dock as a Safari web app. +- **llama-brand** is the one source of the icon, the fonts and the colours. + +
+ +
+ +## One library, many apps + +Llama UI holds UI and UX only, no business logic. Llama Chat is the first app built on it, and the llama.app website uses it too, so models look and behave the same in both. Keeping the library separate lets anyone build their own app on it. + +## Llama UI draws, the apps decide + +Components take data in and report what the user did. State and calls to the server belong to the app. + +
+ +
+ +*Architecture › Stack* draws the whole stack and the repo layout; *Architecture › Chat* shows where each part of Llama Chat lands. + +## Across the three layers + +- **Application:** Llama Chat, Llama for Mac and Windows, or your own app. Ours never assume a cloud account and always show which model runs, and where. Llama UI is a library for building apps, not a layer: an app can use the layers below without it. +- **Harness**, across the line between the application and inference: the agentic loop and the tools it calls. The loop and browser tools run in the app, server tools run in llama-server, and MCP servers you add can be reached from either. The loop is a package of its own, Llama Harness (`@ggml-org/llama-harness`), so any app can run it or bring its own. +- **Inference:** llama-server, libllama and ggml, on your hardware. llama-server is run by hand, started by a native app or shared by someone else. +- **Model:** a GGUF file from Hugging Face, which the apps help find, download and keep. + +
+ +
+ +## Simple first, depth on request + +Nothing comes pre-installed. On the first run, the Llama app suggests models that fit the device and recommends one: small enough for any device, and able to read, see and hear. One click downloads it and runs llama-server, with no terminal. Llama Chat opens on a conversation, not on settings. For power users, every model and server setting is there behind a disclosure, with a short explanation where a term needs one, and the model manager and Discover can be turned on in Llama Chat. + +## One build, three channels + +Llama Chat is a static app (HTML, JavaScript and CSS), built once per release. Today it ships inside llama-server. Planned: `npx llama-chat` and chat.llama.app, which carry the client only and connect to a server you add. + +
+ +
+ +The app will tell where it runs at runtime, with no build flags: if its own origin answers as llama.cpp, it runs bundled; otherwise it asks for a server. *Architecture › Channels* compares the three, with the `npx` command and the release flow. diff --git a/ui/apps/chat/tests/stories/philosophy/figures/ArtColours.svelte b/ui/apps/chat/tests/stories/philosophy/figures/ArtColours.svelte new file mode 100644 index 000000000000..1121dbb8674e --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/ArtColours.svelte @@ -0,0 +1,68 @@ + + + +
+ {#each grounds as ground (ground.name)} +
+ {ground.name} + + {ground.note} + + {ground.token} +
+ {/each} +
+ + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Assets.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Assets.svelte new file mode 100644 index 000000000000..4e4e55f159e7 --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Assets.svelte @@ -0,0 +1,183 @@ + + + +
+
+
+ The Llama icon +
+ +
+ Aa +
+ +

Sources: the icon, Llama Sans and Llama Mono

+
+ + + +
+
+
+ llama.cpp lockup +
+ +
Lockup
+
+ +
+
+ macOS app icon + + Windows app icon + + Web app icon +
+ +
App icons: macOS, Windows, web
+
+ +
+
+ Llama avatar +
+ +
Profile picture
+
+ +
+
+ X header with the Llama lockup +
+ +
X header, 1500 × 500, dark
+
+
+
+ + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Channels.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Channels.svelte new file mode 100644 index 000000000000..df1645241ef8 --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Channels.svelte @@ -0,0 +1,109 @@ + + + +
+ {#each channels as c (c.name)} +
+
+

{c.name}

+ + {c.status} +
+ +
+
Served by
+ +
{c.served}
+ +
Server
+ +
{c.server}
+ +
Best for
+ +
{c.best}
+
+
+ {/each} +
+ + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Decided.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Decided.svelte new file mode 100644 index 000000000000..eb374b28258d --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Decided.svelte @@ -0,0 +1,153 @@ + + + +
+
+
+ + +

What does this letter from the council want me to do?

+
+ +

+ It's a reminder that your parking permit ends on 30 November. To renew it, fill in the form on + the back and… +

+
+ +
+
+

Decided for you

+ +

Yours to change

+
+ +
    + {#each decisions as [plain, exact] (plain)} +
  • + {plain} + + {exact} +
  • + {/each} +
+
+
+ + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Depth.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Depth.svelte new file mode 100644 index 000000000000..387056785770 --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Depth.svelte @@ -0,0 +1,126 @@ + + + +
+
+
+ +
+ +
Raised Something to press
+
+ +
+
+ +
+ +
Recessed Somewhere to type
+
+ +
+
+
+ Qwen3.8 27B + + Q4_K_M · 16.8 GB +
+
+ +
Lifted One thing to read
+
+ +
+
+ +
+ +
Floating Above the page, for now
+
+
+ + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Goblet.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Goblet.svelte new file mode 100644 index 000000000000..d8d70febbe55 --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Goblet.svelte @@ -0,0 +1,50 @@ + + + +
+
+ + + +
+ + +
+ + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Grotesque.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Grotesque.svelte new file mode 100644 index 000000000000..d27c4fd9e9fc --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Grotesque.svelte @@ -0,0 +1,164 @@ + + + +
+
    + {#each line as l (l.name)} +
  1. + {l.year} + + {l.name} + + {l.note} +
  2. + {/each} +
+ +
+ {#each letters as l (l.glyph)} +
+ {l.glyph} + + {l.note} +
+ {/each} +
+ +
+ {#each cells as c (c)} + + {#each [...c] as ch, i (i)}{ch}{/each} + + {/each} + + Llama Mono: one cell a character, so l, 1, I and | stay apart and columns line up +
+
+ + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/IconSizes.svelte b/ui/apps/chat/tests/stories/philosophy/figures/IconSizes.svelte new file mode 100644 index 000000000000..fdee512ca557 --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/IconSizes.svelte @@ -0,0 +1,74 @@ + + + +
+
+ {#each sizes as size (size)} +
+ + + {size} +
+ {/each} +
+ +
+

Download Llama for your Mac.

+ + +
+
+ + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Layers.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Layers.svelte new file mode 100644 index 000000000000..aa8e0e200801 --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Layers.svelte @@ -0,0 +1,116 @@ + + + +
    + {#each layers as layer, i (layer.name)} +
  1. + {layers.length - i} + +

    {layer.name}

    + +

    {layer.what}

    + +

    {layer.here}

    + +

    {layer.yours}

    +
  2. + {/each} +
+ + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Machine.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Machine.svelte new file mode 100644 index 000000000000..d0b146092e3c --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Machine.svelte @@ -0,0 +1,164 @@ + + + +
+
+ Your computer + +
+
Llama ChatYour conversations, saved here
+ +
    + {#each chats as chat (chat)}
  • {chat}
  • {/each} +
+
+ +
+
llama-serverRuns the model, here
+ +

localhost:9931

+
+ +
+
The modelThe file you chose, unchanged
+ +

model.Q4_K_M.gguf4.6 GB

+
+
+ +
+ ← + +

Hugging FaceWhere the model came from, once

+
+
+ + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Measure.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Measure.svelte new file mode 100644 index 000000000000..b02567a77497 --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Measure.svelte @@ -0,0 +1,104 @@ + + + +
+
+
+ +
+
+ +
+ {#each specs as s (s.role)} +
+
{s.value}px
+ +
{s.what} {s.role}
+
+ {/each} +
+
+ + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Names.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Names.svelte new file mode 100644 index 000000000000..b2e991356b4b --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Names.svelte @@ -0,0 +1,86 @@ + + + +
+
+ Llama + + Llama Sans Bold · on colour +
+ +
+ llama.cpp + + Llama Mono Bold · on light +
+ +
+ llama.cpp + + Llama Mono Bold · on dark +
+
+ + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Neutral.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Neutral.svelte new file mode 100644 index 000000000000..40922dac6270 --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Neutral.svelte @@ -0,0 +1,127 @@ + + + +
+
+ {#each groups as g (g.label)} + {#each g.colours as c (c)}{/each} + {/each} +
+ +
+ {#each groups as g (g.label)} +
+
+ + {#each g.colours as c (c)}{/each} + + {g.label} +
+ +
{g.note}
+
+ {/each} +
+ +
+ Ready + + Loading + + Stopped + + Update available + + Q4_K_M + + 128k context +
+
+ + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Posts.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Posts.svelte new file mode 100644 index 000000000000..7f201f8c061c --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Posts.svelte @@ -0,0 +1,49 @@ + + + +
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+ + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Quantized.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Quantized.svelte new file mode 100644 index 000000000000..54963a58d007 --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Quantized.svelte @@ -0,0 +1,65 @@ + + + +
+
+ + {@html quantized('light', 'philosophy-quantized')} + +
+ +
+ +
+
+ + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Reach.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Reach.svelte new file mode 100644 index 000000000000..eb66ea756bb6 --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Reach.svelte @@ -0,0 +1,86 @@ + + + +
+ {#each machines as m, i (m.name)} +
+

{m.name}

+ +

{m.memory} GB of memory

+ + + +

{m.fits}

+
+ {/each} +
+ + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Restyle.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Restyle.svelte new file mode 100644 index 000000000000..40b4c8632211 --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Restyle.svelte @@ -0,0 +1,282 @@ + + + +
+ {#each looks as { label, look } (label)} +
+
+ {label} + + Q4_K_M +
+ +
+ + + +
+ +
+ + + +
+
+ {/each} +
+ + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Rule.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Rule.svelte new file mode 100644 index 000000000000..3fb3eae1da6e --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Rule.svelte @@ -0,0 +1,94 @@ + + + +
+ {#each sides as side, i (side.name)} +
+

{side.name}

+ +

{side.note}

+ +
    + {#each side.items as item (item)}
  • {item}
  • {/each} +
+
+ {/each} +
+ + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Sharing.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Sharing.svelte new file mode 100644 index 000000000000..b9e2ec48c7f4 --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Sharing.svelte @@ -0,0 +1,327 @@ + + + + + + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Shows.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Shows.svelte new file mode 100644 index 000000000000..30c20644464a --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Shows.svelte @@ -0,0 +1,126 @@ + + + +
+
+ In the product + +
+

Your model Q4_K_M

+ +

On this computer · localhost:9931

+
+ +

Which model, on which server, always in view

+
+ +
+ In the design + +
+ {#each greys as g (g)}{/each} +
+ +

Neutral greys, and one accent

+
+ +
+ In communications + + + +

The real app, in a calm voice

+
+
+ + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/StackLayers.svelte b/ui/apps/chat/tests/stories/philosophy/figures/StackLayers.svelte new file mode 100644 index 000000000000..92a1b76a4e7f --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/StackLayers.svelte @@ -0,0 +1,288 @@ + + + +{#snippet tile(part: Part, area = '')} +
  • + {part.name} + + {part.note} +
  • +{/snippet} + +{#snippet list(parts: Part[])} +
      + {#each parts as part (part.name)}{@render tile(part)}{/each} +
    +{/snippet} + +
    + {#each layers as layer, i (layer.name)} +
    +
    + 0{layers.length - i} + +

    {layer.name}

    + + {layer.who} +
    + + {@render list(layer.parts)} +
    + + {#if i === 0} +
    +

    + Harness The agentic loop and the tools it calls, across the app and the server +

    + +
      +
    • In the app
    • + + {@render tile(loop, 'loop')} + + {@render tile(browser, 'browser')} + + {@render tile(mcp, 'mcp')} + +
    • In llama-server
    • + + {@render tile(server, 'server')} +
    +
    + {:else if i < layers.length - 1} + + {/if} + {/each} +
    + + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Storyboard.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Storyboard.svelte new file mode 100644 index 000000000000..bf68d53a0220 --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Storyboard.svelte @@ -0,0 +1,168 @@ + + + +
      +
    1. +

      1 · First launch

      + +
      + +
      + +

      + Nothing is installed. The menu suggests models that fit this Mac, and recommends one. +

      +
    2. + +
    3. +

      2 · One click

      + +
      + +
      + +

      + The recommended model downloads from Hugging Face, and the server starts on its own. +

      +
    4. + +
    5. +

      3 · First chat

      + +
      +
      + + + +
      +
      + +

      Open chat, and Llama Chat starts on a conversation, not on settings.

      +
    6. + +
    7. +

      4 · When you ask

      + +
      +
      + +
      +
      + +

      + Sampling, penalties and every other setting, there in Settings for whoever wants them. +

      +
    8. +
    + + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Tokens.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Tokens.svelte new file mode 100644 index 000000000000..26c005efd825 --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Tokens.svelte @@ -0,0 +1,100 @@ + + + +
      + {#each tiers as t (t.tier)} +
    1. + {t.tier} + + + + {t.name} + + {t.note} +
    2. + {/each} + +
    3. + On screen + +
      + + <Button> + + the real component +
    4. +
    + + diff --git a/ui/apps/chat/tests/stories/philosophy/figures/Voice.svelte b/ui/apps/chat/tests/stories/philosophy/figures/Voice.svelte new file mode 100644 index 000000000000..4055545a00d6 --- /dev/null +++ b/ui/apps/chat/tests/stories/philosophy/figures/Voice.svelte @@ -0,0 +1,65 @@ + + + +
    +

    We say

    + +

    We don’t

    + + {#each pairs as [say, not] (say)} +

    {say}

    + +

    {not}

    + {/each} +
    + + diff --git a/ui/lib/ui/tests/stories/introduction/Introduction.svx b/ui/lib/ui/tests/stories/introduction/Introduction.svx index aae0bf52dc48..7563b02064cf 100644 --- a/ui/lib/ui/tests/stories/introduction/Introduction.svx +++ b/ui/lib/ui/tests/stories/introduction/Introduction.svx @@ -11,7 +11,7 @@ ## Where it comes from -The package lives in llama.cpp, in `ui/lib/ui`, and Llama Chat, in `ui/apps/chat`, is built on it: its tokens, fonts and base components come from here. The stories of everything the package holds live here, next to it, and run as its tests. Llama Chat's Storybook shows the same stories under **Llama UI**, next to Llama Chat's own; the **Brand** and the **Communications** have their own Storybook, in llama-brand. +The package lives in llama.cpp, in `ui/lib/ui`, and Llama Chat, in `ui/apps/chat`, is built on it: its tokens, fonts and base components come from here. The stories of everything the package holds live here, next to it, and run as its tests. Llama Chat's Storybook shows the same stories under **Llama UI**, next to Llama Chat's own, its **Philosophy** and its **Architecture**; the **Brand** and the **Communications** have their own Storybook, in llama-brand. The tokens, the fonts and the base components are changed here, and Llama Chat takes them as they are. What both still keep a copy of, the Model UI among them, flows one way for now, from `ui/apps/chat` to here.