Skip to main content

Runtime Settings

Change settings in the web interface and they apply without a restart. LocalAI saves them to runtime_settings.json.

Accessing Runtime Settings

Open Admin → Settings in the web UI (/app/settings). The page lists every setting below under nine groups, and keeps your edits in a pending bar until you apply them.

Groups

GroupSettings it holds
Models in memoryWatchdog (idle and busy checks, timeouts, interval), eviction (force when busy, largest first, retries, retry interval), free memory automatically and its threshold, models kept loaded, swap models when memory is full, GPU memory budget, the disk prompt cache (on or off, time to live, size cap, quota per user, shortest prompt, shared cache, free-space marks) with its state and a Clear button
Speed and defaultsDefault threads, default context size, artifact download concurrency, F16
Backends and galleriesAutomatic backend upgrades, development backends, gallery loading on boot, the persistent VRAM cache, the model and backend gallery lists
Access and securityCORS and allowed origins, CSRF protection, shared API keys, whether MCP connectors may reach private networks
Debugging and tracesVerbose debug logging, API traces and their limits, backend logging
Chats and collectionsThe collections service (Knowledge in the sidebar), the helper models of the chats, the response store TTL, shared pages (shared_pages_enabled: the pages of shared folders; see Pages), the pages that people share (user_page_shares_enabled), the page area of Home (home_page_area_enabled), the offers from the assistant
ToolsThe built-in chat tools (web search, web pages, LocalAI client and admin tools), commands on this machine and their network limits, limits for steps, goals, loops and triggers
Swarm and sharingThe disk headroom check of distributed mode
Look and feelInstance name, tagline, the three logos

With the default name “LocalAI”, Home, the sign-in page and the mobile title draw “AI” in the brand colour, and the first-run guide on Home shows the LocalAI llama beside step 1. When you set your own instance name or logo, the name is plain text, your logo is used as before, and the llama is not shown. Sentences on the Home, sign-in and chat screens that name the product use your instance name.

An add-on with the branding operations can put its own name, tagline, images and accent colours under these settings. What you set here always wins, field by field. The settings page shows your own values, so an empty name field can stand beside a name that the add-on set. An image of an add-on cannot be reset here: upload your own to replace it. To remove the add-on’s branding, uninstall or disable the add-on or revoke its grant.

Search at the top of the page matches a setting’s name, description and key, and the group. It also matches the name of the section a setting used to be under, so a search for “Watchdog” still finds the watchdog settings. Each result says where the setting used to be.

/app/settings?group=<id> opens a group (memory, speed, backends, access, debug, agents, tools, swarm or look, plus addons when an add-on has settings), and a hash after it brings a block of the group into view: #settings-builtin-tools (the built-in chat tools) on the Tools group. The old address of the command network, /app/settings?group=tools#settings-egress, opens the Settings tab of the add-on that holds it now (see below), or the Tools group when no add-on does.

The settings of an add-on are not on this page: each add-on keeps them on the Settings tab of its details on the Add-ons page. When at least one add-on has settings, an Add-ons group at the end of the list names those add-ons, each with a link to its Settings tab. See Host slots. An add-on can also ask LocalAI to draw some of LocalAI’s own settings on that tab, with a host control. The rule: this page keeps the settings of the features that exist without any add-on (the commands on this machine, the built-in web tools), and points to the add-on where an add-on serves them; the settings that exist only for an add-on are on its tab. The Sandbox network below is one: with the Sandbox installed, the Tools group shows a row that links to its Settings tab, and neither the group nor the search lists those settings. A built-in tool row that an add-on with the tool-providers control serves links to that add-on’s tab.

Editing, applying and undoing

Edits are not sent as you type. A bar at the bottom of the page counts them and offers Discard, Show diff and Apply. The diff lists each old and new value, and runs the checks the browser can make: a duration parses the way the server parses it, a GPU memory budget is one the server accepts, a gallery list is valid JSON with a url in each entry, and warnings repeat what the server says (a restart is needed, an empty P2P token stops P2P, evicting while busy can interrupt requests, CSRF protection off). A check that would make the server refuse the value stops Apply.

Apply sends only the settings that changed. After it, Undo (for ten seconds) saves the previous values again. This is a new save, not a rollback: anything that changed in between stays changed.

A setting shows Changed and its built-in default, with a Reset link, only when the default is known (the defaults of the local-ai run flags). Settings without a stated default, such as threads and the context size, never show the marker. An environment variable or flag can change the value the server starts with, so the marker compares with the built-in default, not with the startup value.

A row says Applies now when the save handler applies the setting immediately (the watchdog and the memory reclaimer restart with the new values; so does the P2P stack when its settings change), and Needs restart for most collections settings. If a row shows neither note, restart LocalAI to be sure the setting is in use.

History lists the settings you applied from this browser, newest first, up to the last 50. LocalAI keeps no settings log of its own, so changes made elsewhere do not appear, and a secret (the P2P token, shared API keys, the collections database URL) is listed as changed without its value. Revert puts the old value back as an edit.

