Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
b7a332d
ui: let the dev proxy pass llama-server's cross-origin check
allozaur Nov 16, 2026
f2d83e2
ui: navigate through resolve() with typed route ids
allozaur Nov 16, 2026
88e45e7
ui: add @ggml-org/llama-harness, the agentic loop as a package, in ui…
allozaur Nov 10, 2026
7d522bd
ui: run Llama Chat's agentic loop through @ggml-org/llama-harness
allozaur Nov 10, 2026
1fecd7e
ui: bring the architecture docs in line with the ui/ folder
allozaur Nov 12, 2026
8df6a87
ui: add an extension registry to Llama Chat
allozaur Nov 12, 2026
8e1c280
ui: list and run MCP tools through the tools extension point
allozaur Nov 12, 2026
281f657
ui: open MCP from the sidebar and its page through the navigation and…
allozaur Nov 12, 2026
425aeec
ui: add MCP prompts and resources to the chat form through composer e…
allozaur Nov 12, 2026
53b92a2
ui: draw MCP prompt messages and attachments through renderer extensi…
allozaur Nov 12, 2026
efdc424
ui: keep MCP's code in its extension folder, out of the core barrels
allozaur Nov 12, 2026
37f2892
ui: switch the built-in extensions on once for all Storybook stories
allozaur Nov 13, 2026
8c65715
ui: switch extensions on and off in Settings
allozaur Nov 13, 2026
2563071
ui: move the MCP client to MCP SDK v2
allozaur Nov 12, 2026
a1e454c
ui: negotiate the stateless MCP protocol, fall back to the session ha…
allozaur Nov 12, 2026
6642f7d
ui: keep stateless MCP connections as dependable as session ones
allozaur Nov 12, 2026
230729d
ui: end an MCP reconnect loop when its server is gone or the store sh…
allozaur Nov 13, 2026
cee5243
ui: hide an extension's settings fields while it is off
allozaur Nov 13, 2026
7fb570c
ui: say in the README how a setting belongs to an extension
allozaur Nov 13, 2026
381cb08
ui: draw an unsent attachment of an unclaimed kind as text
allozaur Nov 13, 2026
0e4a797
server : name the MCP server of each tool in /tools
allozaur Nov 16, 2026
1a46794
ui: list the MCP servers llama-server runs beside the ones it connect…
allozaur Nov 16, 2026
3b45b12
ui: show Models and MCP in the extension tests, now that both wait be…
allozaur Nov 18, 2026
4654ffd
ui: bring the MCP extension in line with the PRs now below it
allozaur Nov 18, 2026
84ee224
ui: load the MCP SDK only when a server connects
allozaur Nov 18, 2026
1f3faef
ui : add the providers data layer
allozaur Sep 28, 2026
6ff704f
ui : route chat through the active provider
allozaur Sep 28, 2026
e865cba
ui : add the manage providers view
allozaur Sep 28, 2026
9bb6378
ui : show every provider's models in the manager
allozaur Sep 28, 2026
2307a3f
ui : resolve the layout probes through the providers api url
allozaur Oct 6, 2026
3ccc8ef
test : seed the picker drawer through the providers data layer
allozaur Oct 8, 2026
5d6221a
ui : keep the selector list open on provider backends
allozaur Oct 8, 2026
f315033
ui : show the selected model of the compat backends
allozaur Oct 8, 2026
b610423
ui : hide the chat template on the remote providers
allozaur Oct 8, 2026
64a93dd
ui : offer the compat providers a selection instead of a load
allozaur Oct 8, 2026
0d46754
ui : keep the table status working while a provider is active
allozaur Oct 8, 2026
de86385
ui : keep llama.cpp servers as the only providers
allozaur Oct 19, 2026
267d551
ui : address remote providers through a tunnel
allozaur Oct 19, 2026
a872ed1
ui : pair a provider by code or camera
allozaur Oct 19, 2026
7d70c74
ui : cover the provider transport with tests
allozaur Oct 19, 2026
eaf2a44
ui : rename the provider layer to servers
allozaur Oct 20, 2026
2396c38
ui : rebuild the server card around what it reports
allozaur Oct 20, 2026
cfb3ba7
ui : recover a dropped channel when the tab comes back
allozaur Oct 20, 2026
8f735a4
ui : show the access code as a QR code
allozaur Oct 20, 2026
f22dcaa
ui : give servers a dialog of their own
allozaur Oct 20, 2026
b083c54
ui : add a server from a drawer on a phone
allozaur Oct 20, 2026
129a696
test : cover the servers surface
allozaur Oct 20, 2026
45b7147
ui : keep a server's API key when it is read back
allozaur Oct 20, 2026
92ff09b
ui : refuse an endpoint that is not a llama.cpp server
allozaur Oct 20, 2026
57c063f
ui : offer pairing where no server can answer
allozaur Oct 20, 2026
a788ea8
ui : read a remote router's status feed
allozaur Oct 20, 2026
c63c2cc
ui : adapt the servers work to the stack
allozaur Nov 2, 2026
6310281
ui : open Servers as a page on a phone, a dialog elsewhere
allozaur Nov 2, 2026
baa8684
ui: keep local-only requests on the local server, fix hidden models
allozaur Nov 9, 2026
6ea249c
ui : put remote server pairing behind an experimental setting
allozaur Nov 9, 2026
ce2ff9a
ui: npx llama-chat --server adds a llama-server to the app
allozaur Nov 18, 2026
03752f6
ui: ask for llama-chat.json only where the CLI put it
allozaur Nov 18, 2026
6cdda4a
ui: bring servers in line with the PRs now below it
allozaur Nov 18, 2026
b6a91fa
ui: share the working directory row between chat and projects
allozaur Nov 9, 2026
30444e9
ui : projects (parked)
allozaur Oct 29, 2026
c4558f7
ui : list projects on a Projects page reached from the sidebar
allozaur Oct 30, 2026
0a50c19
ui : show each project as a row inside sidebar sections
allozaur Oct 30, 2026
13e0eef
ui : pass project instructions to the system prompt as written
allozaur Oct 30, 2026
6430a55
ui : mark pinned projects on the Projects page
allozaur Oct 30, 2026
37848c3
ui : archive projects, listed in their own tab on the Projects page
allozaur Oct 30, 2026
3d8eef1
ui : add the project page
allozaur Oct 22, 2026
12c72b7
ui : open project chats in a project view
allozaur Oct 22, 2026
e2b5e7a
ui : keep a project's actions, goal and details by its title
allozaur Oct 26, 2026
2f2c0f3
ui : keep a project's open chats as tabs on its page
allozaur Oct 26, 2026
394d01b
ui : always open a project's chats inside the project
allozaur Oct 26, 2026
3a1e4be
ui : open the project page from its card and sidebar row (spike)
allozaur Oct 30, 2026
9a7335a
ui: keep the Projects title clear of the status bar and the menu key …
allozaur Nov 1, 2026
e5b5a9e
ui: give a phone page's main action a floating key, starting with New…
allozaur Nov 1, 2026
641fe20
ui: line a phone's bottom corner action up with the chat form in the …
allozaur Nov 1, 2026
ec19592
ui: keep a phone's bottom corner action as far from the side as from …
allozaur Nov 1, 2026
6f32fc3
ui: portal the floating key and slide it with the page, so it no long…
allozaur Nov 1, 2026
76085f7
ui : open a new chat in a tab of its own, never in a chat's tab
allozaur Nov 2, 2026
8166e69
ui : keep a project's context to files until the picker lists MCP res…
allozaur Nov 2, 2026
21b5108
ui: let project tools change only the chat's own project
allozaur Nov 9, 2026
ebb8e4f
ui : fit projects to the sidebar footer
allozaur Nov 10, 2026
3c06fe9
ui: line the project submenu up like the other submenus
allozaur Nov 16, 2026
b3b59a2
ui: bring projects in line with the PRs now below it
allozaur Nov 18, 2026
eca2a9f
ui : add a prompt library store in IndexedDB
allozaur Oct 31, 2026
2455e9c
ui : add a System message submenu to the chat add menu
allozaur Oct 31, 2026
10ba542
ui : show the prompt a system message came from
allozaur Oct 31, 2026
a599f83
ui : add a system message to the prompt library
allozaur Oct 31, 2026
4df75c6
ui : show system messages made from a prompt as prompt cards
allozaur Nov 1, 2026
e746a97
ui : add a Library entry to the sidebar
allozaur Oct 22, 2026
8ee56ac
ui : turn the Library into Prompts and Media tabs
allozaur Oct 31, 2026
1d65c06
ui: keep the Library title clear of the status bar and the menu key o…
allozaur Nov 1, 2026
329156b
ui: give New prompt the floating key on phones
allozaur Nov 1, 2026
6602451
ui: name saved prompts in search_chats results
allozaur Nov 16, 2026
384e646
ui: draw the system message submenu's rows like menu items
allozaur Nov 16, 2026
080a11a
ui: bring the prompt library in line with the PRs now below it
allozaur Nov 18, 2026
47d78fd
ui: introduce storage backend and preferences service
allozaur Oct 28, 2026
f998673
ui: store conversations and settings through storage adapters
allozaur Oct 28, 2026
bc6c5cb
ui: store conversations in IndexedDB through idb instead of Dexie
allozaur Nov 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .devops/cann.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ COPY ui/apps/chat/package.json ui/apps/chat/package-lock.json ./
RUN npm ci

