Skip to main content
LocalAI docs
Chapter 1

Start here

In about five minutes you can chat with a model and call it from curl. A saved agent takes a few more.

Tip

The quickstart has the install command. Other ways to install are in the install guide.

The path

  1. Quickstart: install, chat in the browser and call the API.
  2. Other ways to install: script, binary, container, Kubernetes and desktop app.
  3. Set up models: install models from the gallery, Hugging Face, OCI images or local files.
  4. Try it out: copy-paste examples for the OpenAI-compatible endpoints.
  5. Customize a model: edit the model configuration and the prompt template.
  6. Build your first agent: turn a model into a saved agent that a chat, a schedule or a bot can use.

If something fails, see Troubleshooting.

Subsections of Start here

LocalAI docs > Start here

Overview

Run open models for chat, images, speech and video on your own machines. The API speaks the OpenAI and Anthropic formats. Your team gets chats, files and documents on top, and the assistant can write and run code.

What you can do

  • Call an API. Routes in the OpenAI, Anthropic and Open Responses formats. A client that uses the OpenAI or Anthropic SDK works when you change the base URL.
  • Use the web interface. Chats, saved agents, files, model management, image generation and system monitoring.
  • Build agents. Saved agents use tools over MCP (Model Context Protocol), add-ons and your files.
  • Run many kinds of models. Text, images, video, speech, sound, vision and embeddings. See what models can do.
  • Use your GPU, or none. LocalAI runs on NVIDIA, AMD, Intel and Vulkan-capable GPUs, and on a CPU.
  • Run several nodes. Worker nodes and P2P federation, and P2P model sharding for llama.cpp models only. See Distributed mode.
  • Add programs. Add-ons are separate programs that add tools, such as the Sandbox and Office documents.

Your files and models stay on your machines. Features that call outside services, such as web search or Gmail, are opt-in.

Install

The quickstart has the install script, the first model and the first chat. The script works on Linux and on Macs with Apple Silicon. Windows has its own PowerShell script and a native binary, see Install on Windows. For an Intel Mac or a GPU image, use a container with Docker Compose:

curl -fsSL https://localai.io/install/docker-compose.yaml -o docker-compose.yaml
docker compose up -d

The compose file keeps your models and data in volumes. See Persistent storage for the four paths. All install methods are in the install guide.

How it works

How LocalAI works: clients call one API on a small core with chats, agents, an add-on host and an MCP client and server, which talks over gRPC to a separate backend process for each model, running on your own hardware.How LocalAI works: clients call one API on a small core with chats, agents, an add-on host and an MCP client and server, which talks over gRPC to a separate backend process for each model, running on your own hardware.

The core serves the API and the web interface. Each model runs in a backend, which is a gRPC service around an engine such as llama.cpp, vLLM, whisper.cpp, stable-diffusion or MLX. Backends are OCI images that run as separate processes. LocalAI downloads a backend the first time a model needs it. You can install, upgrade or remove one without touching the core, and one can run on another machine.

The backend contract is a small gRPC interface, so you can write your own backend in any language. See Creating a backend and the step-by-step checklist.

Next steps

License

LocalAI is open source under the MIT license. It was created by Ettore Di Giacinto and has many contributors.

LocalAI docs > Start here

Quickstart

Quickstart in four steps: install with the script, Docker or the desktop app; start LocalAI; pick a model; talk to it in the web UI or the API. Then build an agent, install add-ons or add machines.Quickstart in four steps: install with the script, Docker or the desktop app; start LocalAI; pick a model; talk to it in the web UI or the API. Then build an agent, install add-ons or add machines.

Run open models for chat, images, speech and video on your own machines. The API speaks the OpenAI and Anthropic formats. Your team gets chats, files and documents on top, and the assistant can write and run code. No GPU needed for the engine, and a GPU makes it faster.

Install and start LocalAI

Follow the desktop app guide to start the server on Linux, macOS, or Windows 10 or 11.

On Android, see the Android client guide for APK availability. The app connects to a LocalAI server on another machine.

Alternative: install with a script

On Linux or a Mac with Apple Silicon, run the install script, then start LocalAI:

curl -sSL https://localai.io/install.sh | sh
local-ai
# open http://localhost:8080 and install a model from there

The script installs the local-ai program and does not start it. The command local-ai starts the server with no model. You should see the log line LocalAI is started and running with the address :8080. If the script says the folder is not on your PATH, run the export line it prints.

On Windows, use the PowerShell script irm https://localai.io/install.ps1 | iex. See Install on Windows.

Alternative: use Docker Compose

On an Intel Mac, or when you prefer a container, use Docker Compose instead:

curl -fsSL https://localai.io/install/docker-compose.yaml -o docker-compose.yaml
docker compose up -d

The compose file keeps models, backends, settings and data in named volumes, so they stay when you recreate or upgrade the container.

See the install guide for the other ways to install.

For a GPU in a container, use the image that matches your hardware:

HardwareDocker image
CPU onlylocalai/localai:latest
NVIDIA, CUDA 12localai/localai:latest-gpu-nvidia-cuda-12
NVIDIA, CUDA 13localai/localai:latest-gpu-nvidia-cuda-13
AMD (ROCm)localai/localai:latest-gpu-hipblas
Intel GPUlocalai/localai:latest-gpu-intel
Vulkanlocalai/localai:latest-gpu-vulkan

To use a GPU, change image in docker-compose.yaml to the tag for your hardware, and remove the # from the block for your GPU. With docker run, add --gpus all for NVIDIA, or the --device flags for AMD, Intel and Vulkan. NVIDIA Jetson images and the full flag list are in Container images.

Chat in the web interface

Open http://localhost:8080 in your browser.

  1. On a fresh install, accept the model that the first-run card recommends. LocalAI downloads it when you agree. Or open Models, then Explore, search for gemma-4-e2b-it-qat-q4_0 and choose Install. It’s a small Google Gemma 4 model that runs on a CPU and reads images. The download is 4.3 GB in total: 3.35 GB for the model and 0.99 GB for the image projector. The first-run card shows 3.1 GB because it counts the model file only, in binary units.
  2. Open Chats, select the model from the model list, type a message and send it.

On a CPU the first reply takes longer because the model has to load.

Use the globe button in the navigation to choose 简体中文 (Simplified Chinese). The selection is saved in this browser and also applies to the built-in Studio, Talk, Voice, Face, Fine-tuning and Quantization add-on pages. Model names, API paths and configuration keys keep their original spelling; model responses and messages returned by external services are not translated by this setting.

Use the API

Any OpenAI SDK or client works when you point it at http://localhost:8080. This request uses the model you just installed:

curl http://localhost:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemma-4-e2b-it-qat-q4_0",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

The text of the reply is in choices[0].message.content. If you turned on API keys (see below), add -H "Authorization: Bearer <your-key>" to the request.

LocalAI also speaks the Anthropic Messages API and the Open Responses API. Try it out has an example for each endpoint.

Install models from the command line

Name a model after run and LocalAI downloads it before it starts the API:

local-ai run gemma-4-e2b-it-qat-q4_0
local-ai run llama-3.2-1b-instruct:q4_k_m
local-ai run huggingface://google/gemma-4-E2B-it-qat-q4_0-gguf/gemma-4-E2B_q4_0-it.gguf

The first two names come from the model gallery. The third one points at a file on Hugging Face. To list the gallery or install a model without starting the server:

local-ai models list
local-ai models install <name>

ollama://, oci:// and a URL of a model configuration file work the same way. Set up models lists every form. LocalAI checks your GPU when you install a model and downloads the matching backend (GPU acceleration). For all options, see the CLI reference or run local-ai --help.

Build an agent

An agent is a chat with fixed instructions and a fixed set of tools and files. It’s part of LocalAI, so you need no extra install. On a server with accounts, an administrator switches saved agents on first.

  1. Install a model that supports tool calling. The gallery entry of gemma-4-e2b-it-qat-q4_0 turns on automatic tool-call parsing, so it’s a good first try. If the agent never calls a tool, switch to a larger model.
  2. Open Agents in the sidebar and choose New agent.
  3. Give it a name and instructions, then choose Create agent.
  4. Choose Chat on the agent’s row.

Build your first agent has the full walkthrough.

Before you expose it

LocalAI listens on port 8080 on all interfaces, and authentication is off. Protect the API before you expose it beyond your own machine:

  • API keys. Run with LOCALAI_API_KEY=your-key. API keys give full admin access with no role separation.
  • User authentication. Run with LOCALAI_AUTH=true for admin and user roles, OAuth login, per-user API keys and usage tracking. See Authentication and authorization.

What next

LocalAI docs > Start here

Install LocalAI

Install the server with a script, a binary, a container or Helm. Windows has a PowerShell install script and a native binary. The desktop app, which installs and runs the server for you, is in the 5.0 release.

You haveUseCommand or guide
Linux, or a Mac with Apple SiliconInstall scriptSee below
Linux or macOS, and you want to choose the fileBinaryBinary
Windows on amd64PowerShell script or binaryWindows
An Intel Mac, a server, or a GPU imageContainerContainers
A clusterHelm chartKubernetes
An Android phone, and a server to connect toAndroid appAndroid app
A change to the codeSourceBuild from source

Install script

The script downloads the release binary for your machine, checks it against the checksums of the release, and puts it on your PATH. It builds nothing. Running it twice changes nothing.

curl -sSL https://localai.io/install.sh | sh

The script installs the local-ai program and does not start it. If the script says the folder is not on your PATH, run the export line it prints. After the script, run local-ai, open http://localhost:8080 and install a model from the UI. The quickstart has the details.

If a release has no checksum file, the script says so and installs without checking.

You can set these environment variables before the command:

VariableEffect
LOCALAI_VERSIONInstall a given release, for example v4.7.1. The default is the latest release.
INSTALL_DIRInstall into this folder. The default is /usr/local/bin, using sudo when the folder is not writable and sudo is available. Without sudo, or with LOCALAI_NO_SUDO=1, the script uses ~/.local/bin.
LOCALAI_FORCESet to 1 to install again when the same build is present.
LOCALAI_NO_SUDOSet to 1 to never ask for sudo. LocalAI then installs into ~/.local/bin.
GITHUB_TOKENA GitHub token, used only to avoid GitHub API rate limits when the script looks up the latest release.

The script supports Linux on amd64 and arm64, and macOS on arm64 (Apple Silicon). There is no binary for Intel Macs. Use a container there. On Windows, use the PowerShell script in Windows.

Install a worker

The script has a worker mode that installs the binary and then a service that runs local-ai worker and joins a cluster. You normally do not type this yourself: an admin mints a join token on the Workers page (Add worker), and the page gives you a command such as curl -fsSL 'https://ai.example.com/join.sh?t=...' | sudo sh, which runs this mode. See Join tokens.

LOCALAI_REGISTER_TO=https://ai.example.com LOCALAI_JOIN_TOKEN=ljt_... sudo -E sh install.sh --worker

Run it as root. It writes a systemd unit on Linux (a launchd daemon on macOS, not tested on every macOS version), keeps the settings in /etc/localai/worker.env (readable by root only), and starts the service. The join token is read from the environment, never from a command line, and the script never prints it. Running it again is safe: the worker keeps its own credential in its state directory and needs the token once.

VariableEffect
LOCALAI_REGISTER_TOThe URL of the frontend. Required.
LOCALAI_JOIN_TOKENThe join token. Required the first time.
LOCALAI_WORKER_ROUTESnats, websocket or both. Optional.
LOCALAI_WORKER_NAMEThe node name. The default is the host name.
LOCALAI_WORKER_DIRThe state directory (models, backends, credential). The default is /var/lib/local-ai on Linux.

To remove the worker: sudo systemctl disable --now localai-worker, then remove /etc/localai/worker.env, /etc/systemd/system/localai-worker.service and the state directory, and delete the worker on the Workers page.

Container

curl -fsSL https://localai.io/install/docker-compose.yaml -o docker-compose.yaml
docker compose up -d

The compose file runs the CPU image and keeps models, backends, settings and data in named volumes. For GPU images, docker run, Podman and file permissions, see Containers.

Desktop app

The desktop app installs, updates, starts and stops the LocalAI server on your computer and shows the web interface in a window. It can also connect to a LocalAI server that runs somewhere else.

The 5.0 release has the DMG for a Mac with Apple Silicon and the AppImages for Linux (x86-64 and ARM64). Later releases also have a Windows installer for x86-64. Download them from the latest release. See Desktop app for the steps, the first start, the update channels and troubleshooting.

Android app

The Android app shows the web interface of a LocalAI server on your phone. It runs nothing on the phone. It connects to a server by its address, or over P2P with an invite link. See Android app for the install steps, the sign-in, P2P and updates.

Development builds

Every push to the master branch that changes the code is built and published to one rolling pre-release, tagged dev-master: github.com/mudler/LocalAI/releases/tag/dev-master. Each new build replaces the files of the last one. The release notes give the commit of the build.

A development build is not supported. It can have bugs and it can change without notice. Use a stable release for anything that matters. The dev-master release is a pre-release, so the install script and the “latest” download links never use it.

The release has these files:

FilePlatform
local-ai-master-linux-amd64Linux, x86-64
local-ai-master-linux-arm64Linux, ARM64
local-ai-master-darwin-arm64macOS, Apple Silicon

Each file has a checksum file with the same name and the suffix .sha256. To download and verify a binary:

base=https://github.com/mudler/LocalAI/releases/download/dev-master
curl -fLO "$base/local-ai-master-linux-amd64"
curl -fLO "$base/local-ai-master-linux-amd64.sha256"
sha256sum --check local-ai-master-linux-amd64.sha256
chmod +x local-ai-master-linux-amd64
./local-ai-master-linux-amd64

On macOS, use shasum -a 256 --check instead of sha256sum --check. The command must print OK. If it does not, delete the files and download them again.

The Development update channel of the desktop app downloads these binaries.

What next

Run a first model with the quickstart.

Subsections of Install LocalAI

