Skip to content

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

Merged
allozaur merged 1 commit into
ggml-org:masterfrom
allozaur:allozaur/feat/ui-chat-only-build
Nov 24, 2026
Merged

allozaur merged 1 commit into
ggml-org:masterfrom
allozaur:allozaur/feat/ui-chat-only-build

Conversation

@allozaur

@allozaur allozaur commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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.

Demo

Regular chat Agent mode
Regular chat Agent mode

Recorded at cc3e89d; click a preview for its full video.

How the app decides which one it is:

flowchart TD
    B{"Built with<br/>VITE_PUBLIC_AGENTIC=false?"}
    S{"Does llama-server offer<br/>its tools or its proxy?<br/>(--agent turns on both)"}
    P1["Plain chat<br/>the agentic loop is not in the bundle"]
    P2["Plain chat<br/>a message and its reply"]
    A["Full app<br/>tools, MCP, agentic loop"]

    B -- yes --> P1
    B -- "no (default)" --> S
    S -- no --> P2
    S -- yes --> A
Loading

Additional information

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.
Demo script
// no MCP server is saved, so MCP starts hidden as it does for a new user
test.use({ settings: { mcpServers: '[]' } });

// "Regular chat" runs against a llama-server that answers as one started without --agent
// does: no proxy in /props, and /tools refuses. "Agent mode" uses the demo server as it is.
test.beforeEach(async ({ context }, testInfo) => {
	if (testInfo.title !== 'Regular chat') return;

	await context.route(/\/props(\?|$)/, async (route) => {
		const response = await route.fetch();

		await route.fulfill({
			json: { ...(await response.json()), cors_proxy_enabled: false },
			response
		});
	});
	await context.route(/\/tools$/, (route) =>
		route.fulfill({ json: { error: { message: 'Tools are disabled' } }, status: 403 })
	);
});

test('Regular chat', async ({ demo, page }) => {
	const add = page.getByRole('button', { name: 'Add files or prompts' }).first();
	const settings = page.getByRole('button', { name: /^Settings(\s|$)/ }).first();
	const expand = page.locator('aside button[aria-label="Expand navigation"]').first();

	await demo.caption('llama-server without --agent: a plain chat');
	await demo.pause(600);

	await demo.caption('The add menu offers files and prompts, no tools');
	await demo.click(add);
	await demo.pause(1800);
	await demo.press('Escape');

	await demo.caption('The sidebar has no MCP entry');
	await demo.click(expand);
	await demo.hover(settings);
	await demo.pause(1500);

	await demo.caption('Settings have no Tools or Agentic section');
	await demo.click(settings);
	await demo.pause(2600);
});

test('Agent mode', async ({ demo, page }) => {
	const add = page.getByRole('button', { name: 'Add files, prompts, tools or MCP Servers' }).first();
	const settings = page.getByRole('button', { name: /^Settings(\s|$)/ }).first();
	const expand = page.locator('aside button[aria-label="Expand navigation"]').first();
	const mcp = page.getByRole('button', { name: /^MCP(\s|$)/ }).first();
	const dialog = page.getByRole('dialog');

	await demo.caption('llama-server --agent: tools and the agentic loop');
	await demo.pause(600);

	await demo.caption('The add menu offers a working directory and tools');
	await demo.click(add);
	await demo.pause(800);
	await demo.hover(page.getByRole('menuitem', { name: /Tools/ }).first());
	await demo.pause(1800);
	await demo.press('Escape');
	await demo.press('Escape');

	await demo.caption('MCP stays off until you turn it on');
	await demo.click(expand);
	await demo.hover(settings);
	await demo.pause(1200);

	await demo.caption('Settings have the Tools and Agentic sections');
	await demo.click(settings);
	await demo.pause(600);
	await demo.click(dialog.getByText('Agentic', { exact: true }).first());
	await demo.pause(1000);

	await demo.caption('Show MCP is in the Agentic settings');
	await demo.click(dialog.getByText('Show MCP', { exact: true }).first());
	await demo.pause(800);
	await demo.click(dialog.getByRole('button', { name: 'Save settings' }));
	await demo.pause(600);

	// the dialog closes on save in some layouts, on Escape in the others
	if ((await dialog.count()) > 0) await demo.press('Escape');

	await demo.caption('MCP is in the sidebar now');
	await demo.click(mcp);
	await demo.pause(2400);
});

Requirements

…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 merged commit 97bbf98 into ggml-org:master Nov 24, 2026
11 checks passed
@github-actions github-actions Bot added documentation Improvements or additions to documentation devops improvements to build systems and github actions server/ui video demo PR features a video demo recorded with the UI demo pipeline labels Nov 24, 2026
@geowcm

geowcm commented Nov 24, 2026

Copy link
Copy Markdown

Is it possible to only enable the browser tools but not the server tools?

@awijshoff

awijshoff commented Nov 24, 2026 •

Copy link
Copy Markdown

According to the documentation, --agent enables all build in tools and I think is therefore disabled with a reason.

If I want to add a simple mcp-server (e. g. exa, draw.io) or low-impact browser-tools, all server-tools are overkill and a potential risk if I forget to disable them while using Llama Chat directly on host instead of a runtime.

I'd suggest --ui with enum off | chat | agent

@allozaur

Copy link
Copy Markdown
Contributor Author

According to the documentation, --agent enables all build in tools and I think is therefore disabled with a reason.

If I want to add a simple mcp-server (e. g. exa, draw.io) or low-impact browser-tools, all server-tools are overkill and a potential risk if I forget to disable them while using Llama Chat directly on host instead of a runtime.

I'd suggest --ui with enum off | chat | agent

Is it possible to only enable the browser tools but not the server tools?

See #33004

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops improvements to build systems and github actions documentation Improvements or additions to documentation server/ui video demo PR features a video demo recorded with the UI demo pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants