Repository navigation
ui: make Llama Chat a plain chat unless llama-server offers agent features - #32949
Conversation
…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)
71d92c0 to
cc3e89d
Compare
|
Is it possible to only enable the browser tools but not the server tools? |
|
According to the documentation, 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 |
See #33004 |
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
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 --> AAdditional information
This changes what users see today: Llama Chat served by a llama-server without
--agent,--toolsor--ui-mcp-proxyno longer offers browser-side tools or MCP servers. Starting the server with--agentbrings 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
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:/propssays whether the proxy is on (cors_proxy_enabled), and/toolslists the built-in tools or answers 403.#/mcp-serversgoes 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.VITE_PUBLIC_AGENTIC=false npm run buildmakes an app that is a plain chat for every server, andnpm run dev:chat-onlyruns the dev server the same way. Llama Harness gets a./traceentry with the trace phrasing alone, and in this build Vite resolves@ggml-org/llama-harnessto a small stub that re-exports it, so the loop is not in the bundle.--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.tscovers the build flag, agent mode for a server with and without tools or the proxy, the settings sections, the sidebar and the tools store.ui/lib/harness:npm run check,npm testandnpm run prepack(build and publint) pass with the new./traceentry.--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;--agent: the tools menu, the working folder, the MCP page and the Tools and Agentic settings are there.Demo script
Requirements
Claude (Opus 5.5 Medium)