POST /api/settings accepts a partial body and merges it over the saved settings, so the page sends only the keys it changes. In the request, the csrf field carries the disable flag: the page shows the inverse as “CSRF protection”. The galleries are sent as galleries and backend_galleries, and the shared API keys as api_keys, each as a JSON list.

Available Settings

Watchdog Settings

The watchdog monitors backend activity and can automatically stop idle or overly busy models to free up resources.

  • Watchdog Enabled: Master switch to enable/disable the watchdog
  • Watchdog Idle Enabled: Enable stopping backends that are idle longer than the idle timeout
  • Watchdog Busy Enabled: Enable stopping backends that are busy longer than the busy timeout
  • Watchdog Idle Timeout: Duration threshold for idle backends (default: 15m)
  • Watchdog Busy Timeout: Duration threshold for busy backends (default: 5m)

Changes to watchdog settings are applied immediately by restarting the watchdog service.

Backend Configuration

  • Max Active Backends: Maximum number of active backends (loaded models). When exceeded, the least recently used model is automatically evicted. Set to 0 for unlimited, 1 for single-backend mode
  • Force Eviction When Busy: Allow evicting models even when they have active API calls (default: disabled for safety). Warning: Enabling this can interrupt active requests
  • LRU Eviction Max Retries: Maximum number of retries when waiting for busy models to become idle before eviction (default: 30)
  • LRU Eviction Retry Interval: Interval between retries when waiting for busy models (default: 1s)
  • Swap models when memory is full (model_swap, default on, applies at once): when a new model needs room (the active model limit is reached, or a loaded model holds the same concurrency group), unload the least recently used idle model to make room. When off, LocalAI never unloads a model for another one: the request waits for the LRU retry window (retries x interval) and, if no room frees up, gets 503 with a Retry-After header. The idle watchdog and the memory reclaimer still unload models. The flag is --model-swap (--no-model-swap, environment LOCALAI_MODEL_SWAP=false)
  • Unload idle models to make room for new ones (distributed_memory_eviction, default off, distributed mode only, applies at once): when the size of a model comes from its weight file and no worker node has that much free memory, unload least recently used idle models on a node to make room. A model in use is never unloaded, and the next request for an unloaded model loads it again. The load is never refused. A worker can allow or forbid it for its node, and an administrator can choose Inherit, Allow or Never for each node in its panel on the Workers page. In Settings the row shows how many nodes follow the switch, always allow it or never do, with a link to the Workers page. The flag is --distributed-memory-eviction (environment LOCALAI_DISTRIBUTED_MEMORY_EVICTION). See Eviction for memory

Note: The “Single Backend” setting is deprecated. Use “Max Active Backends” set to 1 for single-backend behavior.

LRU Eviction Behavior

By default, LocalAI will skip evicting models that have active API calls to prevent interrupting ongoing requests. When all models are busy and eviction is needed:

  1. The system will wait for models to become idle
  2. It will retry eviction up to the configured maximum number of retries
  3. The retry interval determines how long to wait between attempts
  4. If all retries are exhausted, the system will proceed (which may cause out-of-memory errors if resources are truly exhausted). With Swap models when memory is full off, the request gets 503 with Retry-After instead

You can configure these settings via the web UI or through environment variables. See VRAM Management for more details.

Memory settings in distributed mode

In distributed mode the settings of Models in memory are cluster settings: they are stored once for all frontends (see Memory settings across frontends) and each one applies to every worker node. The Settings page says so above the group. Five of them can differ per node (Per-node memory limits).

SettingSingle modeDistributed mode
max_active_backends (Models kept loaded)Models loaded on this machineModels on each node: loaded, loading and staging replicas. Per node
model_swap (Swap models when memory is full)Unload the least recently used idle model for a new oneThe same on each node. Off: a full node is skipped; when every node is full the request gets 503 with Retry-After. Per node
distributed_memory_eviction (Unload idle models to make room for new ones)No effectUnload idle models on a node for a model whose size comes from its weight file, when no node has the room. Per node (allow, never or inherit)
size_aware_evictionUnload the largest model firstUnload the largest replica first (size from the load estimate)
lru_eviction_max_retries, lru_eviction_retry_intervalThe wait for a busy model to become idleThe same, capped by the request’s own wait. While the scheduler chooses a node, the wait is at most 2.5 seconds when the request (or the replica reconciler) has no deadline
force_eviction_when_busyUnload a model that serves requestsUnload a replica that serves requests
watchdog_idle_*Unload models idle longer than the timeoutUnload replicas idle longer than the timeout, also of models with no scheduling rule; a rule’s min_replicas, pinned models and warm failover targets stay
memory_reclaimer_*Unload when this machine’s memory passes the thresholdUnload on each node whose memory passes its threshold, and keep (1 - threshold) of the node’s memory free when placing a model. Per node (threshold): a threshold set for one node also turns the reclaimer on there; 0.90 on unified-memory nodes when the cluster names no reclaimer setting
vram_budget (GPU memory budget)Cap of this machineCap of each worker that sets none of its own. Per node