COPY ui/apps/chat/ ./
# the app compiles Llama UI from its source next to it
# the app compiles Llama UI and the harness from their sources next to it
COPY ui/lib/ui/package.json /app/ui/lib/ui/package.json
COPY ui/lib/ui/src/lib/ /app/ui/lib/ui/src/lib/
COPY ui/lib/harness/src/ /app/ui/lib/harness/src/
RUN LLAMA_BUILD_NUMBER="$APP_VERSION" npm run build

FROM ${CANN_BASE_IMAGE} AS build
Expand Down
3 changes: 2 additions & 1 deletion .devops/cpu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ COPY ui/apps/chat/package.json ui/apps/chat/package-lock.json ./
RUN npm ci

COPY ui/apps/chat/ ./
# the app compiles Llama UI from its source next to it
# the app compiles Llama UI and the harness from their sources next to it
COPY ui/lib/ui/package.json /app/ui/lib/ui/package.json
COPY ui/lib/ui/src/lib/ /app/ui/lib/ui/src/lib/
COPY ui/lib/harness/src/ /app/ui/lib/harness/src/
RUN LLAMA_BUILD_NUMBER="$APP_VERSION" npm run build

FROM docker.io/ubuntu:$UBUNTU_VERSION AS build
Expand Down
3 changes: 2 additions & 1 deletion .devops/cuda.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ COPY ui/apps/chat/package.json ui/apps/chat/package-lock.json ./
RUN npm ci

COPY ui/apps/chat/ ./
# the app compiles Llama UI from its source next to it
# the app compiles Llama UI and the harness from their sources next to it
COPY ui/lib/ui/package.json /app/ui/lib/ui/package.json
COPY ui/lib/ui/src/lib/ /app/ui/lib/ui/src/lib/
COPY ui/lib/harness/src/ /app/ui/lib/harness/src/
RUN LLAMA_BUILD_NUMBER="$APP_VERSION" npm run build

FROM ${BASE_CUDA_DEV_CONTAINER} AS build
Expand Down
3 changes: 2 additions & 1 deletion .devops/intel.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ COPY ui/apps/chat/package.json ui/apps/chat/package-lock.json ./
RUN npm ci

COPY ui/apps/chat/ ./
# the app compiles Llama UI from its source next to it
# the app compiles Llama UI and the harness from their sources next to it
COPY ui/lib/ui/package.json /app/ui/lib/ui/package.json
COPY ui/lib/ui/src/lib/ /app/ui/lib/ui/src/lib/
COPY ui/lib/harness/src/ /app/ui/lib/harness/src/
RUN LLAMA_BUILD_NUMBER="$APP_VERSION" npm run build

FROM docker.io/intel/deep-learning-essentials:$ONEAPI_VERSION AS build
Expand Down
3 changes: 2 additions & 1 deletion .devops/musa.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ COPY ui/apps/chat/package.json ui/apps/chat/package-lock.json ./
RUN npm ci