LocalAI docs > Start here > Install LocalAI

Desktop app

The desktop app installs, updates, starts and stops the LocalAI server on your computer and shows the web interface in its own window, with a thin status bar at the bottom. It also has pages for logs, settings and a Connect page that shows how other devices and apps reach the server.

If you want to run LocalAI on a server, in a container or in a cluster, use the server install methods in the install guide instead.

Note

This app replaces the older LocalAI launcher. If you used the older launcher, download this app once, as described below. Your models, backends and settings stay in ~/.localai. See Move from the older launcher.

When the managed server listens only on loopback, you can approve an add-on’s requested host access without signing in. To keep these changes locked, set LOCALAI_ADDON_HOST_UI_GRANTS_WITHOUT_AUTH=false in the app’s environment settings and restart the server. The app does not enable this default when you expose the server to the network.

Install on Linux

When the app is released, download the AppImage for your CPU and its checksum file from the releases page:

CPUFile
x86-64LocalAI-Launcher-x86_64.AppImage
ARM64LocalAI-Launcher-arm64.AppImage

Each file has a checksum file with the same name and the suffix .sha256. In the folder with the files, check the download, make the AppImage executable and run it:

sha256sum --check LocalAI-Launcher-x86_64.AppImage.sha256
chmod +x LocalAI-Launcher-x86_64.AppImage
./LocalAI-Launcher-x86_64.AppImage

You can also start the file from your file manager. The file is large (about 140 MB), because it contains Electron and Chromium. It needs the libraries of a normal desktop (X11 or Wayland).

An AppImage mounts itself with FUSE. The x86_64 file carries its own FUSE support, so it does not need the libfuse2 package. It does need the FUSE kernel module and the fusermount (or fusermount3) program of your distribution. If FUSE is not available, start the AppImage with this option. It extracts the image to a temporary folder and runs it from there:

./LocalAI-Launcher-x86_64.AppImage --appimage-extract-and-run

The x86_64 AppImage also starts on Linux systems that do not use glibc, such as Alpine and other musl-based distributions. It carries its own glibc and libraries for that case. The system needs bash, and the app uses software rendering there. The launcher keeps a small private folder (the loader) in $XDG_RUNTIME_DIR, in ~/.cache or in /tmp, and runs from it.

Sandbox on Ubuntu 24.04 and later

The app uses Chromium, which runs its pages in a sandbox. The sandbox needs unprivileged user namespaces. Ubuntu 23.10 and later, and distributions based on them, set kernel.apparmor_restrict_unprivileged_userns=1. With this setting, a program that has no AppArmor profile cannot create a user namespace. An AppImage cannot install a profile by itself.

In this case the app starts with the sandbox turned off (--no-sandbox). The window shows the LocalAI web interface, so its pages and model output run without that extra isolation. The status bar shows a Sandbox off chip. Select it to open a short guide. LocalAI works the same way with or without the sandbox. Debian, Fedora and Arch do not set this restriction by default, so they show no chip.

For the extra isolation, select open the WebUI in my browser instead in the guide, or turn on Open the WebUI in my browser instead in Settings. The app then opens the web interface in your browser, which has its own sandbox.

The guide has a Set up sandbox profile button, but it is disabled: setup is not available yet. AppArmor attaches a profile to the path of the program that runs. A mounted AppImage runs from a folder with a random name that users can write to, so a profile for that path would weaken the protection for other programs too. Select Not now to close the guide. The app remembers this choice for the current app version. The chip stays in the status bar.

You can turn the restriction off for all programs with sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0.

Warning

This setting weakens a protection for every program on the computer, not only for the app. Do not use it unless you understand the risk. Open the web interface in your browser instead. The setting lasts until the next restart.

Install on macOS

  1. When the app is released, download LocalAI.dmg from the releases page. It is for Macs with Apple Silicon. There is no build for Intel Macs: use a container there. The release also has a .sha256 file for the DMG. Check it with shasum -a 256 --check.
  2. Open the DMG and drag LocalAI Launcher to your Applications folder.
  3. Start it from your Applications folder.

The DMG and the app in it are signed with an Apple Developer ID and notarized. The first time a page uses the microphone or the camera, for example for voice input, macOS asks for your permission. If you never use these features, macOS never asks.

To check the signature yourself, run these commands:

spctl --assess --type execute --verbose "/Applications/LocalAI Launcher.app"
codesign --verify --deep --strict --verbose=2 "/Applications/LocalAI Launcher.app"

Install on Windows

  1. When the app is released, download LocalAI-Launcher-Setup-x64.exe from the releases page. It is for Windows 10 and 11 on x86-64. There is no Windows build for ARM64 CPUs. The release also has a .sha256 file for the installer.
  2. Run the installer. It installs the app for your user account only, in %LOCALAPPDATA%\Programs\LocalAI Launcher. It does not ask for administrator rights. It adds a Start menu shortcut and a desktop shortcut.
  3. Start LocalAI Launcher from the Start menu.

To check the download, run this command in PowerShell in the folder with the files, and compare the result with the first word in the .sha256 file:

(Get-FileHash .\LocalAI-Launcher-Setup-x64.exe -Algorithm SHA256).Hash.ToLower()

The release also has LocalAI-Launcher-win-x64.zip, a portable copy. Extract it to a folder and run local-ai-launcher.exe. The portable copy does not update itself: to update it, download the new zip. Use the installer if you want updates from the app.

Note

The installer and the app are signed only when the release was built with a code signing certificate. If they are not signed, Windows Defender SmartScreen shows “Windows protected your PC” at the first start. Select More info, then Run anyway. To see if a file is signed, open its Properties and look for the Digital Signatures tab.

When you close the window, the app stays in the notification area of the taskbar and keeps the server running. To quit, right-click the LocalAI icon there and select Quit. The local server is the native Windows server. Read Install on Windows for what it supports.

First start

On the first start the app asks you to choose:

  • Run LocalAI on this computer. The app downloads the latest LocalAI server release into ~/.localai (%LOCALAPPDATA%\LocalAI\launcher on Windows), checks its checksum, and starts it. The first start needs an internet connection. Models and backends are downloaded later, when you use them.
  • Connect to a LocalAI server. You give the address of a server that runs somewhere else, for example https://localai.example.com. The app tests the address and then opens that server in its window.

On Windows the server is local-ai.exe, and the app keeps it in %LOCALAPPDATA%\LocalAI\launcher\bin.

When the server is ready, the window shows the LocalAI web interface. You can use it as you would in a browser.

The status bar

The status bar shows the state of the server and a server switcher. To hide or show it, use Show status bar in the View menu, in the tray menu or in Settings, or press Ctrl+Shift+L (Cmd+Shift+L on macOS).

Check status from the tray

Open the tray menu to see the last snapshot of the selected server. The menu opens from memory without waiting for the server. On desktops that notify the launcher when the menu opens, opening it starts a refresh for the next opening. Linux StatusNotifier hosts do not send this notification for the main tray menu. To get a new snapshot there, choose Refresh status, then open the menu again. The launcher does not poll for tray updates.

Loaded models lists up to two names from /system, followed by a count of any remaining models. Workers shows healthy workers out of registered workers, for example Workers: 3 / 4. Standalone servers do not show a worker count. A failed request does not mean zero models or workers. Last checked shows when the launcher last obtained a complete snapshot.

Server settings

Open Settings to set up the server on this computer. The sections under LocalAI and Advanced cover the options that you can otherwise set with flags or environment variables of local-ai run. Use the search box to find one by a plain word, a flag name or a variable name.

  • Settings that the web interface can also change apply at once.
  • Other settings wait until you select Apply and restart. Select Review to see the changes first.
  • Passwords, tokens and keys are kept as secrets and are not shown again.
  • An option that your system environment sets is read-only.
  • Command line shows the equivalent local-ai run command, with secrets hidden.

Cluster options have no setting. Set them under Settings > Environment variables.

Servers

Open Settings > Servers to keep several LocalAI servers. One of them is the default.

  • This computer is the server that the app manages for you.

  • A remote server is a server you reach by address. Add it with its address, for example https://localai.example.com. The app tests it before it saves it. A server that asks you to sign in counts as reachable. You sign in in the web interface.

  • A server over P2P is a server you reach with an invite link, also when it is behind a home router. Select Have an invite link? Paste it instead in the add form, and paste the link that the server owner made in Swarm, P2P, Share (a device invite). The app pairs this computer with the server and shows a four-word confirmation phrase. The server shows the same words: check that they match. Pairing needs LocalAI on this computer, because the app uses its local-ai p2p pair and local-ai p2p forward commands. The server then opens at a fixed local address, http://127.0.0.1:<port>, and you sign in as usual. The list shows P2P and how the app reaches the server: direct, hole punched or through a relay. See P2P.

If a remote server is the default, the app opens it at once. It does not install, start or update the local server. To keep the local server running in the background anyway, turn on Keep this computer’s server running too.

To change the server, use the switcher in the status bar. The shortcut is Ctrl+Shift+S, or Cmd+Shift+S on macOS. If you pick a server in the switcher, it becomes the default. If you pick This computer, the app starts it, and installs it first when it is missing.

The app does not save the password or the API key of a remote server. You sign in again in the web interface when the server asks. GitHub and OIDC sign-in work in the window: the pages of the identity provider that the server’s sign-in redirects to open in the app, for at most 10 minutes, and the app keeps the session. The API key of the server on this computer is kept encrypted when your system has a keyring. Without a keyring, the app keeps it for the current session only.

If the address is plain http, the app shows a warning and a Remote, not encrypted chip in the status bar.

Updates

The app checks for a new LocalAI server version once a day. It never installs an update without asking you. Open Settings > Updates to check by hand, to see the installed version and to change the update channel. The app also updates itself from the same releases (from the development build on the Development channel, see below). On Linux, Restart to update replaces the AppImage file. On macOS it installs the update it downloaded. On Windows it runs the new installer, which closes the app, installs the update and starts the app again. The portable zip does not update itself.

Update channels

ChannelWhat it follows
StableThe latest release. This is the default.
Release candidatesThe newest release, including release candidates.
DevelopmentThe rolling dev-master build of the server, made from the master branch.

The Development channel is not supported. It installs the binaries that are described in Development builds, with names like local-ai-master-<os>-<arch>. It also tells the server to prefer the development backend images. This is a server setting that you can change in the web interface. Backends that are already installed stay as they are. The app also updates itself from the dev-master build while this channel is on: the next development build of the app is offered like a release update, and the same checksum check applies. A development build of the app (version like 5.0.1-dev.42) updates itself only on this channel. The portable Windows zip does not update itself. The app asks you to confirm the first change to this channel. The app shows a Development chip while you use This computer. If a remote server is the default, the channel applies to This computer only.

When you leave the Development channel with Back to Stable, the app keeps the development binary as a rollback copy. The app also keeps the previous binary after each update. If a new server binary does not become ready, the app restores the previous one.

Development builds for testers

Each change to the app on the master branch makes development builds. When the builds pass, the AppImages (x86-64 and ARM64), the DMG, and the Windows installer and zip are attached to the rolling dev-master pre-release, next to the server binaries. Each new build replaces the files of the last one. The builds are also kept as GitHub Actions artifacts, which you can download after you sign in to GitHub. Each artifact contains the AppImage, the DMG, or the Windows installer and zip, each with its .sha256 file. The file names have dev in them, for example LocalAI-Launcher-dev-x86_64.AppImage, LocalAI-Launcher-dev.dmg and LocalAI-Launcher-dev-Setup-x64.exe, so you can tell them from release files. The release files stay until the next master build replaces them. Artifacts of master builds are kept for 14 days and artifacts of pull request builds for 7 days. Pull requests have only the x86-64 AppImage. With the GitHub CLI (run gh auth login first):

# The last runs on master
gh run list --repo mudler/LocalAI --workflow launcher-electron-dev.yaml --branch master --limit 5
# Download the x86-64 AppImage of one run (use -linux-arm64, -macos-arm64 or -windows-amd64 for the others)
gh run download RUN_ID --repo mudler/LocalAI --name localai-launcher-dev-linux-amd64

A development build has a version like 5.0.1-dev.42. It updates itself only when the update channel is Development, and never from the release feed. On Stable or Release candidates, download a newer one again. A development DMG is normally signed and notarized. If it is not, macOS stops the first start. Open System Settings > Privacy & Security and select Open Anyway next to the message about LocalAI Launcher.

The Development update channel above updates the LocalAI server and the app together.

Move from the older launcher

The older launcher was a different program with the same purpose. It does not update itself to this app, so download the new file once:

  1. Quit the older launcher. If you turned on automatic start in it, turn that off first.
  2. Download the new AppImage or the DMG, as described in the install steps above. On Linux, the x86-64 file has the same name as the file of the older launcher, so it replaces that file if you save it in the same folder.
  3. On macOS, the new app is LocalAI Launcher. Move the older LocalAI app from Applications to the Trash.
  4. Start the new app.

The new app reads the same ~/.localai folder. Your models, backends and settings stay. From now on the app updates itself from the releases page.

Registry credentials

The server on this computer can pull backends, models and add-ons from private registries. To give it the credentials, open Settings > Models and use Registry credentials. Each rule has:

  • Registry: the registry host, with an optional port and path, for example registry.example or registry.example:5000/team. You can add https:// in front. Plain http:// registries are not supported here.
  • Type: Basic (a user name and a password) or Bearer token.
  • The secret: the password or the token.

The app keeps the secret in its secret store, with the API key, and does not show it again. To change a rule, select Edit. Leave the secret empty to keep the stored one. If you change the type or the registry host, you must type the secret again.

When the server starts, the app writes registry-credentials.yaml next to launcher.json. This file contains the rules and the names of environment variables, but not the secrets. The app gives the secrets to the server in those environment variables and sets LOCALAI_CREDENTIALS_FILE to the file. For the format of the file and how a rule matches a pull, see Private Registries and Galleries.

  • While there is at least one rule, this file replaces the credentials.yaml of the data folder. The server does not read your credentials.yaml then.
  • If you set LOCALAI_CREDENTIALS_FILE yourself, the app does not use its rules. Settings shows a notice.
  • The server reads the file only when it starts. After you add, change or remove a rule, restart the server.

Test sends a request with the credential to https://<registry>/v2/ and shows the result. It sends the credential only to that registry, never follows a redirect to another address, and never skips certificate errors. Some registries, such as Docker Hub, GHCR and Quay, use a separate sign-in service that gives out tokens. For these, Test cannot check the credential and shows Cannot check here: this registry uses token sign-in. The server can still use the credential.

Where your data is

On Linux and macOS, the app keeps everything for the local server under ~/.localai:

  • Models and backends. To move them, open Settings > Storage and select Change… next to the folder, then choose a folder in the dialog.
  • bin, with the local-ai server binary and local-ai.previous, the copy that the app keeps for a rollback.
  • The server configuration.
  • launcher.json, the settings of the app, including the saved server addresses.

On Windows, the app uses the same folders as local-ai.exe started from a terminal (see Where LocalAI keeps its files), so both find the same models:

  • %LOCALAPPDATA%\LocalAI: models, backends, the server data and configuration, and the logs.
  • %LOCALAPPDATA%\LocalAI\launcher: launcher.json, the secrets file, and bin with local-ai.exe and local-ai.previous.exe. This is not the bin folder of the PowerShell installer, so the two do not replace each other’s server.

If an earlier build of the app left a launcher.json in %USERPROFILE%\.localai, the app keeps using that folder for everything. It does not move files. To move to the standard folders, quit the app, move the models and backends folders to %LOCALAPPDATA%\LocalAI, and move or delete %USERPROFILE%\.localai.

On every system, when LOCALAI_BASE_PATH is set to a full path, the app uses it as the default data folder instead. Folders that you chose in Settings win.

Do not run the app’s server and a local-ai run from a terminal at the same time on the same folders.

The app keeps the API key of the local server and other secrets in a separate file next to launcher.json. The system keyring encrypts them when one exists. On Windows the app encrypts them for your user account with the Windows data protection API.

To remove the app, delete the AppImage file on Linux, or drag LocalAI Launcher from Applications to the Trash on macOS. On Windows, quit the app, then remove LocalAI Launcher in Settings > Apps > Installed apps (or delete the folder of the portable copy). This does not delete ~/.localai (on Windows %LOCALAPPDATA%\LocalAI), so your models stay. To remove all data, delete that folder after you quit the app. The app also adds an autostart entry only if you turn on Launch at login in Settings. Turn it off before you remove the app.

Troubleshooting

The AppImage does not start

If you see an error about FUSE, install fuse3 (or fuse) so that fusermount is available, or run the file with --appimage-extract-and-run as shown above. An AppImage from an earlier release needs libfuse2 (libfuse2t64 on Ubuntu 24.04 and later). Check that the file is executable: chmod +x LocalAI-Launcher-x86_64.AppImage.

Windows asks about the firewall

The app starts the server on 127.0.0.1, which only this computer can reach, so Windows does not ask. If you let other devices reach the server (the Connect page), the server listens on your network, and Windows Defender Firewall can ask if local-ai.exe may accept connections. Allow it for private networks only.

Stopping the server on Windows

On Windows the app cannot ask the server to shut down. It ends the server and the backends it started at once, with taskkill. Requests that run at that time stop. Models, settings and downloads that are complete are not affected.

The status bar shows “Sandbox off”

This happens on Ubuntu 24.04 and later. See Sandbox on Ubuntu 24.04 and later. Use Open in my browser instead if you prefer a sandboxed browser.

The remote server does not answer

While the default server does not answer, the app shows a recovery screen and tries again every 30 seconds. It never starts the local server by itself. Check these points:

  • The address is correct and includes https:// or http://.
  • The server is running. Run curl https://localai.example.com/readyz from this computer.
  • A firewall, a proxy or a VPN does not block the connection.
  • The certificate of the server is valid. The app never skips certificate errors.

Then choose Retry, or use the switcher to select This computer.

The local server does not start

Open the Logs page. The last lines show the reason. If an update leaves a server that does not start, the app restores the previous binary.

Next steps

LocalAI docs > Start here > Install LocalAI

Android app

The LocalAI app for Android shows the web interface of a LocalAI server on your phone. It is a client only. Nothing runs on the phone: the server runs on another computer, at home, at work or in the cloud. The app keeps a list of servers, tests each one before it saves it, and opens its web interface in a locked view with a thin status bar. It reaches a server by its address, or over P2P with an invite link, also when the server is behind a home router.

To run a LocalAI server, use one of the server install methods in the install guide or the desktop app.

The app needs Android 8.0 (API level 26) or later on a 64-bit ARM device (arm64-v8a). The server page needs Android System WebView (or Chrome) version 111 or later.

Install the app

The app is not in an app store. You download the APK file from the LocalAI releases and install it yourself (“sideloading”).

  1. When the app is released, open the latest release in the browser on your phone.
  2. Download LocalAI-Android.apk for the stable app. If the release offers only LocalAI-Android-experimental-debug-key.apk, that is the development app for manual testing. Each build uses a new signing key: to replace a previous development build, uninstall it first. This removes its saved servers and sign-ins but does not affect the stable app.
  3. Open the downloaded file. Android asks if the browser may install unknown apps.
  4. Select Settings, turn on Allow from this source, and go back.
  5. Select Install.

Android asks for the consent in step 4 only once for each browser. The app cannot skip or change this step.

Download the matching .apk.sha256 file. To check the download on a computer before you copy the file to the phone, run this command in the folder with both files (substitute the experimental filename if needed):

sha256sum --check LocalAI-Android.apk.sha256

The command must print OK. If it does not, delete the files and download them again.

You can also install the file from a computer with adb install LocalAI-Android.apk.

Android developer verification

Google is rolling out Android developer verification. On a certified Android device, an app must come from a registered developer. LocalAI publishes the APK only after the app and its signing key are registered.

Add a server

On the first start, the app shows Connect to a LocalAI server. Add a server in one of these ways. To add more servers later, open Settings > Servers. The app keeps up to 20 servers. One of them is the default, and the app opens it at the next start.

By address

  1. Select Add by address.
  2. Type the address of the server, for example https://gpu.example.com. Include the port if it is not the default, for example http://192.168.1.20:8080.
  3. Select Test. The app checks the address, the certificate, and that the server is LocalAI.
  4. Select Connect.

A server that asks you to sign in counts as reachable. If the address is plain http, the app shows Not encrypted. The app does not follow a redirect to another site.

An invite link starts with localai://pair. The server owner makes it in the web interface of the server: open Cluster, then Sharing, then Share this instance. The server must have P2P sharing turned on. See P2P. The app accepts a device invite and a remote invite. A device invite works once and for a short time.

You can give the invite to the app in four ways:

  • Paste it. Select Paste an invite link and paste the link.
  • Scan the QR code. Select Scan an invite QR code and point the camera at the code on the server’s Share this instance dialog. The app asks for the camera permission the first time.
  • Open the link. Select a localai://pair link in another app, for example in a message. The link opens the LocalAI app.
  • Share it. Share the text of the invite from another app, and choose LocalAI in the share menu.

In every case, the app first shows a preview of the invite: the server name, the kind of invite, the routes and the time left. The app never pairs before you select Pair. If the text is not an invite, the app shows This is not a LocalAI invite link and does nothing else.

When the app pairs, it shows a four-word confirmation phrase. The server shows the same words. Make sure that the words match. If they do not match, someone else used the invite: tell the server owner.

After pairing, the app reaches the server at a local address on the phone, for example http://127.0.0.2:41001. Each P2P server has its own local address, so each server keeps its own sign-in. The server list shows P2P and how the app reaches the server: direct, hole punched, or through a relay.

While the app is connected to a P2P server, it asks the server for its current routes (its addresses and relays) when the connection opens and every 10 minutes after, and saves them. So the app still finds the server after the server’s relays or addresses change.

Sign in

The app does not save passwords or API keys. If the server asks you to sign in, you sign in on the server’s own page, in the app. The app keeps the sign-in of each server separate from the others, and keeps it after a restart. Android does not copy the sign-ins to a backup or to a new phone.

These sign-in methods work:

  • User name and password.
  • API key.
  • GitHub or OIDC sign-in. The sign-in page of the identity provider opens in the app, and the app keeps the session. While you sign in, the app shows the pages of the identity provider that the server’s sign-in redirects to, for at most 10 minutes. When you are back on the server, other addresses open in your browser again.

Sign in with the invite

A P2P invite can also sign you in. When the server gives a sign-in invite, the server answers the pairing with a device credential. The app keeps the credential in its private storage, encrypted with a key of the Android Keystore, and never shows it to the web pages. The app then opens the server signed in as the person who made the invite: you do not type a password.

When the server’s sign-in page shows later, for example because the session ended, the app uses the credential again, one time. If the server refuses it, for example because the device was revoked, the app shows the sign-in page and does not try again until you open the server again. Sign in by hand then, or ask for a new invite.

If you sign out in the server’s page, the app stops the automatic sign-in for that server. The sign-in page shows, and the app does not use the credential, also after you close and open the app again. Sign in by hand, or open the server again from the server list: the app then signs you in with the credential again. A new pairing with the server also turns the automatic sign-in on again. When you remove a server, the app deletes its credential. A server that does not give a credential works as before: you sign in on its page.

If an identity provider page opens in your browser instead, the provider moved to another address without a redirect. The sign-in does not complete in the app then: use a password or an API key on that server. Passkeys and security keys of the identity provider do not work in the app; choose another sign-in method of the provider.

Certificates and private CAs

The app never skips a certificate error, and has no “continue anyway” choice. If the test of a server shows The certificate is not trusted, the server’s certificate is expired, is for another name, is self-signed, or comes from a certificate authority (CA) that the phone does not trust.

The app trusts the CAs of Android and the CAs that you install yourself. If your server uses a private CA, install the certificate of that CA on the phone:

  1. Copy the CA certificate file (.crt or .pem) to the phone.
  2. Open the Android Settings and search for CA certificate. On most phones, the path is Security > Encryption & credentials > Install a certificate > CA certificate.
  3. Select the file and confirm.
  4. In the app, test the server again.

The names of the settings are different on some phones. A self-signed server certificate that is not a CA certificate does not work. Make a private CA, sign the server certificate with it, and install the CA.

P2P in the background

Android stops the network connections of an app in the background. To keep a P2P server reachable, for example while a chat answer streams and you switch to another app, the app runs a foreground service. Android then shows a notification, for example Connected to Home GPU over P2P, with a Disconnect action.

  • The service runs while at least one P2P server is saved and the app is on the screen.
  • When the app leaves the screen, the service runs for 10 more minutes, then stops.
  • When you open the app again, the app connects again. If the connection stopped while the app was away, the app loads the server page again, but only after the connection is open.
  • To keep the connection open in the background, turn on Keep P2P connection in the background in Settings. It is off by default.
  • Disconnect in the notification stops the service and turns that setting off.

On Android 13 and later, the app asks for the permission to show notifications the first time you add a P2P server. If you deny it, the P2P connection still works, but Android does not show the notification.

When the phone changes network, for example from Wi-Fi to mobile data or when a VPN starts, the app restarts the P2P connections. The local address of each server stays the same, so the page and the sign-in stay too.

Other apps on the phone can connect to the local address of a P2P server, as on a computer. They still need a sign-in to the server.

While the app’s own P2P connection to a server is not open, another app can take the local address of that server. For this reason the app shows the page of a P2P server, and sends it your sign-in, only while its own connection listens on that address. At other times the server shows as not reachable. If another app holds the address, the P2P connection fails with “address already in use”: close that app, or restart the phone. The app tries to connect again by itself.

Phone notifications

The app can tell you when a model install that you started on your default server finishes or fails. Turn on Phone notifications in Settings. It is off by default. On Android 13 and later, the app then asks for the permission to show notifications; if you deny it, the setting stays off.

  • The app follows the inbox of the default server only. For a P2P server, it follows the inbox only while its P2P connection is open.
  • When you turn the setting on, the app reads the inbox as it is and shows nothing for the items that are already there. It shows only results that come after.
  • One install gives one notification. A notification does not mark the item read in the server’s inbox, and dismissing it does not delete the item.
  • Select the notification, or View details, to open the server and its Models page, also when the app was closed.
  • The notification says only Model installed or Model install failed. It never shows the model name, the server name or address, or an error. On the lock screen it says LocalAI job finished or LocalAI job needs attention.
  • If the app was away for a long time and more items came than it can read at once, it shows one Check your LocalAI inbox notification instead.
  • When you sign out of the server, remove it, or turn the setting off, its notifications go away.

Android shows two channels that you can change in the Android settings: Job updates (quiet) and Needs attention. The app never changes a channel after you change it.

The app reads the inbox while it runs, also in the background, but it starts no service for this. When Android pauses or closes the app, for example in battery saver mode, the notifications come when you open the app again. A server without the notification inbox (an older LocalAI) sends no notifications; the rest of the app works as before.

Updates

The app checks for a new version once a day, when you open it. Open Settings > Updates to see the installed version and the channel, to check by hand with Check now, or to turn off Check automatically.

When an update is available, the app downloads it in the background. Then it checks the size, the SHA-256 checksum, and that the update has the same signing certificate as the installed app. If a check fails, the app deletes the file and installs nothing. A pill Update to X.Y.Z appears in the status bar. Select it to open the update sheet.

The app never installs an update without a tap from you:

  1. The first time, the sheet asks you to allow updates from LocalAI. Select Open Android settings, turn on Allow from this source, and go back to the app.
  2. Select Update now. LocalAI closes and opens again on the new version. Your servers and sign-ins stay.

What you see after Update now depends on the Android version:

AndroidAfter Update now
12 and laterThe update installs with no more questions, in most cases.
8 to 11Android shows its own dialog. Select Update (or Install).

