ui-demo
Skill137k starsChanged 3 months agoMITView on GitHub
Demo, test and document a change in Llama Chat (ui/apps/chat) or Llama UI (ui/lib/ui) with the Playwright demo harness - record a video for the PR, turn the same flow into an e2e check, and capture docs videos and screenshots. Use when a UI change needs a demo video, a Playwright check, or docs media.
- Reads credentials
11 other projects use a version of this.
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Most recently taken up by
- KevinLoichot/everything-claude-codetheir own version, first seen Nov 29, 2026
- satvikgbusiness-jpg/Claude-skillstheir own version, first seen Nov 29, 2026
- vercel/boardtheir own version, first seen Nov 22, 2026
- pankaj-mahaur/Agent-Daemontheir own version, first seen Nov 16, 2026
- Rojios/everything-claude-codetheir own version, first seen Nov 8, 2026
- renepf/claude-skillstheir own version, first seen Oct 25, 2026
Who's talking about ggml-org/llama.cpp
- Code Unpacked“llama.cpp 1.0 Is Here — Can It Finally Catch Strata?”YouTube · Nov 14, 2026 · 42k views
- SimplyExplain“llama.cpp Just Made Your GPU 2x Faster on Big Models (Turn This On)”YouTube · Nov 8, 2026 · 41k views
- pookie“How to Run Local LLMs with Llama.cpp: Complete Guide”YouTube · Sep 7, 2025 · 37k views
- Bijan Bowen“Llama.cpp OFFICIAL WebUI - First Look & Windows 11 Install Guide!”YouTube · Nov 6, 2025 · 34k views
- Tonbi's AI Garage“The Best Way to Take Control of Your Local AI Model (llama.cpp)”YouTube · Jun 3, 2026 · 25k views
The biggest 5 of 93 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 93
Talked about on Hacker News, YouTube, GitHub, Bluesky, the web and Stack Overflow (93 times).
On Hacker News · 22
- Feb 20, 2026Ggml.ai joins Hugging Face to ensure the long-term progress of Local AI839 points · 223 comments
- May 10, 2025Vision Now Available in Llama.cpp550 points · 104 comments
- Aug 11, 2025Mistral Integration Improved in Llama.cpp95 points · 15 comments
- Aug 5, 2025Llama.cpp: Add GPT-OSS35 points
- Jul 9, 2026LLama.cpp Got Screwd11 points · 5 comments
17 more on Hacker News
- Feb 5, 2026Yet another reminder why you should not use Ollama6 points · 5 comments
- Sep 15, 2025Llama.cpp: Deterministic Inference Mode (CUDA): RMSNorm, MatMul, Attention6 points
- Nov 13, 2026llama.cpp v1.05 points · 1 comment
- Aug 25, 2026Release v0.2.0 · ggml-org/llama.cpp4 points
- Mar 25, 2026Llama.cpp's Agents.md4 points · 1 comment
- Nov 4, 2025Llama.cpp launches official WebUI for local LLMs4 points
- Aug 26, 2026Gguf: Harden loader against malformed tensor dims and metadata types3 points
- Jun 30, 2026TurboPrefill: 2.7× faster than llama.cpp Pipeline Parallel on Llama-3-70B3 points
- May 10, 2026Grinder12: 0.96-Bit Lossless Streaming KV-Cache (16.55x VRAM Savings3 points
- Jul 28, 2025AMD teams contributing to the llama.cpp codebase3 points
- May 17, 2026Llama.cpp b9180: MTP support landed2 points
- Oct 14, 2025Guide: Setting up Nvidia DGX Spark with ggml2 points
- Sep 2, 2025A better Llama-CLI help doc2 points · 1 comment
- Aug 21, 2025Guide: Running GPT-OSS with Llama.cpp2 points
- Jul 8, 2025Hunyuan-A13B model support has been merged into llama.cpp2 points
- May 7, 2026Llama and Spec: MTP Support1 point
- Feb 4, 2026Show HN: Notebook page on llama.cpp official webui1 point
On YouTube · 21
- Nov 14, 2026llama.cpp 1.0 Is Here — Can It Finally Catch Strata? — Code Unpacked42k views · 46 comments
- Nov 8, 2026llama.cpp Just Made Your GPU 2x Faster on Big Models (Turn This On) — SimplyExplainsays it tested it41k views · 53 comments
- Sep 7, 2025How to Run Local LLMs with Llama.cpp: Complete Guide — pookie37k views · 51 comments
- Nov 6, 2025Llama.cpp OFFICIAL WebUI - First Look & Windows 11 Install Guide! — Bijan Bowen34k views · 73 comments
- Jun 3, 2026The Best Way to Take Control of Your Local AI Model (llama.cpp) — Tonbi's AI Garage25k views · 70 comments
16 more on YouTube
- Nov 22, 2026llama.cpp 1.0 Is Out Can It Finally Catch Strata? — Kai24k views · 56 comments
- Oct 21, 2026llama.cpp Just Made Huge MoE Models 4× Faster — Code Unpacked19k views · 30 comments
- Nov 6, 2026This llama.cpp Fork Just Made Qwen 3.3× Faster — Code Unpacked18k views · 15 comments
- Nov 16, 2026llama.cpp 1.0 Is Finally Out... And It Just Got Twice as Fast — NetworkCoder13k views · 18 comments
- Nov 18, 2026NVIDIA Just Made llama.cpp 41% Faster at Long Context (Free Update) — SimplyExplainsays it tested it13k views · 14 comments
- Oct 25, 2026Can Your PC Run DeepSeek V4.1 Flash? (llama.cpp Just Added It) — Lem.2.7k views · 2 comments
- Oct 24, 2026This llama.cpp Knowledge Feels Illegal — Cloudmash1.8k views · 3 comments
- Sep 12, 2026llama.cpp: Run Local LLMs from Scratch — Complete Tutorial — CLI Stack1.6k views
- Nov 22, 2026I Turned On One llama.cpp 1.0 Flag and Got 4.6x Faster Local AI — Cian Magsays it tested it186 views · 2 comments
- Nov 20, 2026Run Qwen Code Locally With llama.cpp #Shorts — ymdev174 views
- Nov 12, 2026NVIDIA Dory 4B on a Mac: llama.cpp vs MLX Tested — Amplify Imaginationsays it tested it163 views
- Nov 2, 2026Build llama.cpp for Your GPU: 2 Commands, Then 1 Flag — Nyndra AI73 views
- Nov 13, 2026llama.cpp v1.0: 3 Upgrades & 3 Migration Traps — CrazyAIProductions21 views
- Nov 23, 2026llama.cpp b12638: Control Tokens vs Literal Output — Tech for Everyday17 views
- Nov 20, 2026llama.cpp 1.0: Free Local ChatGPT on Your Mac #Shorts — Mindloop Experience13 views
- Nov 22, 2026llama.cpp 1.0 Upgrade Tested: One Line Broke, 3 of 20 Outputs Changed — Vikawork AIsays it tested it2 views
On GitHub · 19
- Aug 8, 2025Offer official Pytorch Vulkan backend on pytorch.org — pytorch/pytorch184 reactions · 135 comments
- Apr 14, 2025GLM-4-0414 series, 9B & 32B — ollama/ollama48 reactions · 14 comments
- Feb 28, 2025support for rerank model — lmstudio-ai/lmstudio-bug-tracker44 reactions · 20 comments
- Aug 5, 2025llama.cpp : add --n-cpu-moe option — lmstudio-ai/lmstudio-bug-tracker30 reactions · 5 comments
- Aug 9, 2025update vendored llama.cpp and ggml — ollama/ollama21 reactions · 3 comments
14 more on GitHub
- Aug 9, 2025Vulkan based on #9650 — ollama/ollama19 reactions · 47 comments
- Mar 6, 2026Autoparser - complete refactoring of parser architecture — ikawrakow/ik_llama.cpp14 reactions · 39 comments
- Mar 23, 2025Add imatrix support — leejet/stable-diffusion.cpp11 reactions · 31 comments
- Aug 10, 2025Add GPT-OSS from OpenAI - closed in favor of 689 — ikawrakow/ik_llama.cpp10 reactions · 46 comments
- Jan 12, 2026Merge ffn_up and ffn_gate experts tensors — ikawrakow/ik_llama.cpp9 reactions · 4 comments
- Jul 16, 2025Adding IQ1_KT - 1.75 bpw SOTA quants — ikawrakow/ik_llama.cpp9 reactions · 33 comments
- Apr 29, 2025Support Qwen3 (str.startswith() and [::-1]) — google/minja8 reactions · 3 comments
- Feb 10, 2026spec : add self speculative decoding, ngram and refactor — ikawrakow/ik_llama.cpp7 reactions · 18 comments
- Dec 29, 2025Implement Adaptive-P Sampler — ikawrakow/ik_llama.cpp7 reactions · 19 comments
- Jun 25, 2025Granite four (llama.cpp bump 443e7e7+) — ollama/ollama7 reactions · 22 comments
- May 26, 2026Studio: optimize chat streaming by batching renders to one per animation frame — unslothai/unsloth6 reactions · 2 comments
- Nov 22, 2025Fix kimi-k2 tool call — ikawrakow/ik_llama.cpp6 reactions · 16 comments
- Nov 25, 2026MoE cache tuner — ikawrakow/ik_llama.cpp5 reactions
- Jun 22, 2026Implement llama-server /models/sse loading% indicator — huggingface/pi-llama5 reactions · 2 comments
On Bluesky · 17
- Apr 24, 2026There's also llama-cpp that is supposed to be a bit better. But tldr is even with the 31b gemma4 model most of Claude's stuff blows it out… — @pds.dad3 likes and reposts · 1 reply
- Jun 6, 2025I regularly forget how powerful locally running LLMs are. Today's example, want to configure your awesome WezTerm but can't bring yourself… — @rajatarya.com3 likes and reposts
- Feb 22, 2026Run LLMs locally with blazing speed - pure C++ inference engine that turns your laptop into an AI powerhouse, no Python dependencies or GPU… — @arifsolmaz.bsky.social2 likes and reposts · 1 reply
- Aug 15, 2025Gemma 3 270M: developers.googleblog.com/en/introduci... Hugging Face: huggingface.co/google/gemma... Ollama: ollama.com/library/gemm...… — @iballantyne.bsky.social2 likes and reposts
- Jul 7, 2025@nele Ich habe ein solches Setting für mein lokales Netz (auch im Garten und via Smartphone verfügbar). Statt Ollama setze ich auf lama.cpp… — @fusion.mastodon.social.ap.brid.gy2 likes and reposts
12 more on Bluesky
- Nov 12, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 ggml-org / llama.cpp ⭐ 134,248 (+162) 🗒 C++ LLM inference in C/C++ — @github-trending.bsky.social1 likes and repost
- Nov 10, 2026llama.cpp - what is it? A plain C/C++ inference engine for GGUF models: broad hardware support (Metal, CUDA, HIP, Vulkan, SYCL, CPU), 1.5-8… — @privatelocalai.bsky.social1 likes and repost
- Nov 1, 2026Crew's first job is four questions: what do I actually need, what do I actually want, what actually helps, and what am I trying to… — @cowninja.bsky.social1 likes and repost
- Sep 7, 2026So many of these "run models locally" apps are just repackaging/forking some bare bones tools/libs like github.com/ggml-org/lla... or mlx… — @fry69.dev1 likes and repost · 1 reply
- Sep 4, 2026#LLM perf. w/ mentioned key utils: 🔹 #LlamaThroughputLab (sweep script) github.com/alexziskind1/llama-throughput-lab 🔹 #LlamaCPP… — @thinkronicity.bsky.social1 likes and repost
- May 6, 2026𝙁ü𝙧 𝙖𝙗𝙨𝙤𝙡𝙪𝙩𝙚 𝘿𝙖𝙩𝙚𝙣𝙝𝙤𝙝𝙚𝙞𝙩-𝙉𝙚𝙧𝙙𝙨 (thread) Wie man ein lokales Moodle mit lokalen KI-Modellen erweitert. Neben z. B.… — @fusion.mastodon.social.ap.brid.gy1 likes and repost · 1 reply
- Apr 20, 2026https://github.com/ggml-org/llama.cpp — @tom-doerr.bsky.social1 likes and repost
- Apr 9, 2026ローカルLLM環境の定番「llama.cpp」が、Hugging Faceのキャッシュディレクトリと統合されましたね。 これでllama-cliでモデルを読み込む際、既存のHFツールとキャッシュを共有できるのは地味にデカい。ディスク容量の節約にも繋がる。… — @woody-ai-tools.bsky.social1 likes and repost
- Oct 19, 2025https://github.com/ggml-org/llama.cpp bmann (/bmann) starred ggml-org/llama.cpp (/ggml-org/llama.cpp) · October 19, 2025 10:51… — @bmannconsulting.com1 likes and repost
- May 11, 2025今日のGitHubトレンド ggml-org/llama.cpp llama.cppは、MetaのLLaMAを含むLLMの推論を、純粋なC/C++により多様なハードウェア上で最小限の設定と最先端の性能で実現することを目指しています。… — @dailygithubtrends.bsky.social1 likes and repost
- Apr 19, 2026hey kid *beckons from dark alley* https://github.com/ggml-org/llama.cpp — @barredspirals.comint.su0 likes and reposts · 1 reply
- Apr 7, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 ggml-org / llama.cpp ⭐ 101,752 (+244) 🗒 C++ LLM inference in C/C++ — @github-trending.bsky.social0 likes and reposts · 1 reply
On the web · 12
- Nov 14, 2026llama.cpp: What It Is, How to Install, First Command — promptquorum.com
- Nov 13, 2026llama.cpp 1.0 Upgrade: Breaking Changes, Tested | ComputingForGeeks — computingforgeeks.com
- Nov 13, 2026llama.cpp and ggml ship v1.0.0 — semantic versioning comes to the local AI stack — dev.to
- Nov 13, 2026llama.cpp v1.0.0 : A stronger foundation for the local AI ecosystem — huggingface.co
- Nov 10, 2026Llama.cpp – What is it? — dev.to
7 more on the web
- Oct 22, 2026llama.cpp – Enterpriseでも使える? 基礎から同時アクセス制御まで徹底解説 — zenn.dev
- Oct 20, 2026Llama cpp vs ollama on the same machine setup speed control — nandanpriyadarshi.medium.com
- Sep 12, 2026llama.cpp: The C/C++ Inference Engine That Powers Local AI Everywhere — university-365.com
- Aug 9, 2026llama.cpp Startup Options, August 2026 Latest Summary: Why 'Writing Less' Makes It Run Faster for Beginners|zephel01 — note.com
- Apr 6, 2026The Complete Guide to Running Local LLMs at Blazing Speed, for Free, and Without Limits Using llama.cpp. [Update] Can llama.cpp be rewritten in a lightweight language? I also looked into attn-rot.|ゆいまる‐IT界隈以外でAIを使いまくる2005年生まれ — note.com
- Mar 4, 2026Local LLM Inference on Windows 11 and AMD GPU using WSL and llama.cpp — dev.to
- Oct 19, 2025A first Experience with LLaMA.CPP — dev.to
On Stack Overflow · 2
- Jun 22, 2026Can a local LLM become useful for Odoo development?0 votes
- Mar 27, 2025Ollama model quality is worse than similar huggingface model0 votes
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- vercel/board★ 332same name
- Fmarzochi/EGC★ 61same name
- gongyijie85/dsh-ecc★ 8same name
- KevinLoichot/everything-claude-code★ 1same name
- Rojios/everything-claude-code★ 1same name
- SamuelNDCE/claude-super-skill-library★ 1same name
- davidanthonyn/claude-skills★ 0same name
- gesh75/claude-skills★ 0same name
- pankaj-mahaur/Agent-Daemon★ 0same name
- renepf/claude-skills★ 0same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-new-modelSkill
- code-reviewSkill
- slice-modelSkill
- update-fusion-tableSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Use it when a change in ui/apps/chat or ui/lib/ui is visible: a new or changed screen, flow or component.
- Distinctive: line 79
Check that each caption is readable and on screen long enough, that every zoom lands on its detail, and that nothing is cut off at the …
- Very specific: line 130
Docs videos: put the script in the storage target as scripts/docs/<name>.demo.ts (import '../helpers.ts'), then npm run demo:docs records …
- Very specific: line 229
Selectors: use roles and accessible names.
- Distinctive: line 231
Preview size: keep a demo short (under ~20 s per test): the GIF preview must stay under 5 MB, so a long one is shrunk until it is hard to …
“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Demo, test and document a UI change
One scripted flow serves three ends: a demo video in the PR, a Playwright check in tests/e2e, and docs media. The harness is ui/lib/demo/, and Llama Chat's fixtures for it are in ui/apps/chat/demo/ (read both README.md files once). Everything below runs from ui/apps/chat.
Use it when a change in ui/apps/chat or ui/lib/ui is visible: a new or changed screen, flow or component. Skip it for refactors with no visible effect.
AGENTS.md still applies: the contributor writes the PR description and owns the script. demo:pr only fills the managed ## Demo section.
Pick the target
| Change in | Record | How |
| Llama Chat flow or screen | the app, on vite dev | default |
Llama UI component (ui/lib/ui) | its Storybook story | test.use({ story }) + DEMO_STORYBOOK=ui |
| Llama Chat component in isolation | Chat's Storybook story | test.use({ story }) + DEMO_STORYBOOK=chat |
A Storybook story is the harness page for a component: if none shows the state you need, add a story next to the others (tests/stories/ in that package) rather than a new page.
Setup (once)
cd ui/apps/chat && npm cinpx playwright install chromiumAlso ffmpeg, and npm ci in ui/lib/ui for Llama UI stories. demo:pr needs gh (edit rights on the PR) and, to link the video, an hf login plus DEMO_STORAGE and DEMO_STORAGE_PUBLIC_URL in ui/apps/chat/.env (see .env.example).
1. Demo
Write the script
Scripts get test and expect from helpers.ts. Drive the page with demo.* (visible cursor, human timing), assert with expect, set the scene with test.use:
demo.click,demo.hover,demo.type,demo.press,demo.scroll,demo.pause,demo.caption(text, ms)(a chip under the window),demo.zoom(target, scale, ms)(the camera moves onto a small detail and back),demo.zoomIn(target, scale)...demo.zoomOut()(the camera stays on it across the actions between).test.use({ settings: {...} })seeds UI settings,startPath: '/#/...'starts on a route.- Fixtures, so no real data or third-party server is needed:
- MCP servers: two fixture servers (Weather, Notes) are always configured; see
demo/fixtures/demo-config.ts. - Conversations:
traces: ['long-chat', 'agentic-debugging']imports built-in chats (demo/fixtures/traces.ts); other names come fromDEMO_TRACES_DATASET. - Models and replies:
mockServer: { models: ['org/Model-GGUF:Q4_K_M'], reply: 'Markdown **reply**' }answers llama-server's endpoints in the browser (demo/fixtures/llama-server.ts): the model list, props, load, tools and a streamed reply. Nothing reaches a server and no model loads. Use it for any demo that sends a message. - Stories:
story: 'ui-forms-switch--default', the id from the Storybook URL (?path=/story/<id>).
- MCP servers: two fixture servers (Weather, Notes) are always configured; see
Without mockServer the app talks to the llama-server at DEMO_SERVER_ORIGIN (default :9931, started from build/bin/llama-server when none runs). Sending a message there loads a model: do not do that on someone's running server without asking.
Shape the video
The video is rendered from the recording, not the raw screencast: the app in a window on a Llama brand ground, camera moves over the whole stage with motion blur, captions under the window, and on a touch viewport taps in place of the cursor (see "The render" in the harness README). Write for that:
- One thing per video. A PR that changes several things gets several short
test()s, not one long walk. - Captions are in the brand's voice: plain words, real numbers, no emoji, one line.
demo.caption(text, ms)holds the caption formsand the demo waits, so show it while the screen is still (before or after an action, not over one). A demo with no captions gets no caption row, and the window is larger. - Zooms are for a detail too small to read in the frame. The camera aims where the target is when the zoom starts and does not follow it, so zoom after the layout settles (wait with
expectfirst), and zoom out before an action that moves the target, such as sending a message. Zoom on desktop demos; a phone's UI already fills a portrait video, so leave phone demos unzoomed unless a detail is too small to read even there. - Phones:
test.use({ hasTouch: true, isMobile: true, viewport: { height: 844, width: 390 } })gives a 1080x1920 video with a phone's corners, and every click shows as a fingertip tap. - Dark mode:
test.use({ colorScheme: 'dark' })records the dark theme on the night sky. - Timing: the harness adds the render's time to the test's timeout after the demo, so a demo needs no long
test.setTimeout.
DEMO_POLISH_LOGO=end adds a Llama logo card, for a video that goes out on its own; DEMO_POLISH=0 gives the plain screencast.
Try it locally
Save it as demo/<name>.demo.ts (git-ignored), importing from ./helpers.ts, and run:
npm run demo:record -- demo/<name>Add DEMO_STORYBOOK=ui (or chat) when the script has a story. DEMO_POLISH=0 records faster while iterating (the render takes a few times the video's length). The mp4 lands in demo/videos/. Look at it before going further: a sheet of frames shows the whole flow, the camera moves and the captions at once, where one still frame misses most of it:
ffmpeg -loglevel error -i demo/videos/<name>.mp4 -vf "fps=2,scale=480:-1,tile=6x4" -frames:v 1 demo/videos/<name>-sheet.pngCheck that each caption is readable and on screen long enough, that every zoom lands on its detail, and that nothing is cut off at the window's edge.
npm run demo:codegen opens Playwright codegen on :5180 for a first draft of the selectors.
Put it in the PR
Paste the script into the PR description as a ts demo block, inside the last collapsible block of Additional information:
<details>
<summary>Demo script</summary>
```ts demo
test("demo", async ({ demo, page }) => {
// ...
});
```
</details>Push the branch first: demo:pr records the PR's head commit as GitHub has it. Then record it and write the ## Demo section (between <!-- demo:start --> and <!-- demo:end -->):
npm run demo:pr -- <number>It takes a few minutes, so run it in the background. The app's UI comes from the PR's head, in a temporary worktree, but the harness and fixtures come from your checkout: a PR that changes the harness itself is recorded with the harness you have checked out. Run it again after each push that changes what the videos show.
- Each
test()becomes its own video, shown in a table under its title. Give each test{ annotation: { type: 'description', description: '...' } }to get one video to a row with its description beside it, which reads better when the videos show different things (see the worked example). Group tests with their owntest.useintest.describe(() => { ... }). - In a PR block, the helpers import is replaced with
testandexpect, so reach fixtures throughtest.useoptions only. - A PR on a fork:
DEMO_GITHUB_REPO=<owner>/llama.cpp. A PR by someone else: read its diff and demo block, then pass--trust <sha>.
2. Test
Turn the same flow into a check in tests/e2e/<feature>.e2e.ts, which CI runs (npm run test:e2e) against the built app on :8181, with no llama-server:
@playwright/testinstead of the helpers:locator.click()/fill()fordemo.*, keep everyexpect, drop captions and pauses.mockLlamaServer(page, {...})beforepage.goto, since nothing serves the API.importTraces(page, file)andgenerateTrace(name)seed conversations, as in a demo.
npx playwright test tests/e2e/<feature>.e2e.tsLocally it uses the installed Chrome with its sandbox on; in CI, Playwright's Chromium.
For a component on its own, a play function on its story is the check instead (as in ui/apps/chat/tests/stories/app/PwaRefreshAlert.stories.svelte): both packages run their stories as vitest browser tests, npm run test:ui in ui/apps/chat and npm test in ui/lib/ui.
3. Document
- Docs videos: put the script in the storage target as
scripts/docs/<name>.demo.ts(import'../helpers.ts'), thennpm run demo:docsrecords every docs script and uploadsvideos/docs/<name>.{mp4,gif}.DEMO_STORAGE=file:///some/dirtries it without a bucket. - Screenshots: in any demo,
await page.screenshot({ path: 'demo/videos/<name>.png' })for the frame, orawait locator.screenshot({ path })for one component, rendered atDEMO_SCALE(2x by default). Paths are relative toui/apps/chat. - Component docs belong in the package's Storybook: a story per state, prose in a
.svxpage (seeui/apps/chat/AGENTS.md).
Worked example
A demo of chat search, then a reply from the mocked server, then a Llama UI story, in one PR block, each video with its description beside it in the ## Demo table (record with DEMO_STORYBOOK=ui npm run demo:pr -- <number>):
const describe = (description: string) => ({
annotation: { description, type: "description" },
});
test.describe(() => {
test.use({ traces: ["long-chat", "agentic-debugging"] });
test(
"Search finds a chat by its title",
describe(
"Typing a word from a chat's title lists it, and opening the result shows the conversation.",
),
async ({ demo, page }) => {
await demo.click(page.getByLabel("Expand navigation"));
await demo.click(page.getByRole("button", { name: /^Search/ }));
const search = page.getByRole("dialog", { name: "Search" });
await demo.type(
search.getByRole("combobox", { name: "Search" }),
"flaky",
);
const result = search.getByRole("option", {
name: /Fix the flaky cache tests/,
});
await expect(result).toBeVisible();
await demo.click(result, 1200);
await expect(page.getByRole("main")).toContainText(
"All 48 cache tests pass now",
);
},
);
});
test.describe(() => {
test.use({
mockServer: {
reply: "Rust is a systems language focused on **safety** and *speed*.",
},
});
test(
"A reply from a mocked server, no model loaded",
describe(
"The reply streams from mockServer, so the video looks the same on every machine.",
),
async ({ demo, page }) => {
await demo.type(
page.getByRole("textbox", { name: "Type a message..." }),
"What is Rust?",
);
await demo.press("Enter", 1500);
await expect(page.getByRole("main")).toContainText(
"focused on safety",
);
},
);
});
test.describe(() => {
// a small viewport frames a small component, recorded at the same scale
test.use({
story: "ui-forms-switch--default",
viewport: { height: 450, width: 720 },
});
test(
"A Llama UI story: Switch",
describe(
"The Switch from Llama UI, recorded from its Storybook story.",
),
async ({ demo, page }) => {
const off = page.getByRole("switch").first();
await demo.click(off, 900);
await expect(off).toBeChecked();
},
);
});The same search flow as a check is tests/e2e/search-chats.e2e.ts.
Pitfalls
- Ports: vite dev
:5180(DEMO_UI_PORT), fixture MCP:8765, llama-server:9931, Storybook:6007(DEMO_STORYBOOK_PORT), e2e:8181. Every server is reused when something already answers there, even another checkout's: stop stale servers, or pick other ports.demo:prpicks free ports itself. - Chrome sandbox: demos record in Playwright's bundled Chromium with the sandbox on (headless installed Chrome ignores the viewport in screencasts); local e2e runs in the installed Chrome with the sandbox on. Do not turn the sandbox off to make a run pass: a PR demo runs that PR's code.
- Waits: wait on state, never on time.
expect(locator).toBeVisible()/toContainText()before acting on something that appears late;demo.pauseis pacing for the viewer only. The first load of a cold dev server reloads the page once; the harness waits for it before recording, so do not add sleeps for it. - Selectors: use roles and accessible names. Some names match twice (
Expand navigationis both the logo and the button: usepage.getByLabel('Expand navigation')); scope to a dialog withpage.getByRole('dialog', { name }). A strict-mode error names both matches. - Real server: without
mockServer, the model list and any reply come from the real llama-server and differ per machine. Mock them for anything a viewer should see the same way twice. - Preview size: keep a demo short (under ~20 s per test): the GIF preview must stay under 5 MB, so a long one is shrunk until it is hard to read.
- Chromium only: the screencast and the render run on the Chrome DevTools Protocol, so a demo in Firefox or WebKit fails at its start. Show a Safari-only fix with a check in
tests/e2e, not a demo.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