COPY ui/apps/chat/ ./
# the app compiles Llama UI from its source next to it
# the app compiles Llama UI and the harness from their sources next to it
COPY ui/lib/ui/package.json /app/ui/lib/ui/package.json
COPY ui/lib/ui/src/lib/ /app/ui/lib/ui/src/lib/
COPY ui/lib/harness/src/ /app/ui/lib/harness/src/
RUN LLAMA_BUILD_NUMBER="$APP_VERSION" npm run build

FROM ${BASE_MUSA_DEV_CONTAINER} AS build
Expand Down
2 changes: 1 addition & 1 deletion .devops/nix/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ effectiveStdenv.mkDerivation (finalAttrs: {
webui = stdenvNoCC.mkDerivation {
pname = "webui";
version = llamaVersion;
# the app compiles Llama UI from its source in ../../lib/ui, so the source is ui/ as a whole
# the app compiles Llama UI and the harness from their sources in ../../lib, so the source is ui/ as a whole
src = lib.cleanSource ../../ui;
sourceRoot = "source/apps/chat";

Expand Down
3 changes: 2 additions & 1 deletion .devops/openvino.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ COPY ui/apps/chat/package.json ui/apps/chat/package-lock.json ./
RUN npm ci

COPY ui/apps/chat/ ./
# the app compiles Llama UI from its source next to it
# the app compiles Llama UI and the harness from their sources next to it
COPY ui/lib/ui/package.json /app/ui/lib/ui/package.json
COPY ui/lib/ui/src/lib/ /app/ui/lib/ui/src/lib/
COPY ui/lib/harness/src/ /app/ui/lib/harness/src/
RUN LLAMA_BUILD_NUMBER="$APP_VERSION" npm run build

## Build Image
Expand Down
3 changes: 2 additions & 1 deletion .devops/rocm.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ COPY ui/apps/chat/package.json ui/apps/chat/package-lock.json ./
RUN npm ci

COPY ui/apps/chat/ ./
# the app compiles Llama UI from its source next to it
# the app compiles Llama UI and the harness from their sources next to it
COPY ui/lib/ui/package.json /app/ui/lib/ui/package.json
COPY ui/lib/ui/src/lib/ /app/ui/lib/ui/src/lib/
COPY ui/lib/harness/src/ /app/ui/lib/harness/src/
RUN LLAMA_BUILD_NUMBER="$APP_VERSION" npm run build

### Build image
Expand Down
3 changes: 2 additions & 1 deletion .devops/vulkan.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ COPY ui/apps/chat/package.json ui/apps/chat/package-lock.json ./
RUN npm ci

COPY ui/apps/chat/ ./
# the app compiles Llama UI from its source next to it
# the app compiles Llama UI and the harness from their sources next to it
COPY ui/lib/ui/package.json /app/ui/lib/ui/package.json
COPY ui/lib/ui/src/lib/ /app/ui/lib/ui/src/lib/
COPY ui/lib/harness/src/ /app/ui/lib/harness/src/
RUN LLAMA_BUILD_NUMBER="$APP_VERSION" npm run build

FROM docker.io/ubuntu:$UBUNTU_VERSION AS build
Expand Down
3 changes: 2 additions & 1 deletion .devops/zendnn.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ COPY ui/apps/chat/package.json ui/apps/chat/package-lock.json ./
RUN npm ci

COPY ui/apps/chat/ ./
# the app compiles Llama UI from its source next to it
# the app compiles Llama UI and the harness from their sources next to it
COPY ui/lib/ui/package.json /app/ui/lib/ui/package.json
COPY ui/lib/ui/src/lib/ /app/ui/lib/ui/src/lib/
COPY ui/lib/harness/src/ /app/ui/lib/harness/src/
RUN LLAMA_BUILD_NUMBER="$APP_VERSION" npm run build

FROM docker.io/ubuntu:$UBUNTU_VERSION AS build
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ui-self-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ on:
'.github/workflows/ui-build-self-hosted.yml',
'ui/apps/chat/**.*',
'ui/lib/ui/**.*',
'ui/lib/harness/**.*',
'tools/server/tests/**.*'
]
pull_request:
Expand All @@ -28,6 +29,7 @@ on:
'.github/workflows/ui-build-self-hosted.yml',
'ui/apps/chat/**.*',
'ui/lib/ui/**.*',
'ui/lib/harness/**.*',
'tools/server/tests/**.*'
]

Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,37 @@ jobs:
run: npm run prepack
working-directory: ui/lib/ui

harness-checks:
name: Harness checks
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "24"
package-manager-cache: false

- name: Install dependencies
run: npm ci
working-directory: ui/lib/harness

- name: Run type checking
run: npm run check
working-directory: ui/lib/harness

- name: Run tests
run: npm test
working-directory: ui/lib/harness

- name: Build the package
run: npm run prepack
working-directory: ui/lib/harness

e2e-tests:
name: E2E Tests
needs: ui-build
Expand Down
16 changes: 16 additions & 0 deletions common/arg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3426,6 +3426,22 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
params.ui_mcp_proxy = value;
}
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_UI_MCP_PROXY"));
add_opt(common_arg(
{"--ui-storage"},
{"--no-ui-storage"},
"experimental: keep UI conversations and settings on disk instead of only in the browser - anyone who can reach the server can read them (default: disabled)",
[](common_params & params, bool value) {
params.ui_storage = value;
}
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_UI_STORAGE"));
add_opt(common_arg(
{"--ui-storage-dir"}, "PATH",
"directory for UI storage, implies --ui-storage (default: llama.cpp/ui in the user data directory)",
[](common_params & params, const std::string & value) {
params.ui_storage = true;
params.ui_storage_dir = value;
}
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_UI_STORAGE_DIR"));
add_opt(common_arg(
{"--tools"}, "TOOL1,TOOL2,...",
"experimental: whether to enable built-in tools for AI agents - do not enable in untrusted environments (default: no tools)\n"
Expand Down
18 changes: 18 additions & 0 deletions common/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,24 @@ std::filesystem::path fs_get_config_directory() {
return config_directory / "llama.cpp";
}

std::filesystem::path fs_get_data_directory() {
std::filesystem::path data_directory;
#if defined(_WIN32)
data_directory = common_get_path_from_env("APPDATA");
if (data_directory.empty()) {
throw std::runtime_error("Failed to find %APPDATA% directory");
}
#elif defined(__APPLE__)
data_directory = get_home_directory() / "Library/Application Support";
#else
data_directory = common_get_path_from_env("XDG_DATA_HOME");
if (data_directory.empty()) {
data_directory = get_home_directory() / ".local/share";
}
#endif
return data_directory / "llama.cpp";
}

std::filesystem::path fs_get_cache_file(const std::string & filename) {
GGML_ASSERT(filename.find(DIRECTORY_SEPARATOR) == std::string::npos);
const std::filesystem::path cache_directory = fs_get_cache_directory();
Expand Down
3 changes: 3 additions & 0 deletions common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,8 @@ struct common_params {
bool ui = true;
bool ui_mcp_proxy = false;
std::string ui_config_json;
bool ui_storage = false; // keep UI conversations and settings on disk
std::string ui_storage_dir; // empty: fs_get_data_directory() / "ui"

// "advanced" endpoints are disabled by default for better security
bool endpoint_slots = true;
Expand Down Expand Up @@ -960,6 +962,7 @@ inline bool common_create_directories(const std::filesystem::path & path, std::e
std::filesystem::path fs_get_cache_directory();
std::filesystem::path fs_get_cache_file(const std::string & filename);
std::filesystem::path fs_get_config_directory();
std::filesystem::path fs_get_data_directory();

void fs_write_atomic(const std::filesystem::path & path, const std::string & data);

Expand Down
13 changes: 10 additions & 3 deletions scripts/ui-assets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ set(LLAMA_UI_GZIP "" CACHE STRING "Apply gzip compress to assets to save ban
set(DIST_DIR "${UI_BINARY_DIR}/dist")
set(SRC_DIST_DIR "${UI_SOURCE_DIR}/dist")
# The stage keeps the layout of ui/: the app in apps/chat, with the sources of
# Llama UI that it compiles next to it in lib/ui (see ui/apps/chat/scripts/llama-ui.js).
# Llama UI and the harness that it compiles next to it in lib/ (see
# ui/apps/chat/scripts/llama-ui.js and svelte.config.js).
set(STAGE_DIR "${UI_BINARY_DIR}/ui-src")
set(WORK_DIR "${STAGE_DIR}/apps/chat")
set(UI_LIB_DIR "${UI_SOURCE_DIR}/../../lib/ui")
set(HARNESS_DIR "${UI_SOURCE_DIR}/../../lib/harness")
set(STAMP_FILE "${UI_BINARY_DIR}/.ui-stamp")
set(EMBED_STAMP "${UI_BINARY_DIR}/.ui-embed.sha256")
set(UI_CPP "${UI_BINARY_DIR}/ui.cpp")
Expand Down Expand Up @@ -323,7 +325,7 @@ function(npm_build_should_skip out_var)
endfunction()

function(stage_sources)
# everything but the app goes: the library, restaged below, and what a stage
# everything but the app goes: the packages, restaged below, and what a stage
# from before this layout left at the top, its node_modules included
if(EXISTS "${STAGE_DIR}")
file(GLOB staged RELATIVE "${STAGE_DIR}" "${STAGE_DIR}/*")
Expand All @@ -347,7 +349,8 @@ function(stage_sources)
PATTERN "node_modules" EXCLUDE
)

# what the app reads of the library: its sources and the dependency list
# what the app reads of the packages: Llama UI's sources and dependency list,
# and the harness's sources
file(COPY "${UI_LIB_DIR}/package.json"
DESTINATION "${STAGE_DIR}/lib/ui"
NO_SOURCE_PERMISSIONS
Expand All @@ -356,6 +359,10 @@ function(stage_sources)
DESTINATION "${STAGE_DIR}/lib/ui/src"
NO_SOURCE_PERMISSIONS
)
file(COPY "${HARNESS_DIR}/src"
DESTINATION "${STAGE_DIR}/lib/harness"
NO_SOURCE_PERMISSIONS
)
endfunction()

function(npm_build out_var)
Expand Down
2 changes: 2 additions & 0 deletions tools/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ add_library(${TARGET} STATIC
server-stream.h
server-tools.cpp
server-tools.h
server-storage.cpp
server-storage.h
server-mcp.cpp
server-mcp.h
server-schema.cpp
Expand Down
1 change: 1 addition & 0 deletions tools/server/README-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ Get a list of tools, each tool has these fields:
- `tool` (string): the ID name of the tool, to be used in POST call. Example: `read_file`
- `display_name` (string): the name to be displayed on UI. Example: `Read file`
- `type` (string): `"server"` for a server tool, or `"mcp"` for a tool exposed by an MCP server
- `mcp_server` (string, only when `type` is `"mcp"`): the name of the MCP server the tool comes from, as declared in `--mcp-servers-config`. Example: `imcp`
- `permissions` (object): a mapping string --> boolean that indicates the permission required by this tool. This is useful for the UI to ask the user before calling the tool. For now, the only permission supported is `"write"`
- `definition` (object): the OAI-compat definition of this tool

Expand Down
4 changes: 3 additions & 1 deletion tools/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ For the full list of features, please refer to [server's changelog](https://gith
| `--ui-config, --webui-config JSON` | JSON that provides default UI settings (overrides UI defaults)<br/>(env: LLAMA_ARG_UI_CONFIG) |
| `--ui-config-file, --webui-config-file PATH` | JSON file that provides default UI settings (overrides UI defaults)<br/>(env: LLAMA_ARG_UI_CONFIG_FILE) |
| `--ui-mcp-proxy, --webui-mcp-proxy, --no-ui-mcp-proxy, --no-webui-mcp-proxy` | experimental: whether to enable MCP CORS proxy, for Llama Chat to reach public MCP servers without CORS headers; local and private addresses are refused - do not enable in untrusted environments (default: disabled)<br/>note: for security reasons, this will limit --cors-origins to localhost by default<br/>(env: LLAMA_ARG_UI_MCP_PROXY) |
| `--ui-storage, --no-ui-storage` | experimental: keep UI conversations and settings on disk instead of only in the browser - anyone who can reach the server can read them (default: disabled)<br/>(env: LLAMA_ARG_UI_STORAGE) |
| `--ui-storage-dir PATH` | directory for UI storage, implies --ui-storage (default: llama.cpp/ui in the user data directory)<br/>(env: LLAMA_ARG_UI_STORAGE_DIR) |
| `--tools TOOL1,TOOL2,...` | experimental: whether to enable built-in tools for AI agents - do not enable in untrusted environments (default: no tools)<br/>specify "all" to enable all tools<br/>available tools: read_file, file_glob_search, grep_search, exec_shell_command, write_file, edit_file, get_info<br/>note: for security reasons, this will limit --cors-origins to localhost by default<br/>(env: LLAMA_ARG_TOOLS) |
| `--tools-runtime OPTION` | experimental: run tools in a separate runtime environment (default: none, use host environment)<br/>available options:<br/> 'docker:<image>', 'podman:<image>': spin up a new container and reuse it for all invocations, clean up on server exit<br/> 'docker-container:<id>', 'podman-container:<id>': use an existing container by ID, won't stop on server exit<br/> 'ssh:<target>': run tools on a remote POSIX host over SSH, key-based auth and a trusted host key are required<br/><br/>(env: LLAMA_ARG_TOOLS_RUNTIME) |
| `--allow-unauthenticated-tools` | allow server tools, MCP servers or MCP proxy on a non-loopback address without an API key - only for trusted networks (default: disabled)<br/>(env: LLAMA_ARG_ALLOW_UNAUTHENTICATED_TOOLS) |
Expand Down Expand Up @@ -389,7 +391,7 @@ The same JSON can be passed inline with `--mcp-servers-json`. Each entry under `
| `cwd` | working directory of the child process |
| `timeout_ms` | per-tool-call timeout (default: 30000) |

Every server is spawned once at startup to list its tools, then stopped, and respawned on demand when one of its tools is called. Tools are exposed as `<server>_<tool>` alongside the built-in ones: they show up in Llama Chat and in `GET /tools`, and the model calls them like any other tool. A name colliding with an already registered tool is skipped. This is independent of `--tools`, MCP servers can be the only tools available.
Every server is spawned once at startup to list its tools, then stopped, and respawned on demand when one of its tools is called. Tools are exposed as `<server>_<tool>` alongside the built-in ones: they show up in Llama Chat, which lists each of these servers on its MCP servers page, and in `GET /tools`, with `"type": "mcp"` and the server's name in `mcp_server`. The model calls them like any other tool. A name colliding with an already registered tool is skipped. This is independent of `--tools`, MCP servers can be the only tools available.

The child process runs with the same privileges as the server, so only declare commands you trust. As with `--tools`, `--cors-origins` then defaults to `localhost`.

Expand Down
1 change: 1 addition & 0 deletions tools/server/server-context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5663,6 +5663,7 @@ static json get_res_props(const server_context_meta & meta, const common_params
{ "build_info", meta.build_info },
{ "is_sleeping", is_sleeping },
{ "cors_proxy_enabled", params.ui_mcp_proxy },
{ "ui_storage", params.ui_storage },
};

if (!params.server_connect_code.empty()) {
Expand Down
4 changes: 4 additions & 0 deletions tools/server/server-models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ static void unset_reserved_args(common_preset & preset, bool unset_model_args) {
preset.unset_option("LLAMA_ARG_CONNECT_CODE");
preset.unset_option("LLAMA_ARG_MCP_SERVERS_CONFIG");
preset.unset_option("LLAMA_ARG_MCP_SERVERS_JSON");
// UI storage is served by the router only
preset.unset_option("LLAMA_ARG_UI_STORAGE");
preset.unset_option("LLAMA_ARG_UI_STORAGE_DIR");
if (unset_model_args) {
preset.unset_option("LLAMA_ARG_MODEL");
preset.unset_option("LLAMA_ARG_SHARD");
Expand Down Expand Up @@ -2073,6 +2076,7 @@ void server_models_routes::init_routes() {
{"ui_settings", ui_settings},
{"build_info", std::string(llama_build_info())},
{"cors_proxy_enabled", params.ui_mcp_proxy},
{"ui_storage", params.ui_storage},
};
if (!params.server_connect_code.empty()) {
props["connect_code"] = params.server_connect_code;
Expand Down
Loading
Loading