These options configure the LocalAI server process. To configure an individual
model, see Model Configuration.
Note: You can set every flag with an environment variable. A flag on the command line wins over its environment variable, and the environment variable wins over the built-in default. See .env files for configuration file support.
Global Flags
Parameter
Default
Description
Environment Variable
-h, --help
Show context-sensitive help
--log-level
info
Set the level of logs to output [error,warn,info,debug,trace]
$LOCALAI_LOG_LEVEL
--log-client
false
local-ai run only. Add duration, remote (the TCP peer address, or the real client when the peer is a trusted proxy), user_agent (control characters replaced, cut to 80 characters), and request_id (when the request has one) to the HTTP request log line, so you can tell who sent a request that was refused. Forwarding headers are read only from a peer listed in --trusted-proxies, so behind a reverse proxy the address is the proxy address until you set it. Authorization headers, cookies, query strings and bodies are never logged.
$LOCALAI_LOG_CLIENT
--trusted-proxies
Comma-separated IP addresses and CIDR ranges of the reverse proxies in front of LocalAI. When the TCP peer is in the list, the client address is the right-most X-Forwarded-For entry that is not itself in the list (X-Real-Ip is used when there is no X-Forwarded-For). Otherwise it is the peer. Empty (the default) trusts nobody. The address is used by the access log, the login and registration rate limits and the API traces. The X-Forwarded-Proto, X-Forwarded-Host, X-Forwarded-Prefix and Forwarded headers, which set the scheme, host and prefix of links and redirects and the path of the Web UI <base href>, are also believed only from a trusted peer. See Running behind a proxy. An invalid value stops startup.
These options apply only to local-ai run, including distributed frontends.
Diagnostics state is per-instance, not shared between replicas. Debug logging enables neither feature.
The profiling listener is separate from the public API and accepts only numeric loopback addresses with explicit ports.
--preload-backend-only validates these options but does not start profiling or sampling.
Parameter
Default
Description
Environment Variable
--pprof
false
Enable the private loopback profiling listener
$LOCALAI_PPROF
--pprof-address
127.0.0.1:6060
Numeric loopback IP and port (1–65535), including bracketed IPv6; validated even when disabled
Nonnegative block sampling rate in nanoseconds; nonzero requires pprof
$LOCALAI_PPROF_BLOCK_PROFILE_RATE
--request-phase-timing
false
Emit sanitized phase timing at Info, independently of pprof; warn/error filtering suppresses events
$LOCALAI_REQUEST_PHASE_TIMING
Sampling adds overhead. The process applies configured rates once and resets them to zero on shutdown.
There is no runtime toggle, continuous capture, or public API route for diagnostics.
The private listener has no authentication: other processes in the same network namespace can access profiles.
Profiles can contain secrets; protect captured files. The /debug/pprof/cmdline endpoint is unavailable.
Shutdown allows five seconds for cleanup, then force-closes profiling connections.
Existing application initialization operations may not promptly observe cancellation.
The signal callback still returns after its cleanup budget expires.
If initialization fails without returning an application handle, this lifecycle cannot shut down resources created inside that failed initialization.
Application shutdown has no context parameter; work that ignores cancellation can outlive the cleanup budget.
Storage Flags
BASEPATH in the defaults below is the current folder on Linux and macOS, and %LOCALAPPDATA%\LocalAI on Windows. Set LOCALAI_BASE_PATH to use another folder on any system: it moves every default that starts with BASEPATH at once. A flag or a variable of one folder still wins over it. LOCALAI_BASE_PATH is a variable and not a flag, because the defaults of all flags are set before the command line is read. You can put it in an env file. See Install on Windows for the Windows folders.
Parameter
Default
Description
Environment Variable
--models-path
BASEPATH/models
Path containing models used for inferencing
$LOCALAI_MODELS_PATH, $MODELS_PATH
--download-staging-path
BASEPATH/downloading
Path where in-flight downloads are staged before extraction
Path for persistent data (the files of the chats, their conversion marks, the old files that the start-up converts, the JSON stores of the chats, saved agents, triggers and connectors when there is no database, collections and agent jobs). Separates mutable data from configuration. --data-path=- keeps nothing on disk: the chats then live in memory and files are off (an empty value means the default)
$LOCALAI_DATA_PATH
--generated-content-path
TMPDIR/localai-UID/generated/content
Location for assets generated by backends (e.g. stablediffusion, images, audio, videos). Defaults under the OS temp dir ($TMPDIR, falling back to /tmp), scoped to the current user’s UID so accounts sharing a host never collide.
Path to store uploads from files API. Defaults under the OS temp dir ($TMPDIR, falling back to /tmp), scoped to the current user’s UID.
$LOCALAI_UPLOAD_PATH, $UPLOAD_PATH
--localai-config-dir
BASEPATH/configuration
Directory for dynamic loading of certain configuration files (currently runtime_settings.json, api_keys.json, and external_backends.json). See Runtime Settings for web-based configuration.
$LOCALAI_CONFIG_DIR
--localai-config-dir-poll-interval
Time duration to poll the LocalAI Config Dir if your system has broken fsnotify events (example: 1m)
$LOCALAI_CONFIG_DIR_POLL_INTERVAL
| --models-config-file | | YAML file containing a list of model backend configs (alias: --config-file) | $LOCALAI_MODELS_CONFIG_FILE, $CONFIG_FILE |
| --addon-host-ops | fine-tuning=finetune.,quantization=quantize.,sandbox=workspace.,sandbox=egress.,office=workspace.,web=workspace.,telegram=connector. | Add-ons that may call host operations, as a comma list of addon-id=operation-prefix. An add-on that is not listed gets no host operation channel; an empty value lists none. See Host operations | $LOCALAI_ADDON_HOST_OPS |
| --addons-role | combined | How this process takes part in the add-on owner: combined (the node is its own owner), owner or frontend. See Turning the owner on or off | $LOCALAI_ADDONS_ROLE |
| --addons-owner-address | | https://host:port of the add-on owner carrier, with no path. Required for the owner and frontend roles | $LOCALAI_ADDONS_OWNER_ADDRESS |
| --addons-owner-listen | | owner role only: the address the carrier listens on. Empty listens on all interfaces, on the port of --addons-owner-address | $LOCALAI_ADDONS_OWNER_LISTEN |
| --addons-carrier-dir | | Directory with the carrier key set from local-ai util addons-carrier-keys. Required for the owner and frontend roles | $LOCALAI_ADDONS_CARRIER_DIR |
| --addons-enabled | true | Run the add-on owner. --addons-enabled=false turns add-ons off completely. See The addons feature gate | $LOCALAI_ADDONS_ENABLED |
| --addons-ownership-mode | local-owner without authentication, named-user with it | named-user gives each account its own access to add-ons; local-owner makes every caller share one owner | $LOCALAI_ADDONS_OWNERSHIP_MODE |
| --auto-upgrade-addons | false | Upgrade installed add-ons on their own when a newer version appears in their library | $LOCALAI_AUTO_UPGRADE_ADDONS |
| --addons-official-library | true | Register the official add-on library on the first start | $LOCALAI_ADDONS_OFFICIAL_LIBRARY |
| --addons-backend-library | true | Register the backend library on the first start | $LOCALAI_ADDONS_BACKEND_LIBRARY |
| --addons-backend-max-bytes | 8589934592 | Largest compressed size, in bytes, of a backend image installed from a library | $LOCALAI_ADDONS_BACKEND_MAX_BYTES |
| --plugin-marketplaces | | Marketplaces of plugins in the Claude Code plugin format that a fresh server gets instead of the curated LocalAI marketplace: comma-separated owner/repo, https git URLs or httpsmarketplace.json URLs, each optionally id=source. Read at the first start only. See Plugins | $LOCALAI_PLUGIN_MARKETPLACES |
| --addons-wsl-distro | | Windows only: the WSL 2 distribution that runs the add-ons whose package runs in WSL 2 (osSettings.windows.execution wsl2). Empty uses the default distribution of WSL | $LOCALAI_ADDONS_WSL_DISTRO |
| --max-concurrent-model-operations | 2 | How many model install, upgrade and delete operations run at once. 1 runs them one after the other. Operations on the same model never overlap. See Runtime Settings | $LOCALAI_MAX_CONCURRENT_MODEL_OPERATIONS |
| --max-concurrent-backend-operations | 2 | How many backend install, upgrade and delete operations run at once. 1 runs them one after the other. Operations on the same backend never overlap. In distributed mode it also bounds how many nodes one operation is sent to at the same time. See Runtime Settings | $LOCALAI_MAX_CONCURRENT_BACKEND_OPERATIONS |
| --artifact-download-concurrency | 1 | How many files of a model artifact to download at once. 1 downloads sequentially. Raising it helps artifacts split into many files on a fast link, at the cost of more concurrent load on the models volume. Whole files only: a single file is never split, so resume and per-file checksum verification are unaffected | $LOCALAI_ARTIFACT_DOWNLOAD_CONCURRENCY |
Backend processes receive a private scratch directory through TMPDIR, TMP,
and TEMP. LocalAI removes that directory when the backend exits and removes
abandoned directories left by a LocalAI crash before starting another backend.
Set $LOCALAI_BACKEND_TEMP_DIR to choose their base volume. LocalAI always
appends localai-UID/backend-runtime; the default base is TMPDIR.
Maximum number of active backends (loaded models). When exceeded, the least recently used model is evicted. Set to 0 for unlimited, 1 for single-backend mode
Unload the least recently used idle model to make room for another. With --no-model-swap the request waits for the LRU retry window, then gets 503 with Retry-After
$LOCALAI_MODEL_SWAP, $MODEL_SWAP
--upgrade-run-keep
200
Most finished upgrade runs kept; the oldest beyond it are removed. -1 keeps any number
$LOCALAI_UPGRADE_RUN_KEEP
--upgrade-run-retention-days
30
Days to keep finished upgrade runs. -1 keeps them forever
$LOCALAI_UPGRADE_RUN_RETENTION_DAYS
--model-load-failure-cooldown
10s
After a model load fails, refuse new load attempts for that model for this long (HTTP 503 + Retry-After) so a client polling a broken model doesn’t respawn a crashing backend every request. Doubles per consecutive failure up to 5m; reset on success. 0 disables
Cap the VRAM LocalAI may use for model allocation, as a percentage (80%) or an absolute amount (12GB). Empty uses all detected VRAM
$LOCALAI_VRAM_BUDGET
--vram-total
Total VRAM of this node as an absolute amount (40GB, 48GiB). Replaces GPU detection; use it when the detected VRAM is wrong. --vram-budget is then a share of this total. Empty uses detection
Keep the prompt cache of long llama.cpp prompts on disk under --prompt-cache-path, else <data-path>/prompt-cache, per user. See Disk Prompt Cache
$LOCALAI_PROMPT_CACHE_DISK
--prompt-cache-path
(empty)
Directory of the disk prompt cache. Give a directory on a local disk. Empty: <data-path>/prompt-cache. On a network disk, or when it is not writable, the cache is off
$LOCALAI_PROMPT_CACHE_PATH
--prompt-cache-disk-max-size-mib
0
Size cap of the disk prompt cache of this node. 0 is the smaller of 20 GiB and a tenth of the free disk at start
$LOCALAI_PROMPT_CACHE_DISK_MAX_SIZE_MIB
--prompt-cache-disk-ttl
168h
Time to keep an entry after its last use
$LOCALAI_PROMPT_CACHE_DISK_TTL
--prompt-cache-disk-user-quota-mib
0
Most MiB one user may keep. 0 is an equal share of the cap when there is more than one user, -1 is no quota
$LOCALAI_PROMPT_CACHE_DISK_USER_QUOTA_MIB
--prompt-cache-disk-min-tokens
1024
Shortest prompt that is written to disk
$LOCALAI_PROMPT_CACHE_DISK_MIN_TOKENS
--prompt-cache-disk-shared
false
One disk prompt cache for all users
$LOCALAI_PROMPT_CACHE_DISK_SHARED
--prompt-cache-disk-low-free-mib
0
Free disk under which the cache pauses and shrinks. 0 is the larger of 15% of the disk and 10 GiB
$LOCALAI_PROMPT_CACHE_DISK_LOW_FREE_MIB
--prompt-cache-disk-critical-free-mib
0
Free disk under which the cache is disabled. 0 is 5% of the disk
$LOCALAI_PROMPT_CACHE_DISK_CRITICAL_FREE_MIB
--preload-models
A list of models to apply in JSON at start
$LOCALAI_PRELOAD_MODELS, $PRELOAD_MODELS
--models
A list of model configuration URLs to load
$LOCALAI_MODELS, $MODELS
--preload-models-config
A list of models to apply at startup. Path to a YAML config file
Note: You can also pass model configuration URLs as positional arguments: local-ai run MODEL_URL1 MODEL_URL2 ...
Performance Flags
Parameter
Default
Description
Environment Variable
--f16
false
Default to 16-bit float (f16) memory and KV cache for models whose config does not set f16
$LOCALAI_F16, $F16
-t, --threads
Automatic
Number of threads used for parallel computation. See the default thread count below
$LOCALAI_THREADS, $THREADS
--context-size
Context size for models that set no context_size (-1 = each model’s full trained context from GGUF metadata). Unset: automatic, 32768 for a model that can serve chats (capped by its trained window and by memory), at most 8192 for other models
$LOCALAI_CONTEXT_SIZE, $CONTEXT_SIZE
Default thread count
When the server thread setting is unset or zero, LocalAI selects the smaller
of the physical core count and Go’s current GOMAXPROCS value at startup.
The result is at least one thread.
By default, Go accounts for CPU affinity and Linux container CPU quotas.
For example, docker run --cpus=2 limits the automatic default to two threads.
Go normally applies a minimum of two for CPU quotas, so --cpus=1 can still
produce two threads. Set --threads=1 if you need one inference thread.
An explicit GOMAXPROCS value overrides Go’s automatic CPU detection.
A nonzero server thread setting from the CLI, environment, or saved runtime
settings bypasses this automatic default.
API Flags
Parameter
Default
Description
Environment Variable
--address
:8080
Bind address for the API server
$LOCALAI_ADDRESS, $ADDRESS
--shutdown-timeout
20s
On SIGTERM or SIGINT, stop accepting requests, make /readyz answer 503 and wait this long for in-flight requests (chat streams included) to finish. Then the process closes the remaining connections, closes the chats and exits. The whole stop takes up to this value plus 21 seconds; keep that below the termination grace period of your platform. See Restarts and long chats for the steps and their limits. 0 exits without waiting. A second signal exits at once
$LOCALAI_SHUTDOWN_TIMEOUT
--max-concurrent-backend-requests
1024
Process-wide ceiling for concurrent backend inference operations. Excess inference receives HTTP 429 with Retry-After; UI and administrative endpoints remain available
PEM file with the certificate (and its chain) that the API server presents. Needs --tls-key. TLS is off when no certificate and no --tls-self-signed is set. TLS 1.3 is the minimum, and HTTP/2 is offered. See Paired clients
$LOCALAI_TLS_CERT
--tls-key
PEM file with the private key of --tls-cert
$LOCALAI_TLS_KEY
--tls-self-signed
false
Serve TLS with a self-signed certificate that LocalAI makes once and keeps in the tls folder of the data path (the key has mode 0600). It is reused at each start, so its fingerprint holds, and it is replaced only when fewer than 30 days remain or the files are damaged. The SHA-256 fingerprint is logged at start and shown with each pairing code, so that a paired client can pin it. Without a data path (--data-path -) the certificate lives in memory and changes at each start. Not with --tls-cert
$LOCALAI_TLS_SELF_SIGNED
--disable-http-compression
false
Disable gzip compression of HTTP responses. Compression is enabled by default; streaming endpoints (streaming chat completions, SSE bridges, WebSocket upgrades) and already-compressed formats are never compressed
$LOCALAI_DISABLE_HTTP_COMPRESSION
--http-compression-min-length
1024
Minimum response size in bytes before gzip compression is applied. Smaller responses are sent as-is because the gzip envelope would outweigh the saving
$LOCALAI_HTTP_COMPRESSION_MIN_LENGTH
--upload-limit
0
Upload limit in MB for request bodies; 0 means not set, and then 15 MB applies, except to uploads of the Files page, which are limited only by the 256 MiB workspace file size, and to chat messages with attachments, which are limited to 1 GiB. When set, it applies to both too, lower or higher (a file is never above 256 MiB and a message never above 1 GiB)
$LOCALAI_UPLOAD_LIMIT, $UPLOAD_LIMIT
--api-keys
List of API Keys to enable API authentication. When this is set, all requests must be authenticated with one of these API keys
$LOCALAI_API_KEY, $API_KEY
--disable-web-ui
false
Disables the web user interface. When set to true, the server will only expose API endpoints without serving the web interface
$LOCALAI_DISABLE_WEBUI, $DISABLE_WEBUI
--disable-runtime-settings
false
Disables the runtime settings feature. When set to true, the server will not load runtime settings from the runtime_settings.json file and the settings web interface will be disabled
If not empty, add that string to Machine-Tag header in each response. Useful to track responses from different machines, for example the members of a federation group
$LOCALAI_MACHINE_TAG, $MACHINE_TAG
--default-language
Default UI language code for the web interface (e.g., bn, en, es, fr, de, it, zh-CN, id, ko, pt-BR). Overridden by explicit ?lng= URL parameters or saved browser preferences
$LOCALAI_DEFAULT_LANGUAGE
Collections Flags
The collections service is the knowledge base that the chats search. The old
LOCALAI_AGENT_POOL_* names still work and warn once; see
Moving from the old chat and agents.
Parameter
Default
Description
Environment Variable
--disable-collections
false
Turn the collections service off (the API under /api/collections)
$LOCALAI_DISABLE_COLLECTIONS
--collections-apiurl
the local server
API URL the collections use for embeddings
$LOCALAI_COLLECTIONS_API_URL
--collections-api-key
the first API key
API key the collections use for embeddings
$LOCALAI_COLLECTIONS_API_KEY
--collections-default-model
Default model of the collections
$LOCALAI_COLLECTIONS_DEFAULT_MODEL
--collections-state-dir
State directory of the collections
$LOCALAI_COLLECTIONS_STATE_DIR
--collections-vector-engine
chromem
chromem or postgres
$LOCALAI_COLLECTIONS_VECTOR_ENGINE
--collections-embedding-model
granite-embedding-107m-multilingual
Embedding model of the collections
$LOCALAI_COLLECTIONS_EMBEDDING_MODEL
--collections-database-url
Database URL for the postgres vector engine
$LOCALAI_COLLECTIONS_DATABASE_URL
--collections-max-chunking-size
400
Maximum chunking size for documents
$LOCALAI_COLLECTIONS_MAX_CHUNKING_SIZE
--collections-chunk-overlap
0
Chunk overlap for documents
$LOCALAI_COLLECTIONS_CHUNK_OVERLAP
--collections-db-path
Where the vector engine keeps its data
$LOCALAI_COLLECTIONS_DB_PATH
LOCALAI_DISABLE_AGENTS is the old name of the switch that turned off the agent pool, which also held the collections. It still works: see --disable-agents in Chats Flags. The old --agent-pool-* names of the collections options also still work and log a deprecation warning. See Collections.
Hardening Flags
Parameter
Default
Description
Environment Variable
--disable-predownload-scan
false
If true, disables the best-effort security scanner before downloading any files
$LOCALAI_DISABLE_PREDOWNLOAD_SCAN
--disable-backend-install
false
If true, refuse to install or upgrade backends from galleries, OCI images, URLs or paths, including automatic installs, so the running backend set stays exactly what was deployed and tested; only backends already present or provided via --backends-system-path are used
If true, all error responses are replaced with blank 500 errors. This is intended only for hardening against information leaks and is normally not recommended
$LOCALAI_OPAQUE_ERRORS
--use-subtle-key-comparison
false
If true, API Key validation comparisons will be performed using constant-time comparisons rather than simple equality. This trades off performance on each request for resilience against timing attacks
$LOCALAI_SUBTLE_KEY_COMPARISON
--disable-api-key-requirement-for-http-get
false
If true, a valid API key is not required to issue GET requests to portions of the web UI. This should only be enabled in secure testing environments
If --disable-api-key-requirement-for-http-get is overridden to true, this is the list of endpoints to exempt. Only adjust this in case of a security incident or as a result of a personal security posture review
$LOCALAI_HTTP_GET_EXEMPTED_ENDPOINTS
Authentication Flags
Parameter
Default
Description
Environment Variable
--auth-enabled
false
Enable user authentication and authorization
$LOCALAI_AUTH
--auth-database-url
{DataPath}/database.db
Database URL for auth - postgres://... for PostgreSQL, or a file path for SQLite
$LOCALAI_AUTH_DATABASE_URL, $DATABASE_URL
--git-hub-client-id
GitHub OAuth App Client ID (auto-enables auth when set)
$GITHUB_CLIENT_ID
--git-hub-client-secret
GitHub OAuth App Client Secret
$GITHUB_CLIENT_SECRET
--oidc-issuer
OIDC issuer URL for auto-discovery
$LOCALAI_OIDC_ISSUER
--oidc-client-id
OIDC Client ID (auto-enables auth when set)
$LOCALAI_OIDC_CLIENT_ID
--oidc-client-secret
OIDC Client Secret
$LOCALAI_OIDC_CLIENT_SECRET
--external-base-url
Base URL for OAuth callbacks (e.g. http://localhost:8080)
$LOCALAI_BASE_URL
--auth-admin-email
Email address to auto-promote to admin role on login
$LOCALAI_ADMIN_EMAIL
--auth-registration-mode
open
Registration mode: open, approval, or invite
$LOCALAI_REGISTRATION_MODE
--disable-local-auth
false
Disable local email/password registration and login (for OAuth/OIDC-only setups)
Turn off the chats: the /api/chats API, saved agents, triggers, connectors and the agent tasks and jobs. Nothing of them starts
$LOCALAI_DISABLE_CHATS
--chats-auto-resume
false
Resume a chat turn that a restart interrupted, with no click. It retries up to 3 times (after 15 seconds, 1 minute and 5 minutes), within 30 minutes of the interruption. Off by default: a person or the page resumes it. See If a frontend dies
$LOCALAI_CHATS_AUTO_RESUME
--chats-model-load-wait
15m
How long a chat turn waits, in total, for its model while the model is still loading (503 with model_loading, or a 503 or 429 with Retry-After). After that the turn ends with a “still loading” reason, or with the server’s own message when the answer was not a load in progress. 0 means the default. See Requests for a model that is still loading
$LOCALAI_CHATS_MODEL_LOAD_WAIT
--incognito
Whether web UI sessions may start incognito chats: allow or forbid. Empty: allow. See Incognito chats
$LOCALAI_INCOGNITO
--incognito-max-level
The highest incognito level the server honours: memory-off or zero-retention. Empty: zero-retention
$LOCALAI_INCOGNITO_MAX_LEVEL
--disable-triggers
false
Turn off triggers. Chats stay on
$LOCALAI_DISABLE_TRIGGERS
--disable-connectors
false
Turn off the connector bots (Telegram, Slack) and the connectors API; the rest of the chats stays on
$LOCALAI_DISABLE_CONNECTORS
--disable-connector-talkback
false
Turn off the tool with which an agent writes to a chat of its connection, and the reports of triggers to a channel (the rest of the connectors stays on)
$LOCALAI_DISABLE_CONNECTOR_TALKBACK
--skip-binding-caps-migration
false
Do not give the usual permissions, once, to connector bindings saved before permissions were enforced (they stay with none until the owner chooses); also skip the one-time add of loops.wait to existing bindings
Finished runs kept for each trigger, beyond the runs of the last two days. -1 keeps all
$LOCALAI_TRIGGER_RUN_KEEP
--trigger-run-retention-days
30
Days to keep finished trigger runs. -1 keeps them forever
$LOCALAI_TRIGGER_RUN_RETENTION_DAYS
--mcp-ci-job-timeout
10m
Longest an agent job may run. The variable still works on the server command. It is removed only on local-ai agent-worker
$LOCALAI_MCP_CI_JOB_TIMEOUT
--disable-agents
false
Deprecated. Same as setting --disable-chats and --disable-collections. A value you set explicitly for either of them wins
$LOCALAI_DISABLE_AGENTS
--disable-local-ai-assistant
false
Deprecated. A true value is mapped to chats_localai_admin=false (the admin tools off), with one warning at start. The flag wins over a stored chats_localai_admin=true, also after a settings change. Use chats_localai_admin in Settings > Tools
$LOCALAI_DISABLE_ASSISTANT
--distributed-chat-workers
false
Distributed mode: send the turns of triggers, agent jobs and connector messages to chat workers. With no chat worker listening, the turn runs on the frontend
$LOCALAI_DISTRIBUTED_CHAT_WORKERS
--chat-worker
false
Distributed mode: run this instance as a chat worker, which runs the turns that frontends send it and starts no triggers, connectors or jobs
$LOCALAI_CHAT_WORKER
--chat-worker-max-turns
32
Distributed mode: on a chat worker, the most turns it runs at once. A start beyond it is refused and its run fails. 0 means no limit
$LOCALAI_CHAT_WORKER_MAX_TURNS
--chat-start-timeout
30s
Distributed mode: how long a frontend waits for a chat worker to start a turn, and how long the worker gives the start. Set the same value on the frontends and the chat workers
Use local-ai chat to run the built-in terminal agent against a LocalAI server.
The agent can run shell commands, delegate to sub-agents, and use MCP tools. Read-only
calls run on their own; everything else goes through an approval prompt you answer.
See Terminal agent for the full feature page.
Parameter
Default
Description
Environment Variable
--endpoint
http://127.0.0.1:8080
LocalAI server endpoint. The /v1 path is added automatically when omitted.
$LOCALAI_CHAT_ENDPOINT
--model
Model to use. Defaults to the only model the server offers, or asks when there are several.
--api-key
API key to use when the LocalAI server requires authentication.
Directory holding the agent’s config, plugins, and skills.
$LOCALAI_CHAT_CONFIG_DIR
--trace-dir
Write a session LLM trace (NDJSON) to this directory.
$LOCALAI_CHAT_TRACE_DIR
--cli
false
Plain CLI mode instead of the full-screen interface. Pipe stdin for one-shot use.
--tui
false
Force the full-screen interface.
--height
Run as an inline drop-down of this height, e.g. 40%.
--tmux / --no-tmux
Control the tmux split.
--init
Print the shell integration script for Ctrl+Space (zsh, bash, or fish).
--yolo
false
Auto-approve every tool call. Use with care.
$LOCALAI_CHAT_YOLO
The agent’s own subcommands are reached by passing them through. LocalAI’s flags
must come first, because everything after the first positional argument is
forwarded verbatim:
local-ai chat plugin install https://github.com/user/plugin
local-ai chat skill list
local-ai chat mcp add my-server -- npx -y @modelcontextprotocol/server-filesystem /tmp
local-ai chat --config-dir /srv/agent plugin list # flags first
Warning
In a script, pass --yes to those subcommands. Without it, a non-interactive
plugin install installs the plugin, leaves it disabled, and still exits 0.
Summon the agent from any shell prompt with Ctrl+Space:
If no server is reachable, the agent offers to start one for the session
(interactive terminals only) and otherwise points you at local-ai run.
Piped use needs --cli, and exits 0 when it answers:
echo"what is 2+2"| local-ai chat --cli
Read-only tools still run in a piped session. A tool call that is not read-only has
nobody to approve it, so it is denied and the session exits 3, a code chosen to be
distinct from the 1 a failure reports.
P2P flags
Parameter
Default
Description
Environment Variable
--p2p-mode
off
off: no P2P layer. connect: this server dials out to remotes over P2P and accepts nobody (no invites, no sharing); it needs no authentication. share: connect, and accept paired devices; it requires authentication to be on, and the server refuses to start with share while authentication is off
$LOCALAI_P2P_MODE
--p2p-listen
TCP and QUIC on every interface, random ports
Addresses the P2P host listens on in mode share (multiaddrs, repeatable)
$LOCALAI_P2P_LISTEN_MADDRS
--p2p-bootstrap
the public bootstrap peers
Bootstrap peers, multiaddrs that end in /p2p/<peer ID>; also the runtime setting p2p_bootstrap_peers
$LOCALAI_P2P_BOOTSTRAP_PEERS_MADDRS
--p2p-identity
<data path>/p2p/identity.key
The key file of the peer identity. Without a data path (--data-path -) and without this flag, P2P does not start: the identity must survive a restart
$LOCALAI_P2P_IDENTITY
The mode is also the runtime setting p2p_mode. The setting rejects share with the same message while authentication is off.
The other P2P runtime settings (p2p_public_dht, p2p_relays, p2p_relay_paired, p2p_relay_mode, p2p_relay_rate_limit, p2p_mdns) are described in P2P.
Removed P2P options
The token-based P2P mode, federation and the Explorer were removed. A server that still sets one of the old options does not start: it exits with status 1 and prints one line per option, with its replacement. The check reads the command line, the environment (including .env files) and the stored runtime settings. The full list of removed options and their replacements is in Moving from the old P2P network.
local-ai p2p
Command
What it does
local-ai p2p relay
Run a gated relay. Flags: --admin (repeatable, $LOCALAI_RELAY_ADMINS), --data, --port, --listen, --public-ip, --announce, --open, --circuit-max-bytes, --circuit-max-duration, --rate-limit, --max-circuit-bytes, --max-circuit-duration, --max-rate-limit (ceilings for the limits an admin may set at runtime), --total-rate-limit, --max-circuits, --max-circuits-per-peer, --max-reservations, --max-reservations-per-ip, --max-conns-per-ip, --conn-rate-per-ip, --conn-burst-per-ip, --conn-rate-total, --conn-burst-total, --max-peers-per-admin, --allow-private-addrs, --reset-admins
local-ai p2p relays add|remove|list|check
Manage the relays of a running server (--target, --api-key, --json)
local-ai p2p id and local-ai p2p status
Show the peer ID, addresses, reachability and paths of a running server
local-ai p2p pair --invite <link>
Redeem an invite on this machine
local-ai p2p forward --peer <id> --listen <addr>
Forward a local port to a paired peer. --relay, --addr and --hint (a public relay that only helps a hole punch) are repeatable. With --json it prints one status line per state change, and a routes line with the current routes of the server while connected
Library sources
local-ai library manages the sources LocalAI reads add-ons, backends and models from. The sources are stored under the data path (addons/sources.json), the file the server reads, so the commands work with the server stopped.
Command
What it does
local-ai library list
List every source with its kind, id, URL, and whether it is enabled, a shipped default, or removed
Add a source of your own. --issuer and --identity go together and apply to an oci:// add-on library: its artifact must be signed by that issuer and exact identity. --identity-regex, an anchored pattern, takes the place of --identity only together with --source-repository, the https URL of the repository the signature must be made for. --source-repository can also go with --identity
local-ai library remove <id>
Remove a source. A removed default leaves a tombstone, so it does not come back at the next start
local-ai library enable <id>
Turn a source on. This also brings back a removed default
local-ai library disable <id>
Turn a source off without removing it
All local-ai library commands accept --official-libraries (LOCALAI_OFFICIAL_LIBRARIES, default true). With --official-libraries=false the list shows the shipped default sources as off. The same switch is the runtime setting official_libraries and the toggle “Use official libraries” in Settings. See Library sources.
When two enabled sources list the same entry (same kind and id), your own source wins over a shipped default. If two of your own sources list it, the entry is refused and the message names both sources: disable or remove one of them. The --galleries and --backend-galleries flags keep working: each gallery they name is added as a source of your own (kind model or backend, format gallery) at startup, unless it is already a source.
Plugins
local-ai plugins manages the plugins of a running server: plugins in the Claude Code plugin format, from marketplaces. It talks to the server’s REST API with --target (LOCALAI_TARGET, default http://localhost:8080) and --api-key (LOCALAI_API_KEY). validate is the exception: it works offline. local-ai chat plugin is another command: it manages the plugins of the terminal agent on this machine.
Command
What it does
local-ai plugins marketplace list
List the marketplaces with their state, commit and last refresh
Run the checks of an install on a plugin folder, or on every plugin of a marketplace.json, with no server. An entry that declares metadata.localai.runsCode fails when the checks find otherwise. Exits 1 when a plugin fails
A <plugin> is an install ID or name@marketplace. For a plugin that runs code, install prints the page of the web UI where an administrator reviews the code files and installs it, and exits 0: only the administrator’s browser session installs such a plugin. update does the same when the code of a plugin changes. When an install for everyone already exists, install prints its ID; turn it on with enable. An install that gained code needs enable --accept-code.
validate --marketplace reads the relative sources from the files next to the marketplace.json, and fetches the other sources with git over https, into a scratch folder under TMPDIR that it removes. A skipped component is a warning; --strict makes it a failure.
Other Commands
LocalAI supports several subcommands beyond run:
local-ai models - Manage LocalAI models and definitions
local-ai backends - Manage LocalAI backends and definitions
local-ai chat - Run the built-in terminal agent against a LocalAI server
local-ai addons - Check an add-on zip file and upload it to a running server to install it
local-ai library - Manage the library sources (see Library sources)
local-ai plugins - Manage the plugins of a running server (see Plugins)
local-ai benchmark - Benchmark configured text models against a running LocalAI server
local-ai tts - Convert text to speech
local-ai sound-generation - Generate audio files from text or audio
local-ai transcript - Convert audio to text
local-ai mcp-server - Run the LocalAI admin and client tool surface as a stdio MCP server (controls a remote LocalAI instance over HTTP). --files-dir (LOCALAI_MCP_FILES_DIR) is the folder where the client tools read and write files; it has no default, and without it the client tools that read or write files are not registered. --read-only also leaves out the client tools that write files or make content (generate_*, speak, embed, voice_profile create and delete)
local-ai worker - Start a worker. With no subcommand it is the worker for distributed mode (generic, backend-agnostic). The subcommands llama-cpp-rpc, mlx-distributed, vllm and ds4-distributed run the standalone workers; llama-cpp-rpc and mlx-distributed also join a server over P2P with --join <invite link> (see Model-split workers over P2P). p2p-worker is the old name of this command and still works
local-ai cluster - Read or change the broadcast bus between the frontends (nats for NATS, tunnel for PostgreSQL with WebSocket workers) and the settings of a distributed cluster through a running frontend. Workers never connect to PostgreSQL. Changing the bus is an advanced operation. See Distributed Mode
local-ai p2p - Run a relay, manage relays and pair devices over P2P
local-ai agent-worker - Start a worker for distributed mode (serves MCP tool calls via NATS)
local-ai util - Utility commands
local-ai completion - Generate shell completion scripts for bash, zsh, or fish
Use local-ai <command> --help for more information on each command.
Add-on carrier keys
local-ai util addons-carrier-keys makes the key set that a separate add-on owner and its frontends share. See Running the owner as its own workload for how the set is used.
Flag
Description
--out
Directory to write the key set to. Required. The command fails if the directory already holds any of the files, and it never overwrites a file.
--owner-host
DNS name or IP address of the add-on owner, as the frontends dial it. Required. Repeat the flag for more than one.
The command prints which files go to the owner and which go to the frontends. It writes the files with mode 0600 in a directory with mode 0700, and it does not keep the CA key.
Examples
Basic Usage
./local-ai run
./local-ai run --models-path /path/to/models --address :9090
./local-ai run --f16
Environment Variables
exportLOCALAI_MODELS_PATH=/path/to/models
exportLOCALAI_ADDRESS=:9090
exportLOCALAI_F16=true./local-ai run
The local-ai server is one file per platform on the releases page. The install script downloads the right one for you and checks it. Download by hand when you want to choose the file yourself. On Windows, use the PowerShell install script, or download the Windows binary listed below; WSL2 and a container also work.
Files
Each release has these files, with the release tag in the name:
OS
File
Linux (amd64)
local-ai-v5.1.0-linux-amd64
Linux (arm64)
local-ai-v5.1.0-linux-arm64
macOS (Apple Silicon)
local-ai-v5.1.0-darwin-arm64
Windows (amd64)
local-ai-v5.1.0-windows-amd64.exe
The Windows binary is signed with Authenticode when the project has a signing certificate for that release. The checksums cover the signed file. There is no binary for Intel Macs. The checksums of the release are in LocalAI-v5.1.0-checksums.txt. Download from https://github.com/mudler/LocalAI/releases/download/v5.1.0/.
Download and run
This command picks the file for the machine it runs on, from the latest release shown in these docs:
To check the download, get the checksum file and compare:
curl -fLO "https://github.com/mudler/LocalAI/releases/download/$tag/LocalAI-$tag-checksums.txt"grep " local-ai-$tag-$os-$arch\$" LocalAI-$tag-checksums.txt
sha256sum local-ai # on macOS: shasum -a 256 local-ai
The two hashes must match.
Backends
A binary doesn’t bundle backends. LocalAI downloads each backend as an OCI image the first time a model needs one. See Backends.
The llama-cpp backend also has a native Windows build, installed from a Windows backend image; see the Windows guide.
System and version endpoints
Two endpoints show what the server runs: /system for backends and loaded models, /version for the build. /system is an administrator route. When authentication is on, send your key or session, for example -H "Authorization: Bearer <your-key>" with curl.
System Information
Method:GET
Endpoint:/system
Returns available backends and currently loaded models.
Response
Field
Type
Description
backends
array
List of available backend names (strings)
loaded_models
array
List of currently loaded models
loaded_models[].id
string
Model identifier
loaded_models[].backend
string
Backend serving the model, from its config. Omitted when the model was loaded without one
loaded_models[].process
object
The backend process serving the model on this host. Omitted when there is no local process (a distributed worker holds the model) or it could not be read
loaded_models[].process.pid
integer
Process ID
loaded_models[].process.rss_bytes
integer
Resident host memory, in bytes. Weights offloaded to a GPU are not included
loaded_models[].process.memory_percent
number
rss_bytes as a percentage of host RAM
loaded_models[].process.cpu_percent
number
Share of the whole host’s CPU used since the previous call, 0-100. Omitted on the first call that sees the process, because there is no earlier reading to compare against
loaded_models[].process.started_at
string
When the process started (RFC 3339)
loaded_models[].size_vram
integer
Optional DRM-accounted resident device memory, in bytes
Per-model VRAM
On Linux, size_vram reports resident device memory for the local backend
process and its child processes. LocalAI reads drm-resident-local* and
drm-resident-vram* from /proc and counts each DRM client once per GPU.
Host-memory regions are excluded. The reading includes buffers attributed
to the backend, without separating weights, KV cache, and other allocations.
See the kernel DRM accounting specification
for these counters.
The field is omitted when accounting is unavailable or incomplete. This
includes external and distributed backends, macOS, proprietary NVIDIA
drivers, primary DRM nodes (/dev/dri/card*), missing resident counters,
and unreadable process information.
A present value of 0 means the supported counters report zero bytes.
Treat an absent field as unknown.
This is a snapshot of driver accounting, not a memory reservation. Shared
buffers can appear in different clients’ counters, and allocations can change
during collection. Do not treat the sum across models as exclusive physical
GPU usage. These readings do not replace capacity checks when scheduling work.
cpu_percent covers the time since the previous call to this endpoint, so a
dashboard polling every few seconds gets a current reading. The web interface’s
This machine page polls it every five seconds. Find it under Administration in the sidebar, in the This machine group. In distributed mode, the Cluster group replaces it.
Version
Method:GET
Endpoint:/version
Returns the LocalAI version and build commit.
Response
Field
Type
Description
version
string
Version string in the format version (commit)
Usage
curl http://localhost:8080/version
Example response
{"version":"4.12.1 (a1b2c3d4)"}
Error responses
Status Code
Description
500
Internal server error
When authentication is on, /system refuses a request that has no valid administrator credentials.
Shell completion
local-ai can print a completion script for bash, zsh and fish. Tab then completes commands, subcommands and flags.
Generating Completion Scripts
Use the completion subcommand to generate a completion script for your shell:
local-ai completion bash
local-ai completion zsh
local-ai completion fish
Installation
Bash
Add the following to your ~/.bashrc:
source <(local-ai completion bash)
Or install it system-wide, which needs root:
local-ai completion bash | sudo tee /etc/bash_completion.d/local-ai > /dev/null
Zsh
Add the following to your ~/.zshrc:
source <(local-ai completion zsh)
Or install it to a completions directory. The first folder of fpath can be read-only, so pick one you can write to:
local-ai completion zsh > "${fpath[1]}/_local-ai"
If shell completions are not already enabled in your zsh environment, add the following to the beginning of your ~/.zshrc:
After installation, restart your shell or source your shell configuration file. Then type local-ai followed by a tab to see available commands:
$ local-ai <TAB>
Tab lists the commands and then completes subcommands and flags:
$ local-ai models <TAB>
$ local-ai run --<TAB>
Run local-ai --help for the commands of your build.
Runtime errors and troubleshooting
If you only have an HTTP 500 and no message, read How to read the real error first. The useful text is almost always in the server log, not in the HTTP body.
Find your error string below to see the cause and the fix. Request-shape errors (bad JSON, unknown field, wrong content type) are in API errors.
Symptom, cause, fix
The left column is the string as it appears in the LocalAI server log (or, for the cooldown case, in the HTTP response). Match on the string, then read across.
Error string / symptom
Likely cause
Fix
could not load model: ...
The selected backend started but rejected the model (bad path, corrupt or truncated GGUF, wrong architecture, unsupported quantization). The ... is the backend’s own message.
Read the wrapped backend message. Re-download the model if it is truncated. Confirm the backend matches the model (for example a GGUF needs llama-cpp). Run with DEBUG=true to see the full backend output.
could not load model (no success): ...
The backend replied to the load request but reported failure without a fatal error.
Same as above. The trailing message is the backend’s status text; check it for the concrete reason (out of memory, unsupported option, missing file).
could not load model - all backends returned error: ...
LocalAI tried every candidate backend for the model and each one failed. Usually the backend for this model type is not installed, or the model file is unusable.
Install the correct backend with local-ai backends install <backend> (or from the Backends page). Confirm the model config backend: field names an installed backend. Inspect the concatenated per-backend messages for the real cause.
grpc service not ready
The backend process was spawned but its gRPC server did not become healthy in time (slow start, crash on startup, or the process died while loading). When a local backend has already exited, the error includes its exit code and last stderr line.
Use the included stderr diagnostic when present; otherwise check the log lines just above. A crash here often means out of memory, a missing shared library, or an incompatible CPU (see SIGILL). Increase available RAM/VRAM or pick a smaller quantization.
failed to load model: ...
Returned by the load endpoints and several feature paths (voice, realtime, audio transform) when the model config could not be resolved or the backend load failed.
Confirm the model name exists (local-ai models list) and its YAML is valid. The trailing text carries the specific reason.
HTTP 503 with a Retry-After header, after a load failed
Model-load failure cooldown. After a model fails to load, LocalAI refuses new load attempts for that model for a short window so a client that keeps polling a broken model does not respawn a crashing backend on every request. The window starts at --model-load-failure-cooldown (default 10s) and doubles per consecutive failure up to 5m; it resets on the first success.
Fix the underlying load failure (see the rows above), then wait out the Retry-After seconds before retrying, or restart LocalAI to clear the cooldown. Set --model-load-failure-cooldown 0 (or LOCALAI_MODEL_LOAD_FAILURE_COOLDOWN=0) to disable the cooldown entirely. See /docs/reference/cli-reference/.
HTTP 503 with no available nodes or no healthy nodes match selector
The scheduler could not find any healthy node to serve the model. All nodes are full and eviction cannot free a slot, a node_selector in the model’s scheduling config excludes every candidate, or every node that can take the model is already loading it (the model is already being loaded by another owner). The answer carries a Retry-After header.
Retry after a node becomes available or an in-flight request completes and frees a slot. In a cluster, add nodes or replicas. If a selector is set, confirm at least one healthy node matches it.
HTTP 503 with no node has enough free memory for model ...
The model has a size estimate, no matching node has that much free VRAM, and evicting idle models cannot make room (the models on the nodes are serving requests, pinned, or needed for a min_replicas floor). The model is not placed on a node that lacks the room.
Retry after the Retry-After seconds. Free VRAM by unloading a model, add a node, or lower the model’s context size.
HTTP 503 with the scheduling rule of the model cannot be read
In distributed mode, the frontend could not read the model’s scheduling rule from the database, for example during a statement timeout. It does not place the model without the rule.
Retry after the Retry-After seconds. If it persists, check the database load and the frontend logs.
HTTP 429 with a Retry-After header, under load
Per-model concurrency limit reached. When a model config sets a MaxConcurrent limit, extra requests are rejected with 429 and a Retry-After (whole seconds, floor 1) instead of queueing.
Retry after the advised delay, raise the model’s concurrency limit, or run more replicas.
HTTP 429 when backend inference is saturated
The process-wide --max-concurrent-backend-requests backend-execution ceiling is full. This protects inference and in-flight backend-trace memory without blocking UI or administrative endpoints.
Retry after the advised delay, reduce inference concurrency, raise the limit if the host has capacity, or add replicas.
SIGILL (illegal instruction) on startup
The prebuilt backend uses CPU instructions your CPU does not have (for example AVX512, AVX2, F16C, FMA).
Use a backend built for your CPU, or build the backend yourself. See Creating a backend.
CUDA / VRAM out of memory (backend log shows out of memory, CUDA error: out of memory, or the process is killed loading)
The model plus its KV cache does not fit in GPU memory.
Use a smaller quantization, reduce context_size:, offload fewer layers to the GPU (lower gpu_layers:), or free VRAM held by other processes. On multi-GPU hosts, confirm the model is not trying to load entirely onto one device.
Backend was terminated by the watchdog
The idle or busy watchdog stopped a backend that ran longer than its threshold. This is expected behavior when the watchdog is enabled, not a crash.
If the backend was killed prematurely, raise --watchdog-idle-timeout / --watchdog-busy-timeout, or disable the relevant watchdog (LOCALAI_WATCHDOG_IDLE=false, LOCALAI_WATCHDOG_BUSY=false). The next request reloads the model.
Context size exceeded / truncated output
The combined prompt and generation exceeded the model’s context window.
Shorten the prompt or raise context_size: in the model YAML (bounded by what the model and your memory allow).
Note
The backend engine (llama.cpp, vLLM, whisper.cpp and so on) writes the ... part above, and its wording can change between versions. Match on the LocalAI prefix (could not load model, grpc service not ready) and read the trailing text as the backend’s diagnosis.
How to read the real error
Most user-facing failures surface as an HTTP 500 whose body is a short, generic message. The real cause is in the LocalAI server log, where the backend gRPC error is logged in full:
Look at the server log, not just the HTTP response. A 500 from a chat or completion request usually wraps a backend gRPC error. The log line that matters is the one printed by LocalAI when the backend replied (or failed to start).
Turn on debug output. Run with DEBUG=true in the environment, or pass --log-level=debug on the command line. The older --debug flag is deprecated. This prints the backend’s stdout/stderr, the load parameters, and per-token timing.
DEBUG=true local-ai run
# orlocal-ai run --log-level=debug
Read the backend’s own output. Backend engines write their diagnostics to stderr, which LocalAI captures into its log at debug level. A load failure (could not load model, grpc service not ready) almost always has the concrete reason (out of memory, missing library, unsupported quantization, illegal instruction) in the backend lines immediately above the LocalAI error.
Slow responses
Slow inference is almost always a hardware or configuration problem, not an error:
Keep models on an SSD. On an HDD, set mmap: false in the model config so the model loads fully into memory.
Leave the thread count alone. LocalAI already picks a thread count from your physical cores (see Default thread count). Lower --threads only if other programs compete for the CPU.
Run with DEBUG=true to see token-inference stats and confirm where time is going.
Confirm you are getting output at all: send a simple request with "stream": true and watch how fast tokens arrive.
Check GPU offload. If you expect GPU acceleration, confirm the model actually loaded onto the GPU (the backend log reports offloaded layers). See /docs/models/gpu-acceleration/.
See also
/docs/api/api-errors/ for API-envelope error formats and status codes.
/docs/start/first-agent/ for the “if your agent will not run” checklist (agent-specific failures).
/docs/reference/cli-reference/ for the full flag list, including the model-load failure cooldown and watchdog options.
FAQ
Frequently asked questions
Here are answers to some of the most common questions.
Do I need to install all the backends?
No. You install only the backends your models use. LocalAI’s core is a single binary (or container) that provides the OpenAI-compatible API, request routing, the web UI, and agents. Each inference backend (llama.cpp, vLLM, whisper.cpp, stable-diffusion, MLX, and others) is a separate artifact, installed only when a model needs it.
In practice:
You install one backend, not all of them. Run a model with local-ai run <model> and the matching backend is pulled automatically; nothing else is downloaded.
Each backend is purpose-built for its engine. LocalAI builds a dedicated gRPC backend around each engine, so every one stays independently optimized without a single binary trying to support every model architecture at once.
You manage backends individually with local-ai backends list/install/uninstall or from the web UI.
The catalog’s breadth is optionality: you only ever run what your models use.
Can I bring my own model or backend?
Yes. You can load any compatible model, not just the ones in the gallery. And because every backend talks to the core over a simple gRPC interface, you can write your own backend in any language and plug it in, exactly how the built-in backends work. Nothing about the core is closed off, which gives you the flexibility to run precisely the stack you want.
How do I get models?
The easiest way is the built-in model gallery: open the web interface at http://localhost:8080, go to the Models page, and install a model by name. You can also install from the command line with local-ai models install <model-name>. Most gguf-based models work, and you can point LocalAI at any compatible GGUF from Hugging Face (https://huggingface.co/models?search=gguf). Be cautious about downloading models from untrusted sources, as there may be security vulnerabilities in llama.cpp or ggml that could be maliciously exploited.
Where are models stored?
LocalAI stores downloaded models in the following locations by default:
Command line: ./models (relative to current working directory) on Linux and macOS, %LOCALAPPDATA%\LocalAI\models on Windows
Docker: /models (inside the container, typically mounted to ./models on host)
Launcher application: ~/.localai/models (in your home directory), %LOCALAPPDATA%\LocalAI\models on Windows
You can customize the model storage location using the LOCALAI_MODELS_PATH environment variable or --models-path command line flag. To move the models, backends, data and configuration folders at once, set LOCALAI_BASE_PATH. This is useful if you want to store models outside your home directory for backup purposes or to avoid filling up your home directory with large model files.
How much storage space do models require?
Model sizes vary significantly depending on the model and quantization level:
Ensure you have at least 2-3x the model size available for downloads and temporary files
Use SSD storage for better performance
Consider the model size relative to your system RAM - models larger than your RAM may not run efficiently
Benchmarking LocalAI and llama.cpp shows different results!
LocalAI applies a set of defaults when loading models with the llama.cpp backend, one of these is mirostat sampling - while it achieves better results, it slows down the inference. You can disable this by setting mirostat: 0 in the model config file. See also the advanced section (/docs/models/advanced-usage/) for more information and this issue.
Everything is slow, how is it possible?
See the performance section of the runtime errors reference: /docs/reference/runtime-errors/.
Can I use it with a Discord bot, or XXX?
Yes! If the client uses OpenAI and supports setting a different base URL to send requests to, you can use the LocalAI endpoint. This allows to use this with every application that was supposed to work with OpenAI, but without changing the application!
Tip
Many clients read the endpoint from the OPENAI_BASE_URL environment variable (older ones use OPENAI_API_BASE), so pointing an existing app at LocalAI is often just OPENAI_BASE_URL=http://localhost:8080/v1. Clients that insist on a non-empty API key accept any placeholder value, unless you have configured api_keys.
Can this use GPUs?
There is GPU support, see /docs/models/gpu-acceleration/.
Where is the WebUI?
LocalAI ships with a built-in web interface. Once LocalAI is running, open http://localhost:8080 in your browser to manage models, chat, and configure the server. There is nothing extra to install. Because LocalAI also exposes an OpenAI-compatible API, you can additionally plug it into any existing application that talks to the OpenAI API by pointing that application at the LocalAI endpoint.
How can I troubleshoot when something is wrong?
Enable the debug mode by setting DEBUG=true in the environment variables. This will give you more information on what’s going on.
You can also specify --debug in the command line. For matching a specific runtime or backend error message to its cause and fix, see the runtime errors reference: /docs/reference/runtime-errors/.
I’m getting ‘invalid pitch’, ‘SIGILL’, a CUDA out-of-memory error, or a model that will not load
These runtime and backend failures, and how to read the real error behind an HTTP 500, are documented in the runtime errors reference: /docs/reference/runtime-errors/.