The busy watchdog (watchdog_busy_*) still acts only on the backends that a frontend starts itself. In distributed mode a frontend’s own watchdog handles only the backends it started; the replicas on the workers are the cluster’s to unload.

Disk Prompt Cache Settings

The llama-cpp backend can keep the prompt cache of long prompts on disk, per user. See Disk Prompt Cache for what it stores and how long.

  • Keep long prompts on disk (prompt_cache_disk): on by default. Backends get a change when they next start
  • Keep entries for (prompt_cache_disk_ttl): time to keep an entry after its last use (default: 168h)
  • Share the cache between users (prompt_cache_disk_shared): one cache for all users (default: off)
  • Size cap (prompt_cache_disk_max_size_mib), Quota per user (prompt_cache_disk_user_quota_mib), Shortest prompt kept (prompt_cache_disk_min_tokens), Low free space (prompt_cache_disk_low_free_mib) and Critical free space (prompt_cache_disk_critical_free_mib): advanced limits. 0 is automatic for the size, the quota and the marks; -1 is no quota

In distributed mode these are cluster settings, like the memory settings: they are stored once in the database, every frontend applies them, and every worker gets them over the control channel. See Disk prompt cache across nodes.

The block also shows the size of the cache, the free disk, the cap in effect and the state of each node, and a Clear button that deletes the cache of every user and model.

Performance Settings

  • Threads: Number of threads used for parallel computation (recommended: number of physical cores)
  • Context Size: Context size for models that set no context_size of their own. A value in a model’s configuration always wins, and so does any value you set here over the automatic size. Unset (the default), a model that can serve chats gets 32768 tokens, capped by what it was trained for and by the memory of the machine, and other models get at most 8192. The chat needs at least 16384: see the context window a chat needs.
  • Concurrent Model Operations and Concurrent Backend Operations: How many model (or backend) installs, upgrades and deletes run at once (default: 2 each, minimum 1). 1 runs them one after the other. Operations on the same model (or backend) never overlap, whatever the value, and the others wait as queued and can be cancelled. Models and backends have their own queues, so neither holds up the other. Add-on installs and add-on upgrades share the backend queue and its limit; the add-on owner still runs one add-on operation at a time, so a second one waits for the first. The limits are per frontend, and a change applies to operations that start after it. In distributed mode the backend limit also bounds how many nodes receive one operation at the same time. The flags are --max-concurrent-model-operations and --max-concurrent-backend-operations
  • Artifact Download Concurrency: Maximum number of artifact files downloaded at once. 1 downloads sequentially (default: 1)
  • F16: Default to 16-bit float (f16) memory and KV cache for models whose config does not set f16
  • VRAM Budget: Cap on VRAM used for model allocation (for example 80% or 12GB; empty means no cap). See VRAM Management

Debug and Logging

  • Debug Mode: Enable debug logging (deprecated, use log-level instead)

API Security

  • CORS: Enable Cross-Origin Resource Sharing
  • CORS Allow Origins: Comma-separated list of allowed CORS origins. When CORS is explicitly enabled with a nonempty allowlist, matching origins are also trusted by CSRF protection for cross-site state-changing requests. Explicit wildcard patterns apply to both policies. The default permissive HTTP CORS policy does not bypass CSRF; authentication and permissions still apply.
  • CSRF: Enable CSRF protection middleware. Outside explicitly trusted CORS origins, cross-site browser requests are exempt only when the server successfully authenticates a credential from Authorization, x-api-key, or xi-api-key. Supplying an arbitrary header when authentication is disabled does not bypass protection; cookie authentication also does not grant this exemption. Requests without Sec-Fetch-Site (such as CLI clients) remain allowed by this middleware.
  • API Keys: Manage API keys for authentication (one per line or comma-separated)
  • Offers from the assistant (chats_suggestions, default on, applies at once): the default for users who did not choose. On, the assistant may offer, at most once a day and once a chat, never in the first turns or during a task, to remember a name or bio, make a shortcut, or update a Home widget on a schedule. A user’s own switch (Account, About you and the assistant, Help and suggestions) wins. See Make LocalAI yours.
  • MCP connectors may reach private networks (mcp_connectors_allow_private, default off, applies at once): lets the MCP servers that users add as connectors use addresses on private networks (this machine, link-local, private ranges, cloud metadata). Off, a connector reaches only public hosts, and the check is made when the connection is opened, on every address and every redirect. Turn it on only if your users are trusted: a connector can then probe the internal network through the server.
  • Incognito chats (incognito, allow or forbid, default allow, applies at once): whether people can start incognito chats in the web UI. With forbid the switch is hidden and the server answers 403 to an incognito request of the web page. API keys never get incognito.
  • Highest incognito level (incognito_max_level, memory-off or zero-retention, default zero-retention, applies at once): the highest level the server honours. Pick memory-off when you need audit logs and traces of every chat.

For multi-user authentication with roles, OAuth, and usage tracking, see Authentication & Authorization.

P2P Settings

The P2P layer: p2p_mode (off, connect or share), p2p_public_dht, p2p_bootstrap_peers, p2p_relays, p2p_relay_paired, p2p_relay_mode, p2p_relay_rate_limit and p2p_mdns. Mode share is refused while authentication is off, and every mode but off is refused without a data path. A change of one of them restarts the P2P layer. See P2P.

Manage model and backend galleries:

  • Model Galleries: a read-only list of the model library sources, with name, id, address, state, whether it is a default, and its mirrors. Change them in the Manage libraries panel of the Models page (see Gallery mirrors)
  • Backend Galleries: the same read-only list for backend library sources; change them in the Manage libraries panel of the Backends page
  • Load and pre-warm galleries on boot: Load model galleries and pre-warm their remote size and VRAM estimates when LocalAI starts. Disable this setting to skip both startup operations.
  • Autoload Backend Galleries: Automatically load backend galleries on startup

Chats and Collections Settings

Configure the collections (the knowledge base) and the models the chats use for media:

  • Collections: Enable or disable the collections service (the Knowledge page)

  • Default model for collections: Default LLM model of the collections service

  • Chat image model (chats_vision_model, default empty, applies at once): the model the chats use to describe an image (describe_image). Empty, or a model that is not installed: the chat’s own model when it can look at images, else the first installed model, by name, that can.

  • Chat transcription model (chats_transcription_model, default empty, applies at once): the model the chats use to transcribe audio. Empty, or a model that is not installed: the first installed model, by name, that can transcribe.

  • Embedding Model: Model used for knowledge base embeddings (default: granite-embedding-107m-multilingual)

  • Max Chunking Size: Maximum chunk size for document ingestion (default: 400)

  • Chunk Overlap: Overlap between document chunks (default: 0)

  • Collection DB Path: Custom path for the collections database

  • Shared pages (shared_pages_enabled, default on): lets users open the pages of the shared folders they have access to. Each user still allows each page before it runs. It applies at once: off, the pages are listed but do not open, and an open shared page stops at its next action. Start with LOCALAI_DISABLE_SHARED_PAGES=true to have it off from the start.

  • Pages that people share (user_page_shares_enabled, default on): lets users share one of their own pages with other accounts. It is separate from Shared pages, which covers the folders that an administrator shares. It applies at once. When it is off, nobody can share a page or search for people to share with (409 sharing_disabled), the pages that people already shared are listed as turned off and do not open, and an open page stops at its next action. Owners can still take their shares back, and the files are kept. Start with LOCALAI_DISABLE_USER_PAGE_SHARES=true to have it off from the start.

  • Page area on Home (home_page_area_enabled, default on): lets users show one of their pages below the composer on Home (pageArea in home.json). It applies at once: off, Home ignores pageArea and the area says an administrator turned it off. The files and pages are kept. Start with LOCALAI_DISABLE_PAGE_AREA=true to have it off from the start.

Tools

