Skip to content

ui: make Llama Chat a plain chat unless llama-server offers agent features - #113

Closed
allozaur wants to merge 3 commits into
allozaur/refactor/ui-typed-routes-and-dev-proxyfrom
allozaur/feat/chat-only-build
Closed

allozaur wants to merge 3 commits into
allozaur/refactor/ui-typed-routes-and-dev-proxyfrom
allozaur/feat/chat-only-build

Conversation

@allozaur

@allozaur allozaur commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Overview

Llama Chat becomes a plain chat, a message and its reply, unless llama-server is started with its agent features (--agent). It can also be built as a chat-only app that never has them.

Additional information

The fork's copy of upstream draft ggml-org#32949, which has the demos and the diagram. Part of the fork stack, above #125. The MCP layer (#61) still composes its extension by the build flag only, so on a server without agent features its sidebar entry and page stay while tools and server connections are off.

This changes what users see today: Llama Chat served by a llama-server without --agent, --tools or --ui-mcp-proxy no longer offers browser-side tools or MCP servers. Starting the server with --agent brings everything back.

The switch in the UI is a convenience, not a security boundary: llama-server refusing tools is what protects the machine.

Known gaps: the harness is still downloaded by a plain chat that runs on a full build (about 8 KB of 8.3 MB); only the chat-only build leaves it out. Sending a message was not tried in either mode.

What changed
  • Agent mode at runtime. agenticMode.enabled (stores/agentic-mode.svelte.ts) is true when the build has the agentic features and the server offers them. The app reads that from what llama-server already reports, with no server change: /props says whether the proxy is on (cors_proxy_enabled), and /tools lists the built-in tools or answers 403.
  • The gates sit in the stores, so the UI follows without a switch in every component:
    • the chat store sends the classic request and never starts an agentic flow;
    • the tools store has no tools, browser-side ones included;
    • the MCP store connects to no server (saved servers are kept).
  • Hidden in a plain chat: the Tools submenu of the add menu, the working folder, the MCP entry in the sidebar and its page (#/mcp-servers goes to the start page), the Tools and Agentic settings sections and the Show MCP setting. The add button's tooltip no longer names tools or MCP.
  • Tool calls in earlier conversations still display.
  • Show MCP moves to the Agentic settings, from General, with the rest of what agent mode adds. It is still off by default, and on for someone who already has MCP servers.
  • Chat-only build. VITE_PUBLIC_AGENTIC=false npm run build makes an app that is a plain chat for every server, and npm run dev:chat-only runs the dev server the same way. Llama Harness gets a ./trace entry with the trace phrasing alone, and in this build Vite resolves @ggml-org/llama-harness to a small stub that re-exports it, so the loop is not in the bundle.
  • The UI workflow has a job that builds the chat-only variant and fails when the loop is in it.
  • The browser tests and the stories run as against a server started with --agent.
Testing
  • ui/apps/chat: npm run check, npm run lint, npm run check:design, the 933 unit tests, the 349 client tests and the 187 Storybook tests pass. chat-only-build.test.ts covers the build flag, agent mode for a server with and without tools or the proxy, the settings sections, the sidebar and the tools store.
  • Both builds pass. The chat-only bundle does not contain the loop; the regular one does.
  • ui/lib/harness: npm run check, npm test and npm run prepack (build and publint) pass with the new ./trace entry.
  • By hand, in a dev server on the fork's copy of this change, which differs only in how routes are written:
    • against a llama-server without --agent: the add button offers files and prompts only, the sidebar has no MCP entry, and the only console error is the 403 from /tools;
    • against one started with --agent: the tools menu, the working folder, the MCP page and the Tools and Agentic settings are there.
  • Not tried: sending a message in either mode, and the built app embedded in llama-server.

Requirements

@github-actions github-actions Bot added documentation Improvements or additions to documentation devops server/ui labels Nov 24, 2026
@allozaur
allozaur added this pull request to stack #114 November 24, 2026 09:41
@allozaur
allozaur force-pushed the allozaur/feat/chat-only-build branch from 59eae48 to 1067294 Compare November 24, 2026 12:18
llama-server refuses browser requests whose Origin does not match its own
host unless --cors-origins allows it, and the Vite proxy forwarded the
page's Origin (localhost:5173, or a LAN or Tailscale address). Loading a
model, saving tools and /v1 calls failed with 403 under `vite dev`.

The proxy now calls the server with its own Host and no Origin, WebSocket
upgrades included. Sec-Fetch-Site still passes through, so requests from
other sites stay refused.

Assisted-by: Claude (Opus 5.5 Medium)
ROUTES holds the app's route ids, as page.route.id reports them, in
place of hash strings and the separate *_ROUTE_ID constants. Every link
and goto() goes through resolve() from $app/paths, which checks the
route exists and returns its URL (#/models with the hash router).
RouterService resolves the routes that take params: a chat, a project,
a project's chat or new chat, and an extension's page. Tab links,
sidebar items and extension navigation items carry the resolved URL's
type, and checks for the current page compare page.route.id instead of
the hash.

svelte/no-navigation-without-resolve is on again, with type information
for the app's modules so a URL typed as ResolvedPathname passes. Links
that leave the app say so with rel="external"; the deep-link cleanups,
which change the current page's own query, are marked as such.

Assisted-by: Claude (Opus 5.5 Medium)
…tures

Llama Chat showed its tools, MCP and agentic settings and ran the agentic
loop for every server. Now it does so only for a llama-server that offers
its built-in tools or its proxy, which --agent turns on together; the app
reads this from /props and /tools. Without them it is a plain chat: a
message and its reply, with reasoning when the model gives it. The chat
store sends the classic request, the tools store has no tools and the MCP
store connects to no server, so the tools menu, the working folder, the MCP
entry and page, and the Tools and Agentic settings are gone. Tool calls in
earlier conversations still display.

The Show MCP setting moves from General to the Agentic settings, with the
rest of what agent mode adds.

VITE_PUBLIC_AGENTIC=false builds an app that is a plain chat for every
server, and leaves Llama Harness's loop out of the bundle: the harness gets
a ./trace entry with the phrasing alone, and Vite resolves the package to a
small stub that re-exports it. A CI job builds the variant and checks the
loop is not in it.

Assisted-by: Claude (Opus 5.5 Medium)
@allozaur
allozaur force-pushed the allozaur/feat/chat-only-build branch from 1067294 to 568bd48 Compare November 24, 2026 13:57
@allozaur
allozaur removed this pull request from stack #114 November 24, 2026 13:58
@allozaur
allozaur changed the base branch from allozaur/refactor/llama-harness-package to allozaur/refactor/ui-typed-routes-and-dev-proxy November 24, 2026 13:58
@allozaur
allozaur added this pull request to stack #126 November 24, 2026 13:58
@allozaur allozaur changed the title ui: build Llama Chat as a chat-only app, without the agentic loop ui: make Llama Chat a plain chat unless llama-server offers agent features Nov 24, 2026
@allozaur
allozaur force-pushed the allozaur/refactor/ui-typed-routes-and-dev-proxy branch from f2bcb0e to 2497365 Compare November 24, 2026 14:10
@allozaur
allozaur removed this pull request from stack #126 November 24, 2026 14:10
@allozaur allozaur closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops documentation Improvements or additions to documentation server/ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant