---
name: loom-demo-ui
description: Start and use the Loom Playground web UI (chat with streaming reasoning and tok/s, ASR with mic recording, TTS, image generation, embedding similarity) that proxies to one or more running loom-serve instances and discovers their models automatically. Use when the user wants a browser demo/UI for Loom models.
title: loom-demo-ui
canonical_url: https://skilld.dev/gh/loom-fun/loom-skills/loom-demo-ui
last_updated: 2026-11-14T11:30:31.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [start_ui.sh](https://skilld.dev/api/skills-raw/loom-fun/loom-skills/loom-demo-ui/start_ui.sh), [ui/index.html](https://skilld.dev/api/skills-raw/loom-fun/loom-skills/loom-demo-ui/ui/index.html), [ui/server.py](https://skilld.dev/api/skills-raw/loom-fun/loom-skills/loom-demo-ui/ui/server.py), [ui/short.mp3](https://skilld.dev/api/skills-raw/loom-fun/loom-skills/loom-demo-ui/ui/short.mp3).
>
> If the user asked to install this Skill, run `npx skilld install loom-fun/loom-skills/loom-demo-ui`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/loom-demo-ui`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/loom-fun/loom-skills/loom-demo-ui) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/loom-demo-ui`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/loom-demo-ui --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/loom-demo-ui --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Loom Playground UI

**Bundled paths ? first shell action.** Before running commands, set `LOOM_SKILL_DIR` in the shell to the
absolute directory containing **this** `SKILL.md`, using its path from the skill listing or read tool.
In Claude Code, run `export LOOM_SKILL_DIR="${CLAUDE_SKILL_DIR}"` (the host substitutes the path).
In Codex, Pi or another host, export `LOOM_SKILL_DIR` to the loaded file's directory. Use a
shell-compatible absolute path (Git Bash on Windows). Rebind before using another skill's commands
and in every new shell; it is not the working directory or SDK root. On Windows, use native `C:/...`
paths for file tools; `/c/...` paths belong to Git Bash. Never run an unresolved placeholder. Run bundled commands by quoted absolute path; do not run `scripts/...` from the working directory
or change into the installed skill tree. Install the complete Loom suite: sibling paths are required.

A small FastAPI proxy (`ui/server.py`) + one static page (`ui/index.html`). The page
polls each upstream's `/v1/status`, groups ready models by `loom.kind`, and wires
the tabs:

| Tab | Model kind | What it does |
|---|---|---|
| Chat | `text` | Dropdown of every text model. Streams the reply, shows reasoning first, then reports TTFT and decode tok/s. Image attach is allowed when the model lists `image` input. |
| Transcribe | `recognition` | Upload a file, record from the mic, or use the bundled `short.mp3`. The browser converts audio to 16 kHz mono PCM. |
| Speak | `speech` | Plays the result and reports real-time factor. |
| Image | `image` | 512² or 1024², with a seed. |
| Embed | `embedding` | One sentence per line; shows a cosine-similarity matrix. |

The first served model of each kind is used, and missing kinds show "(none)".

## Start

1. Start the model servers with `loom-setup` (`serve.sh`), for example a GPU server on
   :8100 with several models and an NPU server on :8101.
2. Start the UI. The tools venv needs fastapi, uvicorn and httpx:
   ```bash
   LOOM_UI_UPSTREAMS="gpu=http://127.0.0.1:8100,npu=http://127.0.0.1:8101" \
     bash "${LOOM_SKILL_DIR}/start_ui.sh" 8090 ~/loom/.tools
   ```
   It prints `UI: http://127.0.0.1:8090`. The log is `/tmp/loom-ui-8090.log`; to stop it,
   run `kill $(cat /tmp/loom-ui-8090.pid)`.
3. Open the page on the same machine. The microphone needs `localhost` or https.
   Remotely, use an SSH tunnel: `ssh -L 8090:127.0.0.1:8090 host`.

`LOOM_UI_UPSTREAMS` takes any number of `name=url` pairs, and the name becomes the
route `/api/<name>/…`. You can add models without touching the UI: restart the
upstream loom-serve with another `--model=`, and within 5 s the page picks it up from
`/v1/status`.

## Verify (headless)

```bash
curl -s localhost:8090/api/targets                       # ["gpu","npu"]
curl -s localhost:8090/api/gpu/v1/status | head -c 200
chromium --headless --no-sandbox --virtual-time-budget=8000 --dump-dom http://127.0.0.1:8090/ \
  | grep -o '<select id="chatmodel">.*</select>\|data-t="[a-z]*"[^<]*'   # dropdown + tab labels populated
```
Always pipe `--dump-dom` as shown. Snap chromium's stdout redirected straight to a
file gives 0 bytes, under `/tmp` and `$HOME` alike. If you need a file, use `… --dump-dom URL | cat > ~/dom.html`.

## Recommended demo set on Strix Halo

The GPU server shares a 50 GiB elastic budget (`--memory_bytes=53687091200
--parameter_idle_ms=60000`) across:
- Qwen3.8-27B vision (preset `vision`)
- moonshine-streaming-tiny
- pocket-tts
- Krea-2-Turbo `image-int8`
- optionally your own ported LLM package

The NPU server runs Qwen3-Embedding-0.6B (older wheel, `--pool_backing=fixed`).

Switching between big models takes a few seconds while weights reload.