The Tools tab lists the built-in chat tools, from GET /api/chats/admin/tools: bash, web_search, web_fetch, list_agents and the two LocalAI groups (localai_client, localai_admin). An add-on may replace each of the first three. Each row says who serves the tool now (built-in, or an add-on) and has its switch:

  • Commands on this machine (chats_host_exec, off, ask or on, applies at once; LOCALAI_CHATS_HOST_EXEC): who gets the chats’ built-in bash when no Sandbox add-on serves bash. It runs commands directly on this machine with no isolation and with its network: they can read what LocalAI can read and reach the internet, your network and the LocalAI API. ask gives it to administrators, and each command waits for their yes in the chat; on gives it to every user with no card. Empty is the default: off with accounts, ask without. Every command is audited. See Commands on this machine.
  • Web search (chats_web_search, default on, applies at the next turn; its row in the tab) and Read web pages (chats_web_fetch, default on; its row in the tab): offer the built-in web_search and web_fetch tools to chats. See Web search and web pages in chats.
  • LocalAI client tools (chats_localai_client, default on, applies at the next turn; its row in the tab) and LocalAI admin tools (chats_localai_admin, default on; its row in the tab): offer the chats the LocalAI Assistant’s tool groups. The client group runs inference for every user within their permissions; the admin group manages this server and is for administrators, who switch it on per chat or per saved agent. If the deprecated LOCALAI_DISABLE_ASSISTANT variable or --disable-local-ai-assistant flag is set, the admin group stays off and this setting cannot turn it on until you remove them.
  • Load LocalAI tools on demand (chats_tool_search, auto, on or off, default auto, applies at the next turn): send the model tool_search, tool_describe and tool_call in place of the two LocalAI tool groups, and of the tools that add-ons mark as deferred (each source is decided on its own schemas). auto does it when the schemas of a source reach a tenth of the model’s context window, on always, off never. With on, the tools of the user’s MCP connectors load on demand as well. See Tool search.
  • Saved agents in chats (chats_saved_agents, default on, applies at the next turn; its row in the tab): let a chat list your saved agents (list_agents) and start one as a sub-agent. Each chat must still switch it on in its Tools menu, and the user needs the agents feature. See Saved agents as sub-agents.
  • Work folder for helper files (chats_work_folder, default on, applies at the next turn): name each chat’s work folder (Chats/<chat>/work/) at every turn, start every shell in it with its path in $WORK, so the scripts, logs and drafts the model makes go there and not next to your files, and add a one-line nudge when a helper file is saved elsewhere. Off: no steering; the Files pane of a chat still shows working files apart. See Working files and the work folder.
  • Search inside documents (chats_index_files, default on, applies at once): read the text of PDF, Word, Excel and PowerPoint files when they are uploaded or written, so file search and the chats’ search_files find a document by what it says. Off: nothing new is read, and text read before is still used for files that did not change. See Search inside documents.
  • Text kept per document (chats_index_max_text_bytes, default 2097152, 65536 to 16777216, applies at once): the most text the index keeps for one document. Text past it is not searched; read_file in a chat still reads the whole document.
  • Extract: most bytes per archive (chats_extract_max_bytes, default 1073741824, 1048576 to 68719476736, applies at once): the most data one archive may expand to when a user chooses Extract here on the Files page. It is counted on the bytes that are really read. An archive over the limit is refused and nothing is written.
  • Extract: most entries per archive (chats_extract_max_entries, default 20000, 1 to 1000000, applies at once): the most files and folders one archive may have. An archive over the limit is refused and nothing is written.
  • Extract: allow 7z and RAR (chats_extract_7z_rar, default off, applies at once): let Extract here open 7z and RAR archives. Their readers run in the server and cannot limit their memory, so a crafted file can stop the server. Turn it on only when you trust the users who can upload files. See Extract an archive.
  • SearXNG instance (chats_web_searxng_url, default empty): the address of your SearXNG instance. With no provider order set, web_search then uses SearXNG alone. The instance must allow the JSON format.
  • Search providers (chats_web_search_providers, default empty): the providers of web_search in the order they are tried, comma separated: searxng, duckduckgo, brave_html, bing_html. Leave one out to never use it. Empty: searxng when an instance is set, else duckduckgo,brave_html,bing_html. An unknown name is refused. Test search on the web_search row says what each provider did (ok, challenged by a bot check, blocked, no results). See Search providers.
  • Web pages may be on private networks (chats_web_allow_private, default off): let web_fetch reach addresses inside your network. The cloud metadata addresses stay refused. Turn it on only if you trust every user of chats.
  • Ports for web pages (chats_web_ports, default 80,443): the ports web_fetch may use, comma separated. A value that is not a list of ports is refused.
  • Command network (applies at the next connection of a command). The commands a chat runs in isolation reach the network only through the proxy of the add-on that runs them, and these settings bound it. They are on the Settings tab of the add-on that runs the commands (its network-policy host control), not on this page; chats_egress_audit_days is on both, since it also keeps the audit of the commands on this machine. They do not apply to commands on this machine (chats_host_exec), which have the network of the server. See Network access.
    • chats_egress_ceiling (off, registries or all; all on a fresh official Sandbox install): the widest preset any chat may use. registries (called Custom in the chat’s Network row) admits the package registries and the hosts of chats_egress_extra_registries and chats_egress_allowed_hosts; all admits every public host. A chat chooses its own preset up to this.
    • chats_egress_default (off, registries or all; all on a fresh official Sandbox install): the preset a new chat starts with, capped by the ceiling.
    • chats_egress_allow_private (default off): let a host that an administrator allowed, by a rule or a card answer, reach addresses inside your network. A preset alone never does, and the cloud metadata addresses and the server’s own addresses stay refused. Turning it on needs chats_egress_private_confirm in the same request, with the phrase I understand that commands can reach my private network; the phrase is not stored. The add-on’s Settings tab asks for it. With add-ons enabled the add-on owner checks the same phrase, so a direct host-settings-update call needs chats_egress_private_confirm in its patch too.
    • chats_egress_ports (default 80,443): the ports a command may reach, comma separated. This global list cannot include 22 or 25. To allow one endpoint on either port, use an exact destination instead.
    • chats_egress_allowed_destinations (default empty, owner settings): a map from add-on ID to a comma-separated list of exact DNS host:port pairs on TCP ports 1–65535. For example, {"runbox":"git.example.com:22,git.example.com:8080"} grants those endpoints only to the authenticated runbox provider when it declares network.exactDestinations. A patch replaces the map; omit a provider to revoke its grants, or send {} to clear all grants. The total limit is 64 endpoints and 8192 bytes of keys and list values. Global allowed ports are unchanged. See Sandbox network access for proxy requirements and chat denials.
    • chats_egress_extra_registries (default empty): exact host names added to the package registries, comma separated, at most 64; for example an internal mirror (which also needs the private switch, since its address is private). No patterns. They count as registries: a chat reaches them on HTTPS with the Package registries choice, and on any request with All public sites.
    • chats_egress_allowed_hosts (default empty): exact host names or whole-label wildcard patterns an administrator allows, comma separated, at most 64. Each entry is a host name, or host:port to allow that one port (the ports setting still applies); names are lower-cased and written in punycode, and a partial-label pattern, a scheme, a path or an IP address outside the public internet is refused (an IP literal of a private network is accepted only while chats_egress_allow_private is on, and then still needs a rule or a card answer from an administrator like any private address). A listed host is allowed, on any kind of request, in every chat whose effective preset is Package registries or All public sites, with no card. With the network off, or with the limit (chats_egress_ceiling) off, the list does nothing, and a limit below a chat’s choice caps it as for the presets. Private, loopback, link-local, metadata and server addresses stay refused unless the private switch rules allow them, the TLS server name is still checked (on any port, when the tunnel starts with TLS), and every use is audited with the reason allowed_host. A change applies at the next check (an allow the proxy cached lives at most 30 seconds). The add-on’s Settings tab has a list editor next to the extra registries, and the Network panel of a chat shows the list read only. get_chat_egress of the LocalAI Assistant returns it as allowed_hosts; no assistant tool changes it. Patterns are *.example.com (descendants at any depth, not the apex) and * (public destinations only), optionally pinned to an exact port. They normalize IDNA, case and trailing dots. Wildcard ports and partial-label globs are refused; extra registries remain exact. Unlike the legacy exact-host exception, wildcard grants cannot exceed the ceiling: registries requires a listed registry over TLS, all permits public sites, and off blocks everything. Private access is never granted by a wildcard, even with the private switch on.
    • Settings > Tools and POST /api/settings refuse a bad value of chats_egress_ports, chats_egress_extra_registries or chats_egress_allowed_hosts with the reason, and a runtime settings file with one keeps the value in force. A bad value that reaches a frontend another way (a hand edit, a value a newer version reads more strictly) neither empties nor widens the list: the frontend keeps the last valid value it used and logs a warning once. A frontend that never saw a valid value uses the default (no hosts, ports 80,443). The last valid value is kept in the memory of each frontend.
    • chats_egress_audit_days (1 to 365, default 30): how long the audit of the network requests, and the audit of the commands run on this machine (chats_host_exec), keep a line. A value of 0 means a setting never set, and the page shows 30 days.
  • Jobs from a paired client (client_jobs_allow_all_tools, default off, applies to jobs that already run; set it with POST /api/settings or in the runtime settings file, because Settings > Tools has no control for it and it has no environment variable): a job that an add-on starts for a paired client reads and reports only. Turn this on to let such jobs use the write and act tools that the agent of their task is set up with, as an ordinary job of that task may. It never gives a grant the agent does not hold. It does not change jobs that people or triggers start.
  • Automations run without approval (automations_skip_approvals, default off, applies to the next step of every run; also --automations-skip-approvals and LOCALAI_AUTOMATIONS_SKIP_APPROVALS, which then hold the value): an automation step that can send or delete asks a person before it runs, and an agent step asks before each such call. Turn this on to let them run without asking. Each automation that would have asked says so, and each skipped approval is written to the log of its run. Only an administrator changes it, in Settings > Tools. Each frontend reads its own runtime settings, and the frontend that leads the triggers decides, so set the same value on every frontend of a cluster (the option does that). See Approvals.
  • Add-on tools per chat (chats_addon_tool_limit, 16 to 256, default 64, applies at once, with no restart): the most add-on tools one chat is offered. Every tool is described to the model on every turn, so a higher limit costs model context and can make the model choose worse; the floor keeps room for the tools that replace a built-in one (such as the shell) and a few add-ons. Each add-on can offer at most 32 tools whatever this says. The limit applies to the add-ons a chat uses: an add-on switched off in the chat, or not granted by the chat’s saved agent, takes no room. Tools that replace a built-in chat tool come first, then the rest in add-on ID order. When tools are left out, the server logs a warning once (the limit, how many tools were cut and the add-on IDs), and the Tools menu of the chat tells the person which add-ons lost tools, with a link to this setting for an administrator. A value out of range is refused by POST /api/settings.
  • Steps per chat turn (chats_max_iterations, 1 to 500, default 40, applies at the next turn): how many rounds of tool calls the model may make in one chat turn before it must answer. This covers chats, saved agents, triggers and connector turns. A turn that reaches the limit shows as Paused with a Continue button (see The status line). A model whose configuration sets agent.max_iterations uses its own limit.
  • Automatic turns per goal (chats_goal_max_turns, 1 to 200, default 20, applies when a turn ends): how many turns a chat with a goal may start by itself before the goal pauses. Resuming the goal starts a new count (see Goals).
  • Steps per goal (chats_goal_max_steps, 1 to 10000, default 400, applies when a turn ends): how many rounds of tool calls all the turns of one goal may make together before the goal pauses.
  • Loops of the chats (apply at once; see Loops):
    • chats_loop_min_interval (a duration from 30s to 24h, default 1m): the shortest interval of a loop, and the shortest wait a self-paced loop may ask for.
    • chats_loop_daily_runs (1 to 100000, default 200): how many loop runs one user may start in a UTC day, over all their loops. The wake-up of a wait counts as a run. After that the loops wait for the next day.
    • chats_loop_max_per_chat (1 to 20, default 3): how many loops and waits that are not ended one chat may have. Waits count too.
    • Under Advanced in Settings > Tools:
      • chats_loop_max_per_user (1 to 200, default 10): how many loops and waits that are not ended one user may have, over all their chats.
      • chats_loop_max_runs (1 to 10000, default 100): the runs after which a loop ends. In a chat that a connector, a trigger, a job or a page started, a loop ends after a fifth of this, at least 1 (20 with the default). The page shows that number under the field.
      • chats_loop_daily_script_checks (1 to 100000, default 1500): how many checks of waits on a command one user may spend in a UTC day, over all their waits. A check starts a process and calls no model, so this budget is apart from chats_loop_daily_runs. When it is used up, the wait ends and the model is told that the condition is not known.
  • Triggers of the chats (apply at once; see Triggers):
    • chats_trigger_run_limit (a duration from 1m to 24h, default 15m): the longest one trigger run may take. A longer run is stopped and fails. A trigger can set a shorter time limit of its own (run_limit); this setting is the ceiling, so a trigger that asks for more runs at this one. A change applies to the runs that start after it and to the check of a run that is found running after a restart.
    • chats_trigger_max_per_user (1 to 1000, default 50): how many triggers a user may have. A user who has more keeps them but cannot add another.
    • chats_trigger_max_daily_cap (1 to 1000, default 1000): the highest daily limit one trigger may have. A trigger with a higher limit runs at this one.
  • Add-ons that replace a built-in tool (chats_tool_providers, a map such as {"bash": "sandbox", "xlsx": "office"}, applies at once): when several add-ons replace one tool, the one that serves it. The keys are the replaceable tools (bash, web_search, web_fetch) and the replaceable built-in skills (xlsx, docx, pptx, pdf). A chosen add-on that cannot serve a chat (stopped, off for the chat) leaves the name to the built-in, not to another add-on. With none chosen, the add-on installed first serves (ties go by add-on ID), and the tab marks it as the default and says that you should choose. See Tools that replace a built-in tool.