Android can show its dialog on Android 12 and later too. For example, it does so when another installer, such as an app store, installed the app first. If the dialog does not appear, select Update now again.

Development app

The development app follows the rolling dev-master pre-release, made from the master branch. It is not supported. It can have bugs and change without notice.

The development app is a separate app (io.localai.client.dev), with its own name (LocalAI Dev), servers and sign-ins. It has the same icon as the stable app, and its status bar shows a Development chip. It installs next to the stable app (io.localai.client). The two apps never update each other. The development app updates itself only from dev-master, and its version looks like 5.0.2-dev.42.

To get it, open Settings > Updates in the stable app and select Get the development app. The browser downloads LocalAI-Android-dev.apk, and you install it as in Install the app. You can also download it from the dev-master release.

Each pull request and each push to master that changes the app also builds a debug APK of the development app. It is a GitHub Actions artifact of the Android client workflow (localai-android-pr or localai-android-dev). A debug APK has a different signing key. Uninstall the development app before you install a debug APK, and the reverse.

Permissions

PermissionWhy the app needs it
Internet, network stateTo reach your servers, and to restart P2P connections when the network changes.
Notifications (Android 13 and later)To show the notification of the P2P service, and the phone notifications of model installs. The app asks the first time you add a P2P server, and when you turn on Phone notifications.
Foreground serviceTo keep P2P connections open while you use another app.
Install apps, update without user actionTo install its own updates after you select Update now.
CameraTo scan invite QR codes, and for server pages that use the camera. Android asks when the app first needs it.
Microphone, audio settingsFor server pages that use the microphone, for example voice input. Android asks when the app first needs it.

When a server page asks for the microphone or the camera, the app also asks you for each server. Select Remember for this server to keep the answer.

Where your data is

The app keeps the list of servers and its settings in its private storage. Android backup includes this list. The sign-ins of the servers and the P2P identity of the phone stay on the phone: Android does not back them up or copy them to a new phone.

After you restore a backup on a new phone, sign in to each server again. P2P servers do not connect, because the new phone has a new P2P identity. Remove each P2P server and pair it again with a new invite.

To remove the app and all its data, uninstall it in the Android settings. On Android 10 and later, files that you downloaded from a server page stay in the Downloads folder. On Android 8 and 9, the app saves downloads in its own folder (Android/data/<app ID>/files/Download), and Android deletes that folder when you uninstall the app: move the files that you want to keep first.

Troubleshooting

The server does not answer

While the default server does not answer, the app shows a recovery screen and tries again every 30 seconds. Check these points:

  • The address is correct and includes https:// or http://.
  • The phone uses the right network or VPN. An address such as 192.168.1.20 works only on the same network as the server.
  • The server is running. Open https://gpu.example.com/readyz in the browser on the phone.

Then select Retry, or choose another server.

A P2P server does not connect

When a P2P connection fails, the app tries again by itself, after 1 second, then after longer waits, up to 1 minute. Make sure that P2P sharing is still on at the server, and that the server owner did not revoke this device. If the device was revoked, remove the server in the app and pair again.

If the phone was away from the server for a long time, the saved routes can be out of date. Ask the server owner for a new invite and scan or paste it. The app sees that the server is already saved and shows Update routes instead of Pair. It connects with the routes of the invite and does not use the invite code. It saves new routes only when the server gives them over that connection, so an invite that someone else wrote cannot change the saved routes. Then ask the server owner to cancel the unused invite on the server: Cluster, then Sharing.

The server page does not open

When the server answers but its page does not load, or the page stops working, the app shows The page of (server name) did not load or stopped working, with the reason. Select Try again. If you report the problem, include that reason.

The app needs Android System WebView (or Chrome) version 111 or later. Update Android System WebView in the app store of your phone.

“P2P is not available in this build of the app”

This build of the app has no P2P library. Download the APK again from the releases page.

LocalAI docs > Start here > Install LocalAI

Containers

LocalAI supports Docker, Podman, and other OCI-compatible container engines. This guide covers the common aspects of running LocalAI in containers.

Prerequisites

Before you begin, ensure you have a container engine installed:

Podman might not resolve short image names such as localai/localai:latest. The Podman examples use the docker.io/ prefix to identify the container registry explicitly.

Quick Start

Download the compose file and start it:

curl -fsSL https://localai.io/install/docker-compose.yaml -o docker-compose.yaml
docker compose up -d

Then open http://localhost:8080 and install a model from the gallery.

The compose file runs the CPU image localai/localai:latest. It keeps models, backends, settings and application data in four named volumes, so they stay when you recreate the container or upgrade the image. It restarts LocalAI after a crash or a reboot. To use a GPU, see Using Compose.

To upgrade to a new release:

docker compose pull
docker compose up -d

docker compose down stops LocalAI and keeps the volumes. docker compose down -v also deletes the volumes, with all models and data.

Without Compose, use docker run with the same four volumes:

docker run -d --name local-ai --restart unless-stopped --init -p 8080:8080 \
  -v localai-models:/models \
  -v localai-backends:/backends \
  -v localai-data:/data \
  -v localai-configuration:/configuration \
  localai/localai:latest
# Or with Podman:
podman run -d --name local-ai --restart unless-stopped --init -p 8080:8080 \
  -v localai-models:/models \
  -v localai-backends:/backends \
  -v localai-data:/data \
  -v localai-configuration:/configuration \
  docker.io/localai/localai:latest

Docker and Podman create the named volumes when the container starts for the first time. To follow the logs, run docker logs -f local-ai.

Image Types

LocalAI provides several image types to suit different needs. These images work with both Docker and Podman.

The commands in this section show only the image and the GPU flags. Add the -d, --restart, --init and -v options from the Quick Start to keep your data.

Standard Images

Standard images don’t include pre-configured models. Use these if you want to configure models manually.

CPU Image

docker run -ti --name local-ai -p 8080:8080 localai/localai:latest
# Or with Podman:
podman run -ti --name local-ai -p 8080:8080 docker.io/localai/localai:latest

GPU Images

Choose the image that matches your hardware and installed drivers:

  • NVIDIA CUDA 12 is the compatibility choice for systems with CUDA 12 drivers. Use CUDA 13 when your NVIDIA driver and toolkit support CUDA 13.
  • AMD ROCm is for supported AMD GPUs, while Intel is for Intel GPUs with the required device runtime.
  • Jetson uses the L4T ARM64 image. Choose its CUDA 12 image for Jetson AGX Orin-class devices or CUDA 13 for DGX Spark.
  • Vulkan works across vendors and is the fallback when no matching CUDA, ROCm, or Intel image is available.

NVIDIA CUDA 13:

docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-gpu-nvidia-cuda-13
# Or with Podman:
podman run -ti --name local-ai -p 8080:8080 --device nvidia.com/gpu=all docker.io/localai/localai:latest-gpu-nvidia-cuda-13

NVIDIA CUDA 12:

docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-gpu-nvidia-cuda-12
# Or with Podman:
podman run -ti --name local-ai -p 8080:8080 --device nvidia.com/gpu=all docker.io/localai/localai:latest-gpu-nvidia-cuda-12

AMD GPU (ROCm):

docker run -ti --name local-ai -p 8080:8080 --device=/dev/kfd --device=/dev/dri localai/localai:latest-gpu-hipblas
# Or with Podman:
podman run -ti --name local-ai -p 8080:8080 --device rocm.com/gpu=all docker.io/localai/localai:latest-gpu-hipblas

Intel GPU:

docker run -ti --name local-ai -p 8080:8080 --device=/dev/dri localai/localai:latest-gpu-intel
# Or with Podman:
podman run -ti --name local-ai -p 8080:8080 --device gpu.intel.com/all docker.io/localai/localai:latest-gpu-intel

Vulkan:

docker run -ti --name local-ai -p 8080:8080 --device=/dev/dri localai/localai:latest-gpu-vulkan
# Or with Podman:
podman run -ti --name local-ai -p 8080:8080 --device=/dev/dri docker.io/localai/localai:latest-gpu-vulkan

For an NVIDIA GPU with the Vulkan image, use --gpus all instead of --device=/dev/dri.

