01812e8b0202712d47955e5ac213c8248bc2be79
1
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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) |