Plugins

The settings of the plugins compatible with the Claude Code plugin format. They apply at once.

  • Personal plugin installs (plugins_user_installs, default on): users can install plugins that run no code for themselves.
  • Plugin agent models (plugins_model_tiers, a map such as {"opus": "qwen3-32b"}, default {}): the model of each agent tier of the format. The keys are haiku, sonnet and opus; another key or an empty model refuses the whole map. An unmapped tier uses the chat’s model.
  • Hook timeout (plugins_hook_timeout_seconds, default 60, 1 to 600): the longest one hook handler may run.
  • Plugin size (plugins_max_bytes, default 20971520, 1048576 to 209715200): the largest size of the files of one plugin.

Note: Most collection settings require a restart to take effect. The settings of the removed agent pool, agent jobs and agent hub (agent_job_retention_days, agent_pool_enable_logs, agent_pool_agent_hub_url and the like) are ignored when found in runtime_settings.json.

Configuration Persistence

All settings are automatically saved to runtime_settings.json in the LOCALAI_CONFIG_DIR directory (default: BASEPATH/configuration, where BASEPATH is the current folder on Linux and macOS, %LOCALAPPDATA%\LocalAI on Windows, or LOCALAI_BASE_PATH when it is set). This file is watched for changes, so modifications made directly to the file will also be applied at runtime.