The container adds the groups that own /dev/kfd and /dev/dri/* to the user that runs LocalAI, so --group-add is not necessary.

NVIDIA Jetson (L4T ARM64):

CUDA 12 (for Nvidia AGX Orin and similar platforms):

docker run -ti --name local-ai -p 8080:8080 --runtime nvidia --gpus all localai/localai:latest-nvidia-l4t-arm64

CUDA 13 (for Nvidia DGX Spark):

docker run -ti --name local-ai -p 8080:8080 --runtime nvidia --gpus all localai/localai:latest-nvidia-l4t-arm64-cuda-13

Using Compose

The compose file of the Quick Start is the recommended setup. It is the same file as docker-compose.yaml in the repository. It uses no .env file and installs no model.

To use a GPU, edit docker-compose.yaml:

  1. Change image to the GPU tag, for example localai/localai:latest-gpu-nvidia-cuda-12. The comments in the file list the tags.
  2. Remove the # from the block for your GPU (NVIDIA, AMD, or Intel and Vulkan).
  3. Run docker compose up -d.

For NVIDIA, the block reserves all GPUs. It needs the NVIDIA Container Toolkit on the host:

services:
  localai:
    image: localai/localai:latest-gpu-nvidia-cuda-12
    # ...
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]

For AMD, Intel and Vulkan, the block passes the device files:

services:
  localai:
    image: localai/localai:latest-gpu-hipblas
    # ...
    devices:
      - /dev/kfd   # AMD only
      - /dev/dri

With Podman, use podman compose up -d or podman-compose up -d, and add the docker.io/ prefix to the image name.

To build LocalAI from a source checkout instead, use docker-compose.dev.yaml in the repository: docker compose -f docker-compose.dev.yaml up -d --build.

Persistent Storage

The container exposes the following volumes:

VolumeDescriptionCLI FlagEnvironment Variable
/modelsModel files used for inferencing--models-path$LOCALAI_MODELS_PATH
/backendsCustom backends for inferencing--backends-path$LOCALAI_BACKENDS_PATH
/configurationDynamic config files (api_keys.json, external_backends.json, runtime_settings.json)--localai-config-dir$LOCALAI_CONFIG_DIR
/dataPersistent data: collections, chat files, add-ons, JSON stores when there is no database, generated images, audio and video (/data/generated), uploads (/data/upload), the home folder (/data/home) and caches (/data/cache). Downloads are staged in /data/downloading until they are extracted--data-path$LOCALAI_DATA_PATH
Warning

Container files that are not stored in a volume are lost when the container is recreated during an image upgrade. Mount all four paths if you want to preserve installed models, backends, settings, and application data.

The host paths can be anywhere on persistent storage, but the container paths must be exactly /models, /backends, /configuration, and /data. In UnRAID and other container-template UIs, create one path mapping for each row in the table above.

Backend OCI images contain symbolic links. When /backends is stored on a filesystem that cannot create links, such as some CIFS/SMB mounts, LocalAI materializes each link as a regular file so installation can complete. This can use more disk space than a local filesystem. Prefer a Docker or Podman named volume for /backends when possible.

Named volumes, as in the Quick Start, need no preparation. To keep the files in folders of the host instead (bind mounts), create the folders first as your own user. If Docker creates a missing folder, root owns it. Then start the container:

mkdir -p models backends data configuration
docker run -d --name local-ai --restart unless-stopped --init -p 8080:8080 \
  -v "$PWD/models:/models" \
  -v "$PWD/backends:/backends" \
  -v "$PWD/data:/data" \
  -v "$PWD/configuration:/configuration" \
  localai/localai:latest

With Compose, use the bind-mount lines in the comments of docker-compose.yaml. To know who owns the files, see Container user and permissions.

Container user and permissions

LocalAI does not run as root in the container. The image starts as root only to run entrypoint.sh. The entrypoint selects a user, makes the data folders writable for that user, and then starts LocalAI as that user. An add-on that runs commands in an isolated sandbox needs this, because it refuses to run as root. See the sandbox in the LocalAI container for the devices and permissions it needs.

The entrypoint selects the user in this order:

  1. If LOCALAI_UID is set, LocalAI runs as LOCALAI_UID and LOCALAI_GID.
  2. If LOCALAI_UID and LOCALAI_GID are not set, and /data and /models have the same owner that is not root, LocalAI runs as that owner.
  3. In all other cases, LocalAI runs as the user localai (uid and gid 10001).

The entrypoint then gives each data folder (/models, /backends, /configuration, /data) that another user owns to the selected user (chown -R). It logs each change. On a large models folder, this can take some time on the first start. In case 2, /data and /models already belong to the selected user, so the entrypoint does not change them. When the image has no user for the selected uid, the entrypoint adds one.

The entrypoint also adds the groups that own /dev/kvm, /dev/kfd, /dev/dri/* and /var/run/docker.sock when you pass them to the container. It never adds group 0 (root).

Warning

Access to the Docker socket is equal to root access on the host. Mount /var/run/docker.sock only into a container that needs it, and only on a host that you trust.

When root owns the socket with group root, as on Docker Desktop, the entrypoint cannot give the user access to it. To use the socket there, set LOCALAI_RUN_AS_ROOT=true.

The home folder of the user is /data/home. The backends keep their caches there, for example the caches of the Python backends. LocalAI keeps the Sigstore trust data, which verifies signed add-ons and backends, in /data/cache/sigstore. These caches stay when you recreate the container.

At startup, LocalAI checks that it can write to its folders: models, backends, data, configuration, generated content, uploads, download staging, the home folder and the temporary folder. If it cannot write to one of them, it logs one line and continues to start:

WARN LocalAI cannot write to some of its folders; installs, uploads and caches that use them will fail. Give the folders to the user LocalAI runs as, or run it as their owner. See https://localai.io/docs/start/install/containers/#container-user-and-permissions folders="..." uid=... gid=...

folders names each folder and its owner. uid and gid are the user that LocalAI runs as. If you see this line, use the list below to correct the setup.

Select the setup that matches your installation:

  • Named volumes (recommended). Nothing to do. The volumes belong to uid 10001 inside Docker. Use docker compose cp or docker cp to copy files into them.

  • Bind mounts that you created. Create the four folders as your own user before the first start, as shown in Persistent Storage. Because /data and /models then have your uid, LocalAI runs as you, and the files on the host stay yours.

  • Bind mounts that root owns. This includes folders that Docker created because they did not exist. The entrypoint gives them to uid 10001. On the host, you then need sudo to change the files. To use your own user instead, give the folders to that user (sudo chown -R "$(id -u):$(id -g)" models backends data configuration) and start the container again.

  • A fixed user (LOCALAI_UID, LOCALAI_GID). Set them when the files must belong to a known user, for example the user of a NAS share. This setting always has priority. The entrypoint gives the data folders to that user.

  • docker run --user, Compose user:, Kubernetes runAsUser. The entrypoint then changes no owner and adds no group. The data folders must already be writable by that user. Add the groups of the GPU devices yourself with --group-add (Compose group_add:). When the home folder of that user is missing or not writable, the entrypoint uses /data/home. When /data is not writable either, it uses a folder in /tmp, and the caches are lost when the container stops. New named volumes belong to uid 10001, so another user cannot write them. LocalAI then still starts and serves the models it has, but it logs the WARN line, turns add-ons off with an ERROR line that starts with “Add-ons are off”, and backend installs fail. Give the volumes to that user, or remove --user.

  • Rootless Podman. Map your host user to uid 10001 in the container, so that the folders on the host stay owned by you:

    podman run -d --name local-ai --init -p 8080:8080 \
      --userns=keep-id:uid=10001,gid=10001 \
      -v "$PWD/models:/models" -v "$PWD/backends:/backends" \
      -v "$PWD/data:/data" -v "$PWD/configuration:/configuration" \
      docker.io/localai/localai:latest

    With this option, LocalAI starts as uid 10001 and the entrypoint adds no device groups. For a GPU, add --group-add keep-groups (it needs the crun runtime) so that the container keeps the groups of your host user.

  • Rootless Docker. Use named volumes. With bind mounts, the files on the host get a uid from the subordinate range of your user, not your own uid.

  • Read-only root file system. All data that LocalAI writes goes to the four volumes. Backends and some features also need a temporary folder, so mount /tmp as a tmpfs. This setup should work, but it is not tested in CI yet:

    services:
      localai:
        image: localai/localai:latest
        read_only: true
        tmpfs:
          - /tmp
        # ... init, restart, ports and the four volumes of docker-compose.yaml

    With docker run, use --read-only --tmpfs /tmp.

  • Run as root (LOCALAI_RUN_AS_ROOT=true). LocalAI runs as root, as before version 5.0.0. Add-ons that run commands in a sandbox are then unavailable.

  • A network or read-only mount that refuses chown. Make it writable for the user of LocalAI on the storage side. Or set LOCALAI_UID and LOCALAI_GID to the owner of the files.

Note

LocalAI 5.0.1 and earlier always run as uid 10001 unless LOCALAI_UID is set, use /home/localai as the home folder, keep generated content and uploads under /tmp, do not add the group of the Docker socket, and do not log the WARN line about folders. Later images do all of this as described above.

Next Steps

After installation:

  1. Access the WebUI at http://localhost:8080
  2. Check available models: curl http://localhost:8080/v1/models
  3. Install additional models
  4. Try out examples

Troubleshooting

Container won’t start

  • Check container engine is running: docker ps or podman ps
  • Check port 8080 is available: netstat -an | grep 8080 (Linux/Mac)
  • View logs: docker logs local-ai or podman logs local-ai

GPU not detected

  • Ensure Docker has GPU access: docker run --rm --gpus all nvidia/cuda:12.0.0-base-ubuntu22.04 nvidia-smi
  • For Podman, pass the GPU with the --device flags shown in the GPU sections above (for example --device nvidia.com/gpu=all)
  • For NVIDIA: Install NVIDIA Container Toolkit
  • For AMD: Ensure devices are accessible: ls -la /dev/kfd /dev/dri

NVIDIA Container fails to start with “Auto-detected mode as ’legacy’” error

If you encounter this error:

Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running prestart hook #0: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy'
nvidia-container-cli: requirement error: invalid expression

This indicates a Docker/NVIDIA Container Toolkit configuration issue. The container runtime’s prestart hook fails before LocalAI starts. This is not a LocalAI code bug.

Solutions:

  1. Use CDI mode (recommended): Update your docker-compose.yaml to use the CDI driver configuration:

    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia.com/gpu
              count: all
              capabilities: [gpu]
  2. Upgrade NVIDIA Container Toolkit: Ensure you have version 1.14 or later, which has better CDI support.

  3. Check NVIDIA Container Toolkit configuration: Run nvidia-container-cli --query-gpu to verify your installation is working correctly outside of containers.

  4. Verify Docker GPU access: Test with docker run --rm --gpus all nvidia/cuda:12.0.0-base-ubuntu22.04 nvidia-smi

Models not downloading

  • Check internet connection
  • Verify disk space: df -h
  • Check container logs for errors: docker logs local-ai or podman logs local-ai
  • If the logs show status 401 or 403, the source needs authentication. See Private Registries and Galleries

Permission denied on a data folder

  • Look for the WARN line at startup that starts with LocalAI cannot write to some of its folders. It names the folders, their owner, and the uid and gid of LocalAI.
  • Select the setup that matches yours in Container user and permissions.

An add-on install fails with “invalid or unverified addon package”

LocalAI checks the signature of each add-on with Sigstore. It downloads the Sigstore trust data once and keeps it in a cache in /data/cache/sigstore. The log line after the error names the check that failed.

The causes below occur on LocalAI 5.0.1, which keeps the cache in the home folder /home/localai. They are fixed in later images. On 5.0.1:

  • A failed download of the trust data. LocalAI 5.0.1 does not try the download again until it restarts. Restart the container (docker compose restart localai or docker restart local-ai) and install the add-on again.

  • LOCALAI_UID or LOCALAI_GID is set. The home folder /home/localai stays owned by uid 10001, so LocalAI cannot write its cache. Remove the two variables and recreate the container. Or, on 5.0.1, chown /home/localai to your user and restart. This lasts until the container is recreated:

    docker compose exec -u 0 localai chown -R <uid>:<gid> /home/localai
    docker compose restart localai

    Replace localai with the name of your service when it is different.

  • docker run --user or Compose user:. The home folder of that user is not writable. Set HOME=/data/home in the environment of the container.

  • A read-only root file system. Set HOME=/data/home and mount /tmp as a tmpfs, as shown in Container user and permissions.

Full image reference

The quick-start examples above use the Docker Hub image names. Every image is published to both Docker Hub and Quay. The tables below map the Docker Hub tag to its Quay equivalent for each variant. Replace v5.1.1 with a released version to pin a specific build.

​
DescriptionQuayDocker Hub
Latest images from the branch (development)quay.io/go-skynet/local-ai:masterdocker.io/localai/localai:master
Latest tagquay.io/go-skynet/local-ai:latestdocker.io/localai/localai:latest
Versioned imagequay.io/go-skynet/local-ai:v5.1.1docker.io/localai/localai:v5.1.1

See Also

LocalAI docs > Start here > Install LocalAI

Linux Installation

To run LocalAI on a Linux desktop with an application, use the desktop app. This page describes the server binary.

Manual Installation

Download Binary

You can manually download the appropriate binary for your system from the releases page:

  1. Go to GitHub Releases
  2. Download the binary for your architecture (amd64, arm64, etc.)
  3. Make it executable:
chmod +x local-ai-*
  1. Run LocalAI:
./local-ai-*

Run your first model

Starting the binary on its own gives you an empty server. Open http://localhost:8080 and the first-run guide recommends a model for your hardware. To name a model yourself, run LocalAI with a model name and it will download and serve it from the gallery:

./local-ai-* run gemma-4-e2b-it-qat-q4_0

Once it is ready, open the WebUI at http://localhost:8080 or send a request to the API:

curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{
  "model": "gemma-4-e2b-it-qat-q4_0",
  "messages": [{"role": "user", "content": "Hello!"}]
}'

System Requirements

Hardware requirements vary based on:

  • Model size
  • Quantization method
  • Backend used

For performance benchmarks with different backends like llama.cpp, visit this link.

Configuration

After installation, you can:

  • Access the WebUI at http://localhost:8080
  • Configure models in the models directory
  • Customize settings via environment variables or config files

Start LocalAI on demand with systemd

LocalAI accepts a single TCP listener passed through the systemd socket activation protocol. This lets systemd listen on the public port and start LocalAI only when the first client connects.

Create /etc/systemd/system/local-ai.socket:

[Unit]
Description=LocalAI API socket

[Socket]
ListenStream=8080
NoDelay=true

[Install]
WantedBy=sockets.target

Create the matching /etc/systemd/system/local-ai.service:

[Unit]
Description=LocalAI

[Service]
Type=simple
User=localai
Group=localai
ExecStart=/usr/local/bin/local-ai run
WorkingDirectory=/var/lib/local-ai

Adjust the user, binary path, working directory, and model configuration for your installation. Then enable the socket, not the service:

sudo systemctl daemon-reload
sudo systemctl enable --now local-ai.socket

The first connection to port 8080 starts local-ai.service; systemd holds that connection until LocalAI is ready to accept it. LOCALAI_ADDRESS and --address are ignored while an inherited listener is present. LocalAI rejects activation with multiple stream listeners so it cannot silently choose the wrong endpoint.

For a Podman-managed container, configure Podman to preserve and pass the systemd socket file descriptor into the container. The LocalAI process inside the container consumes the same activation protocol.

Activation needs both LISTEN_PID and LISTEN_FDS. If only one of them is set, LocalAI ignores them and binds --address as usual. A container engine started from a socket-activated system unit can leak a bare LISTEN_PID into every container it spawns, and that is not an activation attempt.

Next Steps

LocalAI docs > Start here > Install LocalAI

Install on macOS

On a Mac with Apple Silicon, run the install script. On an Intel Mac, use a container, because there is no macOS binary for Intel.

curl -sSL https://localai.io/install.sh | sh

The quickstart shows how to start the server and run a first model. The install guide lists the options of the script.

Desktop app

The DMG holds an app named LocalAI Launcher. It installs and starts the LocalAI server for you and shows the web interface in its own window. The desktop app guide has the install steps, the signature checks, the first start and how to move from the older launcher.

LocalAI docs > Start here > Install LocalAI

Install on Windows

LocalAI runs natively on Windows. It uses pre-built backend images packaged as OCI tarballs, so you do not need WSL, Docker Desktop or MSYS2 to run it. The llama.cpp backend is the first backend with native Windows support. Other backends are not available on Windows yet.

To install and run LocalAI with a window and a tray icon instead of PowerShell, use the desktop app. It downloads local-ai.exe for you, checks its checksum, starts it and updates it.

Prerequisites

  • Windows 10 or 11 on amd64. There is no Windows arm64 build.
  • PowerShell. LocalAI starts the backend through powershell.exe, which ships with Windows.
  • ffmpeg, if you use audio features. LocalAI does not bundle it. Install it with winget install Gyan.FFmpeg or choco install ffmpeg, or set LOCALAI_FFMPEG_PATH to the full path of ffmpeg.exe. If LocalAI cannot find it, the start log shows a warning.

The llama.cpp backend comes from the backend gallery as a native Windows image. LocalAI runs it as a normal process.

Install

Install script

The PowerShell script installs LocalAI for your user. It needs no administrator rights. It downloads the release file local-ai-<version>-windows-amd64.exe, checks its SHA-256 sum against the checksum file of the release, and puts it in %LOCALAPPDATA%\LocalAI\bin. It then adds that folder to your user PATH. It works in Windows PowerShell 5.1 and in PowerShell 7.

To read the script before you run it, download it first:

irm https://localai.io/install.ps1 -OutFile install.ps1
Get-Content .\install.ps1
powershell -ExecutionPolicy Bypass -File .\install.ps1

The one-line form runs the script without a review step:

irm https://localai.io/install.ps1 | iex

Run the script again to upgrade. It does nothing when the installed file already matches the release. A running local-ai.exe keeps the old version until you restart it.

The download-then-run form takes these parameters. The one-line form cannot take parameters, so set the environment variable in the same row before it.

ParameterEnvironment variableEffect
-Version v4.7.1LOCALAI_VERSIONInstall a given release. The default is the latest release.
-InstallDir C:\tools\localaiINSTALL_DIRInstall into this folder. The default is %LOCALAPPDATA%\LocalAI\bin.
-NoPathLOCALAI_NO_PATH=1Do not change your PATH.
-InstallBackendLOCALAI_INSTALL_BACKEND=1Download the llama.cpp backend after the install, with local-ai backends install llama-cpp, into the backends folder of the data folder (see Where LocalAI keeps its files). Without this, LocalAI downloads it when a model first needs it.
-ForceLOCALAI_FORCE=1Install again even when the same build is present.
-UninstallLOCALAI_UNINSTALL=1Remove local-ai.exe and the PATH entry. Your models, backends and settings stay in %LOCALAPPDATA%\LocalAI.

Example with a pinned version and the backend, in one line:

$env:LOCALAI_VERSION = 'v4.7.1'; $env:LOCALAI_INSTALL_BACKEND = '1'; irm https://localai.io/install.ps1 | iex

The script stops with a clear message on Windows arm64, because there is no arm64 build. It uses TLS 1.2 or later and stops when the checksum does not match.

Manual install

Download local-ai-<version>-windows-amd64.exe from the releases page. The checksum file of the release is LocalAI-<version>-checksums.txt. Check the file with Get-FileHash -Algorithm SHA256 .\local-ai-<version>-windows-amd64.exe, put it in a folder of your choice and run it from PowerShell.

First run

# Download a model (for example, Llama 3.2 1B Instruct GGUF)
.\local-ai.exe model install huggingface://bartowski/Llama-3.2-1B-Instruct-GGUF:Q4_K_M

# Start LocalAI
.\local-ai.exe run

LocalAI picks the llama.cpp binary from the Windows backend image for you. You do not need to configure anything.

Where LocalAI keeps its files

On Windows, LocalAI uses the standard folders of your user account, not the current folder (except for the files of an earlier build, see below). You can start local-ai.exe from any folder and it finds the same models.

FolderDefault on WindowsFlagVariable
Models%LOCALAPPDATA%\LocalAI\models--models-pathLOCALAI_MODELS_PATH
Backends%LOCALAPPDATA%\LocalAI\backends--backends-pathLOCALAI_BACKENDS_PATH
Data (chats, files, database)%LOCALAPPDATA%\LocalAI\data--data-pathLOCALAI_DATA_PATH
Configuration (runtime settings, API keys)%LOCALAPPDATA%\LocalAI\configuration--localai-config-dirLOCALAI_CONFIG_DIR
Downloads in progress%LOCALAPPDATA%\LocalAI\downloading--download-staging-pathLOCALAI_DOWNLOAD_STAGING_PATH
Backends that an administrator installs%ProgramData%\LocalAI\backends--backends-system-pathLOCALAI_BACKENDS_SYSTEM_PATH
Generated content and uploads%TEMP%\localai-<SID>--generated-content-path, --upload-pathLOCALAI_GENERATED_CONTENT_PATH, LOCALAI_UPLOAD_PATH

%LOCALAPPDATA% is usually C:\Users\<you>\AppData\Local. The folder is private to your account and Windows does not copy it to other computers with a roaming profile. The configuration stays in this folder too, and not in the roaming %APPDATA% folder, because it holds API keys and settings that are specific to this computer.

A flag or a variable of one folder always wins over the default. To move all the folders in the LocalAI folder at once, for example to a larger drive, set LOCALAI_BASE_PATH:

$env:LOCALAI_BASE_PATH = 'D:\LocalAI'
.\local-ai.exe run

LOCALAI_BASE_PATH moves the models, backends, data, configuration and downloading folders. It does not move the temporary folders or the folder of the administrator backends. To keep the setting, put it in an env file (see below) or set it as a user variable in Settings > System > About > Advanced system settings > Environment Variables.

Earlier test builds. Earlier builds used the current folder. When the current folder has files that only LocalAI writes (an installed backend, a model configuration or a .gguf file in models, data\database.db, or runtime_settings.json or api_keys.json in configuration), LocalAI keeps using the current folder and logs a warning with the standard folder. It never moves or deletes files. To use the standard folder, move the models, backends, data and configuration folders to %LOCALAPPDATA%\LocalAI while LocalAI is stopped, or set LOCALAI_BASE_PATH to the old folder to keep it and stop the warning.

Env files. LocalAI reads variables from these files when they exist, in this order. A variable keeps the first value it gets, and a variable that is already set in the environment wins over all files:

  1. .env and localai.env in the current folder
  2. %USERPROFILE%\localai.env and %USERPROFILE%\.config\localai.env
  3. %LOCALAPPDATA%\LocalAI\localai.env (for your user)
  4. %ProgramData%\LocalAI\localai.env (for all users of the computer, the Windows form of /etc/localai.env)

Long paths. LocalAI itself handles long paths. The backends that it starts may not: most Windows programs are limited to 260 characters in a path. When the models, backends, data or downloading folder is longer than 200 characters, local-ai run logs a warning. Use a shorter folder, or enable long paths in Windows.

What is not available on Windows yet

  • The Sandbox add-on in the library. On Windows it runs in WSL 2 (see Sandbox add-on), but its Windows package is not published yet. Until it is, chat commands that need the Sandbox add-on are not available.
  • The worker commands for backends without a Windows build: local-ai worker mlx-distributed, vllm and ds4-distributed stop at once with an error. See Distributed mode and workers on Windows for what works.
  • Backends other than llama.cpp.
  • The built-in bash tool of the chat. It needs a POSIX shell and process groups. It is not a fallback for the Sandbox add-on: without the Sandbox add-on, the chat has no tool that runs commands on Windows.

Distributed mode and workers on Windows

A Windows host can be a node of a LocalAI cluster:

  • local-ai worker (distributed mode with NATS) registers the host as a worker. The frontend can schedule llama.cpp models on it. A model that needs another backend fails to start on this node with the message “this backend has no Windows build”.
  • local-ai worker llama-cpp-rpc runs the llama.cpp RPC server. The RPC server is in the rpc variant of the Windows backend image, which the published image includes.
  • The worker reports the GPU and its VRAM. For NVIDIA GPUs it uses nvidia-smi, which the NVIDIA driver installs. For other GPUs it reads the adapter list from DirectX (DXGI) and the memory in use from the “GPU Adapter Memory” performance counters (Windows 10 version 1709 or later). An integrated GPU reports the shared system memory it can use. If the counters are not available, the free VRAM is unknown: the worker reports the total VRAM, and its heartbeats do not report free VRAM. The frontend then keeps the free VRAM from the registration, which is the total.
  • The frontend and the workers can run on different operating systems. A path on a worker keeps the separator of the worker’s operating system.

The default folders are the same as for local-ai run: models, backends and data in %LOCALAPPDATA%\LocalAI. See Where LocalAI keeps its files. Set --models-path, --backends-path and LOCALAI_DATA_PATH, or LOCALAI_BASE_PATH, to use other folders.

Stop a worker

Ctrl+C or Ctrl+Break stops the worker. The worker deregisters from the frontend and stops its backends. Each backend runs in a Windows job object, so it also stops when the worker process is killed. The worker also records the process of each backend, and its next start stops any backend that is still running.

Join a cluster with a join token

An admin mints a join token on the Nodes page of the frontend (Add worker), which gives a command such as irm 'https://ai.example.com/join.ps1?t=...' | iex. Run it from an elevated PowerShell. It runs install.ps1 with LOCALAI_WORKER=1, which installs local-ai.exe in %ProgramFiles%\LocalAI\bin and creates the LocalAIWorker service with sc.exe, as in the next section. The models, backends and the credential of the worker go to %ProgramData%\LocalAI. The join token is stored in the Environment value of the service key, which the script closes to SYSTEM and Administrators, and it is not put on a command line. The worker needs the token once. To remove it: sc.exe stop LocalAIWorker, sc.exe delete LocalAIWorker, delete %ProgramData%\LocalAI, and delete the node on the Nodes page. This mode is new and has not been tested on every Windows version. See Join tokens.

Run a worker as a Windows service

LocalAI connects to the Windows service manager when it starts as a service. This applies to every command, for example local-ai run and local-ai worker. A stop or shutdown request then stops LocalAI like Ctrl+C. Create the service from an elevated PowerShell, with the full path to the executable and the worker flags:

sc.exe create LocalAIWorker start= auto binPath= "C:\LocalAI\local-ai.exe worker --register-to http://frontend:8080 --nats-url nats://nats:4222 --models-path C:\LocalAI\models --backends-path C:\LocalAI\backends"
sc.exe start LocalAIWorker

Set the paths explicitly. The service runs as LocalSystem unless you set another account with obj=, and the %LOCALAPPDATA% folder of LocalSystem is in the system profile (C:\Windows\System32\config\systemprofile\AppData\Local). A folder such as %ProgramData%\LocalAI or C:\LocalAI is easier to find and to back up. To move all folders with one setting, set LOCALAI_BASE_PATH for the service. Set environment variables such as LOCALAI_REGISTRATION_TOKEN and LOCALAI_DATA_PATH for the service in the registry key HKLM\SYSTEM\CurrentControlSet\Services\LocalAIWorker, value Environment (multi-string), or pass them as flags.

Limits

  • Only the llama.cpp backend has a Windows build, so a Windows worker serves llama.cpp models only.
  • The per-process VRAM figures of the Nodes page are not available on Windows. The node totals are.
  • Worker and distributed mode have had much less use on Windows than on Linux. Report problems on the issue tracker.

Backend selection on Windows

The Windows backend image has these llama.cpp executables:

  • llama-cpp-cpu-all.exe: the CPU build with all ggml CPU variants. The ggml registry loads the best variant for your CPU. LocalAI uses this build by default.
  • llama-cpp-fallback.exe: a static build for any x86-64 CPU. LocalAI uses it only when llama-cpp-cpu-all.exe is not in the image.
  • llama-cpp-grpc.exe: the RPC build. It is compiled without AVX, AVX2, AVX512, FMA, F16C and BMI2, so it is slower on the CPU. LocalAI uses it only when the LLAMACPP_GRPC_SERVERS environment variable is set.

Windows has no shell to run the run.sh stub. LocalAI starts run.ps1 through powershell.exe instead. The script selects the binary with the rules above, adds the lib folder to PATH and forwards the arguments.

GPU (Vulkan) support

The Windows backend image ships ggml-vulkan.dll alongside the CPU backends. The single llama-cpp-cpu-all.exe build auto-detects a Vulkan device at startup and offloads gpu_layers to it when a model requests them, falling back to CPU inference on hosts with no Vulkan driver. No configuration is required. The Vulkan loader (vulkan-1.dll) is bundled with the image and loaded dynamically, so the backend never hard-depends on it.

Environment variables

VariableEffect
LLAMACPP_GRPC_SERVERSComma-separated RPC server addresses. When set, run.ps1 starts llama-cpp-grpc.exe and the backend connects to these servers.
LOCALAI_BASE_PATHFolder that holds the models, backends, data, configuration and downloading folders. The default is %LOCALAPPDATA%\LocalAI. See Where LocalAI keeps its files.
LOCALAI_FFMPEG_PATHFull path of the ffmpeg.exe program. When it is not set, LocalAI looks for ffmpeg on PATH.

Troubleshooting

Missing Visual C++ runtime

If the backend fails to start with a DLL not found error, install the Visual C++ Redistributable.

CUDA backend aborts on load (ucrtbase.dll, 0xc0000409)

The CUDA backend DLL ships binaries for the standard GPU architecture set (Turing sm_75 and newer, per the llama.cpp defaults). If the CUDA backend process aborts during model load, the installed image was likely built with a narrower architecture set than the host GPU - rebuild with the default set (make backends/llama-cpp-windows-cuda does not pin architectures) and check the GPU’s compute capability with nvidia-smi --query-gpu=name,compute_cap --format=csv.

Antivirus / SmartScreen

Windows Defender SmartScreen may warn about local-ai.exe and the backend binaries. The server binary of a release is signed with Authenticode only when the project has a signing certificate set up for that release, and the backend binaries are not signed. A file that you download with the install script has no web mark, so SmartScreen does not check it. A file that you download with a browser does. Click More info and then Run anyway to proceed. Check the SHA-256 sum against the checksum file of the release first. To see if a file is signed, run Get-AuthenticodeSignature .\local-ai.exe.

App chats fail with “The model’s context window is too small for the tools”

The chat UI runs the model as an agent: it always sends the session tool schemas (about 25 tools, 6–8k tokens) with every turn, before any conversation text. A model configured with a small context_size (8192 and below with the default tool set) cannot fit them, and every chat fails with a context_too_small message while plain /v1/chat/completions calls still work. Raise the context window in the model YAML (most current models support far more than 8k):

context_size: 16384

or reduce the tool surface (disconnect MCP servers, disable built-in tool groups in the chat’s settings).

CLI commands fail while the server runs (“port 55421 is already in use”)

CLI commands (model install, backends install, …) bind the add-on owner loopback port, which the running server already holds. Stop the server before running CLI commands, or pass --addons-enabled=false to the CLI command.

Model download URIs

The huggingface:// URI needs the explicit file for direct installs:

.\local-ai.exe model install huggingface://<user>/<repo>/<model-file>.gguf

Gallery names (for example local-ai.exe models install <gallery-model>) resolve through the model gallery index instead.

Chats: “the built-in bash cannot run commands on this machine”

The chats’ built-in bash needs a POSIX process group and shell, which Windows does not provide, so the command tool is unavailable (the reasoning and chat itself keep working). On Windows, only the Sandbox add-on runs commands, in WSL 2 (see Sandbox add-on). LocalAI never runs a command of a chat on Windows without isolation.

Add-ons on Windows

The add-on runtime runs on Windows as on Linux and macOS. Install add-ons from the Add-ons page. The library lists only the add-ons that have a Windows package. Each add-on runs as its own process (<name>.exe). When an add-on stops, or LocalAI exits, Windows also stops every process the add-on started. An add-on whose manifest has "osSettings": {"windows": {"execution": "wsl2"}} runs in WSL 2 instead (see Sandbox add-on).

Sandbox add-on

The Sandbox add-on runs the commands of a chat in an isolated Linux guest (gVisor, or a virtual machine with KVM). Windows has neither, so on Windows the add-on runs in a WSL 2 distribution: its Windows package carries the Linux program, and LocalAI starts it with wsl.exe. Nothing of it runs on Windows itself.

Note

The Windows package of the Sandbox add-on is not in the library yet. It is published after its check passes on a Windows machine with WSL. This section describes how it works when it is.

Requirements

  • WSL 2. Install it with wsl --install in a terminal that runs as administrator, then restart Windows. Update an old WSL with wsl --update.
  • A WSL 2 distribution, for example Ubuntu: wsl --install -d Ubuntu. LocalAI uses the default distribution (wsl --list --verbose marks it with *). To use another one, set --addons-wsl-distro (or LOCALAI_ADDONS_WSL_DISTRO) to its name. A WSL 1 distribution is refused; convert it with wsl --set-version <name> 2.
  • gVisor needs nothing more: the package carries runsc, and the WSL 2 kernel has user namespaces. KVM needs nested virtualization (Windows 11) and access to /dev/kvm in the distribution. The Sandbox settings page shows which backend works and why the others do not.

How it works

  • LocalAI copies the add-on, once per version, into the home folder of the default user of the distribution (~/.local/share/localai-addons/packages). The data of the add-on (guest images, sandboxes) stays there too (~/.local/share/localai-addons/data), on the Linux file system. LocalAI reaches it as \\wsl.localhost\<distribution>\....
  • LocalAI talks to the add-on over the standard input and output of wsl.exe, so it works with every WSL networking mode and needs no firewall rule.
  • When LocalAI stops the add-on, or exits, wsl.exe stops, and the add-on stops a few seconds later. LocalAI does not stop the distribution.

When it cannot run

If WSL 2 cannot run the add-on, the add-on does not start, and LocalAI runs nothing on Windows in its place. The log has the line “An add-on did not start”, and the Tools menu of a chat says why the Sandbox cannot run commands, for example “WSL is not installed” or “uses WSL 1”. Fix the cause and restart LocalAI.

Security

  • The guest of a sandbox sees only its image and the files of the chat. It has no network device: it reaches the network only through the proxy of the add-on, which asks LocalAI about each connection. It cannot start Windows programs.

  • The add-on process itself runs in the distribution as its default user. By default WSL mounts the Windows drives under /mnt with your rights, and a Linux program in WSL can start Windows programs. The add-on does not use them, but LocalAI cannot stop a program in WSL from doing so. This is the same trust as on Linux, where the add-on runs as the LocalAI user.

  • The host backend of the add-on, which runs commands with no isolation, is off on Windows: in WSL its commands could reach your Windows files.

  • To limit what the distribution can reach, use a distribution only for LocalAI and turn off the drive mounts and the start of Windows programs in its /etc/wsl.conf:

    [automount]
    enabled = false
    
    [interop]
    enabled = false

    Then run wsl --terminate <name> and set --addons-wsl-distro to it.

  • Other distributions run in the same WSL 2 virtual machine and share its network. They can connect to the loopback ports of the add-on. Each connection needs a credential that LocalAI makes for each start.

Limits

  • Only the Sandbox add-on runs in WSL 2. Other add-ons that need Linux are not available on Windows.
  • The files that a chat gives to a sandbox go through \\wsl.localhost, which is slower than a local disk.
  • LocalAI cannot check that a Windows machine has WSL 2 before you install the add-on. The install works; the add-on then says why it cannot start.

Firewall

LocalAI binds :8080 on all interfaces by default, with no API key configured. On a shared network, that exposes the API to anyone who can reach the host. For local use, bind explicitly to the loopback interface and set a key instead:

./local-ai.exe --address 127.0.0.1:8080 --api-key your-key-here

When the firewall prompts on first run, allow local-ai.exe only if you intend to listen on non-loopback interfaces (for example, to serve models to other machines on your LAN); for a loopback-only setup, deny the prompt.

Private files on Windows

On Linux and macOS, LocalAI keeps secret files private with POSIX permission bits (mode 0600 for a file, 0700 for a folder). Windows has no permission bits. On Windows, LocalAI gives these files a protected access control list (ACL) that grants access to the current user only. This applies to:

  • the sealing keys of the remotes and connectors stores,
  • the HMAC secret for API key hashing,
  • the TLS and MITM proxy private keys,
  • the CLI chat configuration,
  • the add-on gateway keys, the add-on loopback port file and the add-on host policy file,
  • the add-on package folders and the add-on runtime state folder,
  • every state file that LocalAI writes atomically with a private mode.

Before LocalAI reads a sealing key or one of the add-on files and folders above, it checks the ACL. The SYSTEM account and the Administrators group can stay in the list, because they can read every file on the machine. If another user or group has access, for example because the key was written by an older LocalAI version and has the ACL of its folder, LocalAI replaces the ACL. For a file, it also logs a warning. On Linux and macOS a key file or folder with a loose mode is refused instead.

Known limits:

  • Files that LocalAI does not mark as private keep the ACL of their folder. On a shared machine, keep the data folder in a place that other users cannot read. By default it is in your user profile.
  • Windows has no executable bit. LocalAI treats a file as a program when its extension is .exe, .com, .cmd, .bat or .ps1. An add-on package must name an .exe file as its executable, and LocalAI starts only that file.

Other differences on Windows

  • Temporary folders. Generated content, uploads and backend scratch files go to %TEMP%\localai-<SID>, where <SID> is the security identifier of your account. On Linux and macOS the folder name has the user id instead.
  • Symbolic links in backend images. Windows lets a user make symbolic links only with administrator rights or in Developer Mode. Without that right, LocalAI copies the target of each link in a backend image in its place. The install takes more disk space but works the same.
  • Stopping the server. Ctrl+C and Ctrl+Break stop LocalAI gracefully: it finishes the requests in flight and then exits. When you close the console window, or when you log off or shut down, Windows gives the process only about 5 seconds, so long requests can be cut.
  • Converted schedules. Windows does not give LocalAI the name of its time zone. When old cron tasks are converted to chat schedules, they run in UTC and the report says so. To keep the local time, set the TZ environment variable to a zone name, for example TZ=Europe/Rome, before you start LocalAI.
  • Windows service. LocalAI does not install itself as a Windows service, but it can run as one: when the service manager starts it, a service stop or a shutdown stops it like Ctrl+C. Create the service with sc.exe, as shown in Run a worker as a Windows service; the same steps work for local-ai run. You can also run LocalAI from a console or from the Task Scheduler at logon.

Building from source

The commands mirror the Linux/macOS flow: make build produces the local-ai.exe app, and the backend is built and installed by its own target (make backends/llama-cpp-windows builds the backend image and installs it into the local backend store, like backends/% does on Linux).

cd C:\source_path\LocalAI
make build                        # the local-ai.exe app
make backends/llama-cpp-windows   # the llama.cpp backend image + install

Backend image targets

See scripts/build/llama-cpp-windows.sh (section “Variant selection”) and the Makefile targets below if you want to rebuild the Windows backend image locally. The targets depend on build (the app) the same way the Linux backends/% targets do, and they are re-runnable: an interrupted build can simply be run again (the script re-arms its source clones, and the long gRPC build tree is reused between runs). The build requires an MSYS2 UCRT64 environment with mingw-w64 GCC, CMake 4.x, Ninja, the Vulkan headers/loader and glslc (see below), and Go (to build the local-ai.exe that assembles the OCI image tar; it must be reachable via GOROOT, GO_TOOLCHAIN_ROOT, or PATH).

TargetBuildsOutput
make backends/llama-cpp-windowsdefault image: one llama.cpp build with Vulkan support (CPU everywhere, GPU offload when a Vulkan driver is present)backend-images/llama-cpp.tar
make backends/llama-cpp-windows-alleverything the CI publishes: vulkan + rpc + fallbackbackend-images/llama-cpp.tar
make backends/llama-cpp-windows-cpuCPU-only build (no Vulkan packages needed)backend-images/llama-cpp-cpu.tar
make backends/llama-cpp-windows-vulkanthe Vulkan-capable build alonebackend-images/llama-cpp-vulkan.tar
make backends/llama-cpp-windows-cudaCUDA build. Needs the NVIDIA CUDA toolkit and Visual Studio 2022+ (the C++ workload provides the MSVC host compiler nvcc requires); the script locates both automatically and explains what is missing. The llama.cpp tree stays MinGW-built; only ggml-cuda.dll comes from an MSVC configure and is loaded at runtimebackend-images/llama-cpp-cuda.tar
make backends/llama-cpp-windows-rpcgRPC-RPC server + ggml-rpc-serverbackend-images/llama-cpp-rpc.tar
make backends/llama-cpp-windows-fallbackstatic lowest-common-denominator buildbackend-images/llama-cpp-fallback.tar

Arbitrary combinations (one of cpu/vulkan/cuda plus any of rpc, fallback) can be selected directly with LLAMA_CPP_WINDOWS_VARIANTS="vulkan rpc" make backends/llama-cpp-windows-vulkan.

Setting up MSYS2 UCRT64

The Makefile target installs MSYS2 and the toolchain automatically (after confirmation) when they are missing, so the manual steps below are only needed if you prefer to install by hand:

  1. Download and install MSYS2 from https://www.msys2.org/
  2. Open the MSYS2 UCRT64 terminal (not plain MSYS2)
  3. Install the build toolchain:
pacman -S --needed --noconfirm base-devel git cmake ninja mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-vulkan-headers mingw-w64-ucrt-x86_64-vulkan-loader mingw-w64-ucrt-x86_64-spirv-headers mingw-w64-x86_64-shaderc

The Vulkan packages are required: GGML_VULKAN=ON makes CMake’s FindVulkan treat glslc as a REQUIRED component, and ggml-vulkan runs find_package(SPIRV-Headers CONFIG REQUIRED). MSYS2 ships glslc only in the mingw64 variant of shaderc (there is no ucrt64 build). It is a standalone tool, so the build script adds /mingw64/bin to PATH when no glslc is already available (e.g. from a Vulkan SDK installed via the registry). The script also installs mingw-w64-ucrt-x86_64-spirv-headers itself if its cmake config is missing, so the docs’ package list is only a head start.

  1. Run the build from a plain Windows shell (PowerShell, cmd, or Git bash):
cd C:\source_path\LocalAI
make backends/llama-cpp-windows

On a native Windows host the Makefile hands the build to scripts/build/llama-cpp-windows.ps1, which runs the sh script under the real MSYS2 UCRT64 bash. If MSYS2 (or its mingw-w64 UCRT64 toolchain) is not installed, the dispatcher asks for confirmation before downloading and installing it via winget/pacman; declining stops the build. No need to open the UCRT64 terminal yourself.

Inside the MSYS2 UCRT64 terminal the script runs directly:

cd /source_path/LocalAI
bash scripts/build/llama-cpp-windows.sh

The script packages the result as an OCI tarball (backend-images/llama-cpp.tar) and, when run through the Makefile, installs it with ./local-ai.exe backends install "ocifile://...".

CI build

CI builds the Windows backend in the reusable .github/workflows/backend_build_windows.yml workflow, dispatched from .github/workflows/backend.yml for the includeWindows matrix entry. Only llama-cpp has a Windows build path today. A future entry dispatched without one fails loudly rather than upload an empty tarball.

The pipeline:

  1. Build job (windows-latest): sets up MSYS2 UCRT64 with the same package set as the local instructions above, caches ccache keyed on the pinned LLAMA_VERSION, then runs make backends/llama-cpp-windows-all in an MSYS2 shell (the Go toolchain from actions/setup-go is handed in via GO_TOOLCHAIN_ROOT, since the MSYS2 shell resets PATH). The produced backend-images/llama-cpp.tar is uploaded as a workflow artifact.
  2. Publish job (ubuntu-latest, skipped on PRs): downloads the tarball, logs into DockerHub and quay.io with crane, tags it with the standard branch/semver/sha metadata (the -windows-amd64-llama-cpp tag suffix from the matrix), and pushes the OCI image to both registries.

The gallery entry points at the published image, so local-ai backends install fetches the exact artifact CI produced.

The published image is signed keyless with Sigstore/cosign, the same way the platform images that go through the backend_merge.yml manifest merge are: the publish job resolves the pushed digest and signs it with an OCI 1.1 referrer bundle. The gallery does not enforce a verification: policy yet. Strict mode stays off until a gallery covers every published variant, so installs verify the signature, but a missing or invalid one degrades to a warning rather than a refusal.

LocalAI docs > Start here > Install LocalAI

Run with Kubernetes

Install LocalAI on Kubernetes with the Helm chart. LocalAI listens with authentication off, so read Authentication before you expose the service.

helm repo add go-skynet https://go-skynet.github.io/helm-charts/
helm repo update
helm show values go-skynet/local-ai > values.yaml
helm install local-ai go-skynet/local-ai -f values.yaml

Edit values.yaml before you install. The chart is maintained in the helm-charts repository and released separately from LocalAI, so its default image can be older than the latest LocalAI release. Check the image tag in its values.yaml and set a newer one if you need it.

To reach the server from your computer, forward its port and check that it answers. Use the service name of your release:

kubectl port-forward svc/<service-name> 8080:8080
curl http://localhost:8080/readyz

Example manifests

You can also apply a plain deployment file from the examples repository. The links follow the main branch, so read the file before you apply it:

kubectl apply -f https://raw.githubusercontent.com/mudler/LocalAI-examples/refs/heads/main/kubernetes/deployment.yaml

For NVIDIA GPUs:

kubectl apply -f https://raw.githubusercontent.com/mudler/LocalAI-examples/refs/heads/main/kubernetes/deployment-nvidia.yaml

Next steps

LocalAI docs > Start here > Install LocalAI

Running on Nvidia ARM64

LocalAI can be run on Nvidia ARM64 devices, such as the Jetson Nano, Jetson Xavier NX, Jetson AGX Orin, and Nvidia DGX Spark. The following instructions will guide you through building and using the LocalAI container for Nvidia ARM64 devices.

Platform Compatibility

  • CUDA 12 L4T images: Compatible with Nvidia AGX Orin and similar platforms (Jetson Nano, Jetson Xavier NX, Jetson AGX Xavier)
  • CUDA 13 L4T images: Compatible with Nvidia DGX Spark

Prerequisites

Pre-built Images

Pre-built images are available on quay.io and dockerhub:

CUDA 12 (for AGX Orin and similar platforms)

docker pull quay.io/go-skynet/local-ai:latest-nvidia-l4t-arm64
# or
docker pull localai/localai:latest-nvidia-l4t-arm64

CUDA 13 (for DGX Spark)

docker pull quay.io/go-skynet/local-ai:latest-nvidia-l4t-arm64-cuda-13
# or
docker pull localai/localai:latest-nvidia-l4t-arm64-cuda-13

Build the container

If you need to build the container yourself, use the following commands:

CUDA 12 (for AGX Orin and similar platforms)

git clone https://github.com/mudler/LocalAI

cd LocalAI

docker build --build-arg SKIP_DRIVERS=true --build-arg BUILD_TYPE=cublas --build-arg BASE_IMAGE=nvcr.io/nvidia/l4t-jetpack:r36.4.0 --build-arg IMAGE_TYPE=core -t quay.io/go-skynet/local-ai:master-nvidia-l4t-arm64-core .

CUDA 13 (for DGX Spark)

git clone https://github.com/mudler/LocalAI

cd LocalAI

docker build --build-arg SKIP_DRIVERS=false --build-arg BUILD_TYPE=cublas --build-arg CUDA_MAJOR_VERSION=13 --build-arg CUDA_MINOR_VERSION=0 --build-arg BASE_IMAGE=ubuntu:24.04 --build-arg IMAGE_TYPE=core -t quay.io/go-skynet/local-ai:master-nvidia-l4t-arm64-cuda-13-core .

Usage

Run the LocalAI container on Nvidia ARM64 devices with the following commands. They keep models, backends, settings and data in named volumes:

CUDA 12 (for AGX Orin and similar platforms)

docker run -d --name local-ai --restart unless-stopped --init -p 8080:8080 \
  --runtime nvidia --gpus all \
  -v localai-models:/models -v localai-backends:/backends \
  -v localai-data:/data -v localai-configuration:/configuration \
  quay.io/go-skynet/local-ai:latest-nvidia-l4t-arm64

CUDA 13 (for DGX Spark)

docker run -d --name local-ai --restart unless-stopped --init -p 8080:8080 \
  --runtime nvidia --gpus all \
  -v localai-models:/models -v localai-backends:/backends \
  -v localai-data:/data -v localai-configuration:/configuration \
  quay.io/go-skynet/local-ai:latest-nvidia-l4t-arm64-cuda-13

To use a folder of the host for the models, create it as your own user first, and see Persistent Storage for the bind mounts.

GPU reporting in distributed mode

If you run a worker on a Jetson, DGX Spark (GB10), or Thor and the Nodes page in the frontend shows the node as fully used, check two things:

  1. NVIDIA_DRIVER_CAPABILITIES must include utility so nvidia-smi / NVML work inside the container. With --gpus all alone (or --runtime nvidia without extra flags) only compute is wired in on some driver versions. Add -e NVIDIA_DRIVER_CAPABILITIES=compute,utility to your docker run. For Docker Compose with driver: nvidia, use capabilities: [gpu, compute, utility] on the device reservation. Include compute for CUDA libraries such as libcuda.so.1; utility alone only provides monitoring libraries and tools.
  2. Pass --init to docker run (or init: true in compose) so the container has a proper PID 1 reaper - otherwise short-lived child processes like nvidia-smi can intermittently fail with waitid: no child processes.

On unified-memory devices LocalAI auto-detects the SoC via /sys/devices/soc0/{family,soc_id} and reports system RAM as VRAM, so nvidia-smi is not strictly required for VRAM metrics. See Distributed Mode → NVIDIA GPU support for full context.

LocalAI docs > Start here

Try it out

Once LocalAI is installed, you can start it (either by using docker, or the cli, or the systemd service).

By default the LocalAI WebUI should be accessible from http://localhost:8080. You can also use 3rd party projects to interact with LocalAI as you would use OpenAI (see also Integrations ).

After installation, install new models by navigating the model gallery, or by using the local-ai CLI.

Tip

To install models with the WebUI, see the Models section. With the CLI you can list the models with local-ai models list and install them with local-ai models install <model-name>.

You can also run models manually by copying files into the models directory.

You can test chat models from the CLI without keeping a separate curl command around:

# Terminal 1
local-ai run

# Terminal 2
local-ai chat --model gemma-4-e2b-it-qat-q4_0

local-ai chat connects to a running LocalAI server and opens the built-in terminal agent. It is more than a chat prompt: it can read your files and run commands on your machine, so the first time it wants to do something that changes state it stops and asks you to approve the call. Reads and searches run without asking. Press Esc or Ctrl+C to end the session. Esc is a key of the full-screen interface: in the plain --cli mode, leave with Ctrl+C, Ctrl+D, or by typing exit.

Use /models to list installed models, /model <name> to switch models while keeping the conversation, and /compact to summarize the history so far when the context fills up. The full picture is on the Terminal agent page.

If the server exposes exactly one model, LocalAI uses that model automatically:

# Terminal 1
local-ai run gemma-4-e2b-it-qat-q4_0

# Terminal 2
local-ai chat

When more than one model is configured, the agent asks you to pick one and remembers your answer, or you can pass --model with the installed model name. Use --endpoint to connect to a non-default server, for example local-ai chat --endpoint http://127.0.0.1:8081 --model gemma-4-e2b-it-qat-q4_0.

You can also test out the API endpoints using curl. A few examples are listed below.

Note

Each example assumes you have already installed the model it names. The chat and function-calling examples below use gemma-4-e2b-it-qat-q4_0 (install it from the Models page or with local-ai run gemma-4-e2b-it-qat-q4_0). The other examples name a model for the task they show (gpt-4-vision-preview for vision, tts-1 for text to speech, whisper-1 for transcription, text-embedding-ada-002 for embeddings); replace each with the name of a model you have installed for that task.

Text Generation

Creates a model response for the given chat conversation. OpenAI documentation.

curl http://localhost:8080/v1/chat/completions \
      -H "Content-Type: application/json" \
      -d '{ "model": "gemma-4-e2b-it-qat-q4_0", "messages": [{"role": "user", "content": "How are you doing?", "temperature": 0.1}] }' 

GPT Vision

Understand images.

curl http://localhost:8080/v1/chat/completions \
    -H "Content-Type: application/json" \
    -d '{ 
        "model": "gpt-4-vision-preview", 
        "messages": [
          {
            "role": "user", "content": [
              {"type":"text", "text": "What is in the image?"},
              {
                "type": "image_url", 
                "image_url": {
                  "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg" 
                }
              }
            ], 
          "temperature": 0.9
          }
        ]
      }' 

Function calling

Call functions

curl http://localhost:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemma-4-e2b-it-qat-q4_0",
    "messages": [
      {
        "role": "user",
        "content": "What is the weather like in Boston?"
      }
    ],
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "get_current_weather",
          "description": "Get the current weather in a given location",
          "parameters": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string",
                "description": "The city and state, e.g. San Francisco, CA"
              },
              "unit": {
                "type": "string",
                "enum": ["celsius", "fahrenheit"]
              }
            },
            "required": ["location"]
          }
        }
      }
    ],
    "tool_choice": "auto"
  }'

Anthropic Messages API

LocalAI supports the Anthropic Messages API for Claude-compatible models. Anthropic documentation.

curl http://localhost:8080/v1/messages \
  -H "Content-Type: application/json" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "gpt-4",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "How are you doing?"}
    ],
    "temperature": 0.7
  }'

Open Responses API

LocalAI supports the Open Responses API specification with support for background processing, streaming, and advanced features. Open Responses documentation.

curl http://localhost:8080/v1/responses \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4",
    "input": "Say this is a test!",
    "max_output_tokens": 1024,
    "temperature": 0.7
  }'

For background processing:

curl http://localhost:8080/v1/responses \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4",
    "input": "Generate a long story",
    "max_output_tokens": 4096,
    "background": true
  }'

Then retrieve the response:

curl http://localhost:8080/v1/responses/<response_id>

Image Generation

Creates an image given a prompt. OpenAI documentation.

curl http://localhost:8080/v1/images/generations \
      -H "Content-Type: application/json" -d '{
          "prompt": "A cute baby sea otter",
          "size": "256x256"
        }'

Text to speech

Generates audio from the input text. OpenAI documentation.

curl http://localhost:8080/v1/audio/speech \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1",
    "input": "The quick brown fox jumped over the lazy dog.",
    "voice": "alloy"
  }' \
  --output speech.mp3

Audio Transcription

Transcribes audio into the input language. OpenAI Documentation.

Download first a sample to transcribe:

wget --quiet --show-progress -O gb1.ogg https://upload.wikimedia.org/wikipedia/commons/1/1f/George_W_Bush_Columbia_FINAL.ogg 

Send the example audio file to the transcriptions endpoint :

curl http://localhost:8080/v1/audio/transcriptions \
    -H "Content-Type: multipart/form-data" \
    -F file="@$PWD/gb1.ogg" -F model="whisper-1"

Embeddings Generation

Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. OpenAI Embeddings.

curl http://localhost:8080/embeddings \
    -X POST -H "Content-Type: application/json" \
    -d '{ 
        "input": "Your text string goes here", 
        "model": "text-embedding-ada-002"
      }'
Tip

Don’t use the model file as model in the request unless you want to handle the prompt template for yourself.

Use the installed model’s own name as the model value, the same way you would pass a model name to OpenAI. For instance gemma-4-e2b-it-qat-q4_0 for chat, or gpt-4-vision-preview for a vision model you have installed under that name.

LocalAI docs > Start here

Customizing the Model

A model configuration file sets the prompt template and the default settings of a model. It uses the LocalAI YAML format. For the syntax, see Advanced usage. The file can be on the local file system, or at a URL such as a GitHub Gist.

LocalAI can be initiated using either its container image or binary, with a command that includes URLs of model config files or utilizes a shorthand format (like huggingface:// or github://), which is then expanded into complete URLs.

The configuration can also be set via an environment variable. For instance:

local-ai github://owner/repo/file.yaml@branch

MODELS="github://owner/repo/file.yaml@branch,github://owner/repo/file.yaml@branch" local-ai

Here’s an example to initiate the phi-2 model:

docker run -p 8080:8080 localai/localai:v5.1.1 https://gist.githubusercontent.com/mudler/ad601a0488b497b69ec549150d9edd18/raw/a8a8869ef1bb7e3830bf5c0bae29a0cce991ff8d/phi-2.yaml

You can also check all the embedded models configurations here.

Tip

The model configurations used in the quickstart are accessible here: https://github.com/mudler/LocalAI/tree/master/gallery. Contributions are welcome; please feel free to submit a Pull Request.

The phi-2 model configuration from the quickstart is expanded from https://github.com/mudler/LocalAI-examples/blob/main/configurations/phi-2.yaml.

Example: Customizing the Prompt Template

To modify the prompt template, create a Github gist or a Pastebin file, and copy the content from https://github.com/mudler/LocalAI-examples/blob/main/configurations/phi-2.yaml. Alter the fields as needed:

name: phi-2
context_size: 2048
f16: true
threads: 11
gpu_layers: 90
mmap: true
parameters:
  # Reference any HF model or a local file here
  model: huggingface://TheBloke/phi-2-GGUF/phi-2.Q8_0.gguf
  temperature: 0.2
  top_k: 40
  top_p: 0.95
template:
  
  chat: &template |
    Instruct: {{.Input}}
    Output:
  # Modify the prompt template here ^^^ as per your requirements
  completion: *template

Then, launch LocalAI using your gist’s URL:

## Important! Substitute with your gist's URL!
docker run -p 8080:8080 localai/localai:v5.1.1 https://gist.githubusercontent.com/xxxx/phi-2.yaml

Next Steps

LocalAI docs > Start here

Build your first agent

A saved agent is a chat with fixed instructions and a fixed set of tools and files. You pick it in a chat, schedule it, or reach it from a chat app. It ships inside LocalAI. On a server with accounts, an administrator switches it on first. With authentication off, you are the administrator.

Before you start: install a model that can call tools

An agent that uses tools needs a model that can call them. Use the model from the quickstart, or another one that you know supports tool calling, and check that it answers a plain chat first.

Make the agent

  1. Open Agents in the sidebar.
  2. Choose New agent. A short wizard opens with four steps: Purpose, Abilities, Where it works and Review. Use the bar at the top to go back. The summary shows the agent as it will be created.
  3. In Purpose, start from a template or write your own. Give it a name and the instructions it should always follow, for example: Answer in French. Cite the file you used. Only the name and the instructions are required. The model is the one you pick in each chat, unless you choose a fixed one.
  4. Optional: in Abilities, pick a level (Look only, Assistant or Full) or leave it: the agent then starts with the default tools. Under Files, choose No files, All my files (the default), or Only these folders and pick a folder, for example /Projects/Acme, with Can read or Can read and change. You can add up to eight folders, each with its own access. Chats with the agent then see only those folders and their own chat folder, not the rest of your files. See Folders of an agent. Fine-tune individual tools holds every tool switch.
  5. Optional: in Where it works, mark the chat apps and the tools and services you want. The step lists what your add-ons declare, and the add-ons you can still install. Marking an app does not connect it.
  6. In Review, check the summary and choose Create agent. If you marked apps, the agent’s page opens with a Finish setup card: one row for each app with what it needs and one button. A row is done when the server has the connection. Hide removes the card.

If you skip every optional step, the agent is the same as one made with only a name and instructions. To edit a saved agent, open it and choose Edit: that page keeps the full editor.

Talk to it

On the Agents page, choose Chat on the agent’s row and write a message. The chat uses the agent’s model when it has one. If you delete something the agent uses, such as a collection, the chat still starts and tells the model what is missing.

Let it work by itself

Open Automations and make a schedule, for example weekdays 09:00, with the agent and a prompt. Each run is a normal chat in your history. The result shows up in Notifications. Like saved agents, triggers need their feature switched on on a server with accounts.

To talk to the agent from your phone, add a Telegram connection. The Telegram add-on must be installed first. See Chat apps and connections.

If your agent will not run

  • No model. An agent without a model needs one when you start the chat. A trigger or a connection needs an agent that names a model.
  • A tool is missing. The chat lists what was unavailable at the start of the turn. Check that the MCP server is configured on the model, the add-on is enabled, and the collection or skill still exists.
  • An MCP server does not answer. An MCP server that does not answer makes its tools time out. Open the model’s mcp: configuration and test the server.
  • Folder missing. The agent’s folder was deleted, or it was imported without a folder that exists here. The agent does not start until you restore the folder from the Trash or choose another one in Files.
  • A trigger did not start. Open it on the Automations page: it shows why a run was skipped or failed.

Next steps