Files
llama.cpp/ui/apps/chat/package.json
T
Aleksander Grygier 97069ff6c4 ui: run Llama Chat with npx @ggml-org/llama-chat (#32524)
* ui: run Llama Chat with npx @ggml-org/llama-chat

Makes @ggml-org/llama-chat publishable: drops private, adds bin,
files, exports, repository and a prepack build. Its CLI serves the
prebuilt dist on localhost (3000 by default) and forwards every other
request to a llama-server (--server, default http://127.0.0.1:8080),
with the headers llama-server sends for the UI. A thin unscoped
llama-chat package in alias/ forwards to it, so npx llama-chat works.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: llama-chat revalidates service-worker.js and asks for a build before packing

SvelteKit 3 adds service-worker.js next to sw.js, and llama-server
revalidates it, so the CLI does too. The folder's .npmrc sets
ignore-scripts, so prepack never ran: it goes, and the publishing steps
build dist explicitly and check the packed file list.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: llama-chat keeps llama-server's DNS rebinding and cross-origin guards

The CLI called llama-server with its own Host and dropped every Origin,
so a rebound host name or another page got past the checks llama-server
makes when --cors-origins is not *. It now drops only its own page's
Origin, passes other Origins and Sec-Fetch-Site through, and, when it
listens on loopback, answers only to localhost and loopback addresses.
`start` on Windows gets its empty title verbatim.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: llama-chat build writes the app to a folder for any static server

`npx @ggml-org/llama-chat build [--out <dir>] [--force]` copies the
prebuilt app, without source maps, to ./llama-chat or the given folder,
so a plain file server can host it next to the CLI serving it. It
refuses a folder that is not empty unless forced, and the serving flags
and build flags refuse each other's command. The README shows serving
the folder with http-server forwarding the API to llama-server.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: publish Llama Chat to npm from CI when its version is bumped

ui-chat-publish.yml publishes @ggml-org/llama-chat and its llama-chat
alias the way ui-lib-publish.yml publishes @ggml-org/llama-ui: the
version is set by hand, and a commit that reaches master with a version
npm does not have builds dist, checks the packed files and publishes both
with trusted publishing. PRs that change the packages get a dry run.
npm-version-check.mjs takes the package folder, so both workflows share
it. ui/README.md says how releases work, and Chat's AGENTS.md says not
to bump versions unless asked to release.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: call the app Llama Chat in its README

The README's title and a few lines still called the app llama-ui or
Llama UI, the name of the library it is built on. They now say Llama
Chat, and the intro points to Llama UI in ui/lib/ui.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: llama-chat connects to llama-server's default port, 9931

The CLI's --server default and its examples used 8080, which is not
where llama-server listens. They now use 9931, its default port, so
npx llama-chat reaches a llama-server started without --port.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: a shorter Llama Chat README that matches the code

The README grew to nearly 900 lines, and its tables of components,
hooks, stores and services had drifted from the code. It now keeps what
a reader needs: running it with npx and self-hosting, a short feature
list, development commands, the architecture (the line between Llama UI
and the app, a table of the layers and where they live, a flowchart and
one sequence diagram for sending a message), a few patterns worth
knowing, cross-origin isolation, how the build is embedded in
llama-server, the project tree and publishing. The folders now carry the
detail the tables used to. ASCII replaces the unicode arrows.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: llama-chat serves only static files, without the API proxy

The CLI forwarded every request it had no file for to llama-server, from
loopback. With --host 0.0.0.0 that let any LAN client reach a llama-server
started on 127.0.0.1 as a local request, tools included, which llama-server
on its own refuses without an API key. The browser now talks to each
llama-server directly, so llama-server's own rules apply. --server is gone,
and anything that is not a file in dist is a 404, or a 405 for other methods.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-18 12:58:16 +01:00

175 lines
5.8 KiB
JSON

{
"name": "@ggml-org/llama-chat",
"version": "0.1.0",
"description": "Llama Chat, the chat app for llama.cpp. Run it with npx @ggml-org/llama-chat against any llama-server.",
"keywords": [
"llama.cpp",
"llama-server",
"llm",
"chat",
"local-ai"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/ggml-org/llama.cpp.git",
"directory": "ui/apps/chat"
},
"homepage": "https://github.com/ggml-org/llama.cpp/tree/master/ui/apps/chat#readme",
"bugs": "https://github.com/ggml-org/llama.cpp/issues",
"type": "module",
"bin": {
"llama-chat": "./bin/cli.js"
},
"exports": {
"./cli": "./bin/cli.js",
"./server": "./cli/server.js",
"./dist/*": "./dist/*",
"./package.json": "./package.json"
},
"files": [
"bin",
"cli",
"dist",
"!dist/**/*.map"
],
"engines": {
"node": ">=20"
},
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "npm run build-pwa-assets && vite build",
"build-pwa-assets": "pwa-assets-generator --root . --config pwa-assets.config.ts && pwa-assets-generator --root . --config pwa-assets-dark.config.ts && node scripts/make-icons-circular.js",
"dev": "bash scripts/dev.sh",
"preview": "vite preview",
"prepare": "svelte-kit sync || echo ''",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"check:design": "node scripts/design-md.js --check",
"design:tokens": "node scripts/design-md.js",
"reset": "rm -rf .svelte-kit node_modules",
"format": "eslint --fix . && prettier --write .",
"format:files": "sh -c 'eslint --fix \"$@\" && prettier --write \"$@\"' sh",
"lint": "svelte-kit sync && prettier --check . && eslint .",
"test": "npm run test:ui -- --run && npm run test:client -- --run && npm run test:unit -- --run && npm run test:e2e",
"test:e2e": "playwright test",
"test:e2e:pwa": "playwright test tests/e2e/pwa.e2e.ts",
"demo:codegen": "playwright codegen --target=playwright-test --viewport-size=1440,900 --output=demo/recording.demo.ts http://localhost:5180/",
"demo:docs": "node demo/cli.ts docs",
"demo:pr": "node demo/cli.ts pr",
"demo:record": "playwright test --config=demo/playwright.config.ts",
"demo:traces": "node demo/cli.ts traces",
"test:client": "vitest --project=client",
"test:unit": "vitest --project=unit",
"test:unit:pwa": "vitest --project=unit --run tests/unit/pwa.spec.ts",
"test:pwa": "npm run test:unit:pwa && npm run test:e2e:pwa",
"test:ui": "vitest --project=ui",
"storybook": "svelte-kit sync && storybook dev -p 6006",
"build-storybook": "svelte-kit sync && storybook build",
"cleanup": "rm -rf .svelte-kit build node_modules test-results dist dev-dist debug-storybook.log static/pwa-*.png static/maskable-icon-*.png static/apple-touch-icon-*.png static/apple-splash-*.png static/favicon*.ico",
"start": "node bin/cli.js"
},
"devDependencies": {
"@chromatic-com/storybook": "5.5.1",
"@codemirror/commands": "6.11.1",
"@codemirror/lang-markdown": "6.5.2",
"@codemirror/language": "6.13.1",
"@codemirror/state": "6.7.6",
"@codemirror/view": "6.43.15",
"@eslint/compat": "2.1.1",
"@eslint/js": "10.0.1",
"@internationalized/date": "3.12.2",
"@lezer/highlight": "1.2.5",
"@lucide/svelte": "1.46.0",
"@modelcontextprotocol/sdk": "1.32.1",
"@playwright/test": "1.56.1",
"@storybook/addon-a11y": "10.6.6",
"@storybook/addon-docs": "10.6.6",
"@storybook/addon-mcp": "10.6.6",
"@storybook/addon-svelte-csf": "5.1.6",
"@storybook/addon-vitest": "10.6.6",
"@storybook/sveltekit": "10.6.6",
"@sveltejs/adapter-static": "4.0.1",
"@sveltejs/kit": "3.2.0",
"@sveltejs/load-config": "0.2.3",
"@sveltejs/vite-plugin-svelte": "7.3.1",
"@tailwindcss/forms": "0.5.10",
"@tailwindcss/typography": "0.5.20",
"@tailwindcss/vite": "4.3.5",
"@types/mdast": "4.0.4",
"@types/node": "24.13.0",
"@vite-pwa/assets-generator": "1.0.4",
"@vitest/browser": "4.1.12",
"@vitest/browser-playwright": "4.1.12",
"@vitest/coverage-v8": "4.1.12",
"bits-ui": "2.18.1",
"clsx": "2.1.1",
"dexie": "4.4.3",
"dompurify": "3.4.17",
"eslint": "10.14.0",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-perfectionist": "^5.10.1",
"eslint-plugin-simple-import-sort": "^14.0.0",
"eslint-plugin-storybook": "10.6.6",
"eslint-plugin-svelte": "3.24.1",
"fflate": "0.8.3",
"globals": "16.5.0",
"highlight.js": "11.11.1",
"http-server": "14.1.1",
"@ggml-org/llama-brand": "https://codeload.github.com/ggml-org/llama-brand/tar.gz/f05540643c1ca2a18d732ed6491c839686da9a3a",
"mdsvex": "0.12.7",
"mermaid": "11.17.2",
"mode-watcher": "1.1.0",
"pdfjs-dist": "5.4.54",
"playwright": "1.56.1",
"prettier": "3.8.3",
"prettier-plugin-svelte": "4.1.0",
"prettier-plugin-tailwindcss": "0.8.0",
"rehype-highlight": "7.0.2",
"rehype-katex": "7.0.1",
"rehype-stringify": "10.0.1",
"remark": "15.0.1",
"remark-breaks": "4.0.0",
"remark-gfm": "4.0.1",
"remark-html": "16.0.1",
"remark-math": "6.0.0",
"remark-rehype": "11.1.2",
"sass": "1.100.0",
"storybook": "10.6.6",
"svelte": "5.57.3",
"svelte-check": "4.7.8",
"svelte-sonner": "1.1.1",
"tailwind-merge": "3.6.0",
"tailwind-variants": "3.3.1",
"tailwindcss": "4.3.5",
"tw-animate-css": "1.4.0",
"typescript": "6.0.3",
"typescript-eslint": "8.72.1",
"unified": "11.0.5",
"unist-util-visit": "5.1.0",
"uuid": "13.0.2",
"vaul-svelte": "1.0.0-next.7",
"vite": "8.3.6",
"vite-plugin-devtools-json": "1.1.2",
"vitest": "4.1.12",
"vitest-browser-svelte": "2.1.1"
},
"overrides": {
"@storybook/svelte": "10.6.6",
"cookie": "1.1.1",
"http-server": {
"html-encoding-sniffer": "6.0.0"
},
"katex": "0.19.0",
"minimatch": "11.0.5",
"postcss-selector-parser": "7.1.6",
"sharp": "0.35.5",
"valibot": "1.4.2"
},
"imports": {
"#lib/*": "./src/lib/*"
}
}