In distributed mode most settings are stored once for the cluster instead, and each frontend keeps only its own process settings in this file. See Other settings across frontends.

Settings Precedence

Every runtime setting follows a single precedence rule:

  1. Environment variables and CLI flags (highest priority)
  2. Configuration files (runtime_settings.json, api_keys.json)
  3. Default values (lowest priority)

The same rule is applied identically in all three places where settings can change:

  • At boot: values persisted in runtime_settings.json fill in every setting that was not explicitly set via an environment variable or CLI flag.
  • On POST /api/settings (the web UI Settings page): if a setting is controlled by an environment variable, it cannot be modified through the web interface. The settings page will indicate when a setting is controlled by an environment variable.
  • On manual file edits: the configuration watcher hot-applies edits to runtime_settings.json with the same env-over-file semantics as boot, so editing the file by hand behaves like restarting with that file. For example, hand-editing vram_budget installs the new VRAM allocation cap live, without a restart.

In distributed mode this rule holds only for the settings of each frontend. For the cluster settings the environment does not win: the stored cluster value applies on every frontend, and the environment only fills in keys the cluster does not hold yet, or keeps a stricter security value on its own frontend. See Other settings across frontends.

Known Limitations

  • An environment variable explicitly set to its default value is indistinguishable from an unset one, so the value from runtime_settings.json wins in that case. In particular, an explicit LOCALAI_THREADS=0 behaves like an unset LOCALAI_THREADS.
  • A field previously changed via the API (or the web UI) looks environment-set to the file watcher, so a manual file edit of that same field is not hot-applied: it takes effect on the next restart.

Example Configuration

The runtime_settings.json file follows this structure. The galleries and backend_galleries entries are the built-in defaults, including the signature check (artifact_verification). If you copy the example, keep that block, or the gallery index is no longer verified. "csrf": false means the disable flag is off, so CSRF protection is on.

{
  "watchdog_enabled": true,
  "watchdog_idle_enabled": true,
  "watchdog_busy_enabled": false,
  "watchdog_idle_timeout": "15m",
  "watchdog_busy_timeout": "5m",
  "max_active_backends": 0,
  "force_eviction_when_busy": false,
  "lru_eviction_max_retries": 30,
  "lru_eviction_retry_interval": "1s",
  "threads": 8,
  "context_size": 2048,
  "artifact_download_concurrency": 4,
  "max_concurrent_backend_operations": 2,
  "max_concurrent_model_operations": 2,
  "f16": false,
  "debug": false,
  "cors": true,
  "csrf": false,
  "cors_allow_origins": "*",
  "galleries": [
    {
      "url": "https://index.localai.io/models",
      "mirrors": [
        "github:mudler/LocalAI/gallery/index.yaml@master",
        "oci://quay.io/go-skynet/local-ai-backends:gallery-models"
      ],
      "name": "localai",
      "artifact_verification": {
        "issuer": "https://token.actions.githubusercontent.com",
        "identity": "https://github.com/mudler/LocalAI/.github/workflows/gallery_publish.yml@refs/heads/master"
      }
    }
  ],
  "backend_galleries": [
    {
      "url": "https://index.localai.io/backends",
      "mirrors": [
        "github:mudler/LocalAI/backend/index.yaml@master",
        "oci://quay.io/go-skynet/local-ai-backends:gallery-backends"
      ],
      "name": "localai",
      "artifact_verification": {
        "issuer": "https://token.actions.githubusercontent.com",
        "identity": "https://github.com/mudler/LocalAI/.github/workflows/gallery_publish.yml@refs/heads/master"
      }
    }
  ],
  "autoload_galleries": true,
  "autoload_backend_galleries": true,
  "vram_persistent_cache": true,
  "api_keys": []
}

API Keys Management

API keys can be managed through the runtime settings interface. Keys can be entered one per line or comma-separated.

Important Notes:

  • API keys from environment variables are always included and cannot be removed via the UI
  • Runtime API keys are stored in runtime_settings.json
  • For backward compatibility, API keys can also be managed via api_keys.json. Like environment keys, they cannot be removed via the UI: a save leaves them out of runtime_settings.json. Remove them from api_keys.json
  • The keys in force are the environment keys, the keys of api_keys.json and the runtime keys. A change of one source changes only its own keys: editing api_keys.json keeps the runtime keys, and a key removed from one source does not come back when another file changes
  • Empty arrays will clear all runtime API keys (but preserve environment variable keys)

Dynamic Configuration

The runtime settings system supports dynamic configuration file watching. When LOCALAI_CONFIG_DIR is set, LocalAI monitors the following files for changes:

  • runtime_settings.json - Unified runtime settings
  • api_keys.json - API keys (for backward compatibility)
  • external_backends.json - External backend configurations

Changes to these files are automatically detected and applied without requiring a restart, using the same precedence rule described in Settings Precedence.

Best Practices

  1. Use Environment Variables for Production: For production deployments, use environment variables for critical settings to ensure they cannot be accidentally changed via the web UI.

  2. Backup Configuration Files: Before making significant changes, consider backing up your runtime_settings.json file.

  3. Monitor Resource Usage: When enabling watchdog features, monitor your system to ensure the timeout values are appropriate for your workload.

  4. Secure API Keys: API keys are sensitive information. Ensure proper file permissions on configuration files (they should be readable only by the LocalAI process).

Troubleshooting

Settings Not Applying

If settings are not being applied:

  1. Check if the setting is controlled by an environment variable
  2. Verify the LOCALAI_CONFIG_DIR is set correctly
  3. Check file permissions on runtime_settings.json
  4. Review application logs for configuration errors

Watchdog Not Working

If the watchdog is not functioning:

  1. Ensure “Watchdog Enabled” is turned on
  2. Verify at least one of the idle or busy watchdogs is enabled
  3. Check that timeout values are reasonable for your workload
  4. Review logs for watchdog-related messages

P2P Not Starting

If P2P is not starting:

  1. Check p2p_mode: share needs authentication, and every mode but off needs a data path or --p2p-identity
  2. Check network connectivity
  3. Review logs for P2P-related errors

See P2P. The old P2P token, network ID and federated mode are removed: see Moving from the old P2P network.