Back to stack index

AI

LocalAI

Self-hosted OpenAI-compatible runtime for local models.

Short answer

LocalAI is a free, MIT-licensed server that runs AI models on your own hardware and exposes them through APIs compatible with OpenAI, Anthropic and Open Responses. Unlike Ollama, which focuses on language models, LocalAI also serves image generation, speech-to-text, text-to-speech, embeddings and rerankers from one endpoint, using a set of backends such as llama.cpp, vLLM, whisper.cpp and diffusers that it downloads on demand. Apps written for the OpenAI API, including Open WebUI and LiteLLM, can point at LocalAI and keep working. The current release is v4.11.0, from October 2, 2026, which added model failover under one public name, speaker memory for voice, and model inspection. It runs on CPUs, NVIDIA, AMD and Intel GPUs and Apple Silicon, and a distributed mode spreads work across several machines. LocalAI itself costs nothing; you pay for hardware and must follow each model's license.

Latest release
v4.11.0, October 2, 2026
LocalAI GitHub
License
MIT
LocalAI GitHub
Compatible APIs
OpenAI, Anthropic, Open Responses
LocalAI docs
Model types
Text, images, speech, embeddings, rerank
LocalAI docs

Updated October 21, 2026How we evaluate tools

Official site

Directory projects (3)

  • LocalAI

    Self-hosted OpenAI-compatible API for text, audio, and vision models.

  • Open WebUI

    Full-featured web UI for Ollama and OpenAI-compatible backends.

  • LiteLLM

    OpenAI-compatible proxy that unifies dozens of model providers behind one key.

LocalAI in open-source AI tools: a self-hosted, OpenAI-compatible server for text, images and audio in 2026

What LocalAI is

Ettore Di Giacinto started LocalAI in 2023 as a self-hosted stand-in for the OpenAI API: anything written for OpenAI could point at your own server instead. It has grown into a general AI server. One container exposes chat, completions, embeddings, image generation, audio transcription, text-to-speech, reranking and realtime voice endpoints, all in OpenAI's request format, with Anthropic Messages and Open Responses formats added more recently.

LocalAI does not implement inference itself. It manages backends, separate engines for each job:

BackendUsed for
llama.cppLanguage models in GGUF format on CPU and GPU
vLLMHigh-throughput language model serving on data-center GPUs
MLXLanguage models on Apple Silicon
whisper.cppSpeech-to-text
diffusers, stable-diffusion.cppImage generation
Piper, Kokoro and othersText-to-speech
RerankersCross-encoder reranking for search

Since version 4, backends are downloaded on demand when a model needs them, which keeps the base image small.

Which directory projects use it

ProjectRelationship
LocalAIThe server itself
Open WebUIChat front end via an OpenAI connection; can use LocalAI for images and voice too
LiteLLMRoutes requests to LocalAI as an OpenAI-compatible provider alongside hosted models

Other apps that accept a custom OpenAI base URL, such as LibreChat, AnythingLLM and Dify, connect the same way.

What changed in 2026

LocalAI ships often. The v4 line reorganized the project around on-demand backends, added a distributed mode that shares models and work across several machines over a peer-to-peer network, and broadened API compatibility to Anthropic and Open Responses. Version 4.11.0, released October 2, 2026, added:

  • Model failover under one public name, so a request for chat can fall back to a second model if the first fails.
  • Speaker memory for voice conversations.
  • Model inspection, to see a model's metadata and settings from the API.
  • Decision models, through a new endpoint for routing requests.

Running it

The quickest start is one Docker command:

docker run -p 8080:8080 --name local-ai -ti localai/localai:latest

Use the image tag for your hardware, for example a CUDA 12 image for NVIDIA GPUs, and pass the GPU through to the container. Open http://localhost:8080 to browse the gallery and install models. Mount a volume for /models so downloads survive restarts. For production, pin a specific version tag rather than latest.

Hardware sizing

WorkloadMinimumComfortable
7 to 8B chat model, 4-bit8 GB RAM, CPU only (slow)12 GB GPU or Apple M-series
Whisper transcription4 coresAny recent GPU
Embeddings for RAGCPUCPU or small GPU
Image generation (SDXL-class)8 GB GPU16 to 24 GB GPU
70B chat model48 GB GPU memoryTwo 24 GB GPUs or 64 GB Mac

Running several model types at once adds up. LocalAI can unload idle models and limit how many stay loaded, which you will want on a single GPU shared between chat, images and speech.

LocalAI compared with Ollama and vLLM

LocalAIOllamavLLM
ScopeText, images, audio, embeddings, rerankMainly text and embeddingsText and some multimodal
APIOpenAI, Anthropic, Open ResponsesNative plus OpenAI-compatibleOpenAI-compatible
SetupDocker, web UI galleryOne installerPython or Docker, GPU required
ThroughputDepends on backendGood for a few usersHighest for many users
Best forOne self-hosted endpoint for everythingPersonal use and small teamsProduction serving at scale

A common setup uses LocalAI to provide images, speech and embeddings, and either LocalAI's vLLM backend or a separate vLLM server for heavy chat traffic.

Configuration

Each model has a YAML file defining its backend, file, context size, GPU layers, chat template and parameters. Editing these is how you tune behavior. The two most common fixes are setting context_size higher for long documents and setting the correct template when a model gives run-on or malformed answers. Gallery models come with sensible defaults.

Security

Like other local servers, LocalAI listens without authentication by default. Set API_KEY to require a bearer token, keep it on a private network, and put a reverse proxy with TLS in front for remote access. The distributed mode uses a shared token between nodes; treat it as a secret.

Costs

LocalAI has no fees. A modest home server with a 16 GB GPU, enough for chat with an 8B to 14B model, Whisper and image generation, draws 200 to 350 watts under load, around $10 to $25 a month in electricity for regular daytime use. Compared with hosted APIs, it makes sense when privacy rules out the cloud, when volume is high and steady, or when you want to experiment without a meter running.

A typical home-lab layout

A common LocalAI setup on a single server with one GPU looks like this:

ServiceRolePort
LocalAIChat, embeddings, Whisper, image generation, text-to-speech8080
Open WebUIChat interface with user accounts3000
Qdrant or pgvectorVector storage for document chat6333 or 5432
Caddy or TraefikTLS and authentication at the edge443

All four run in Docker Compose on one machine. Open WebUI sends chat requests to LocalAI's /v1/chat/completions, voice input to /v1/audio/transcriptions, and image prompts to /v1/images/generations. Users get one interface for text, voice and images, and nothing leaves the building. Add a second GPU machine in distributed mode when one card is no longer enough.

Upgrading safely

LocalAI releases frequently, and backends update on their own schedule. Pin the image tag, keep the /models volume and its YAML files under backup, and test a new version on a copy before upgrading the main server. Read the release notes for changes to configuration fields, since renamed options are the most common cause of models failing to load after an upgrade. Because backends download on demand, the first request after an upgrade can be slow while a new backend version installs.

Model choices that work well

For a general chat model, a 7B to 14B instruction-tuned model from the Qwen, Llama, Gemma or Mistral families at 4-bit quantization is a good start on a single consumer GPU. For embeddings, small open models such as Nomic Embed or BGE run fast on CPU. For speech-to-text, Whisper large-v3 or its faster turbo variant gives good accuracy in many languages. For images, SDXL-class models balance quality and memory. The gallery lists tested configurations for each.

Who should use it

LocalAI suits home-lab users who want one box for every AI feature, companies replacing OpenAI calls in existing software with an internal endpoint, and developers who need images and voice alongside text. If all you need is a chat model on a laptop, Ollama is the shorter path.

Related: Ollama stack, Hugging Face stack, OpenAI API stack, Docker stack, Stack index.

Frequently asked questions

What is the difference between LocalAI and Ollama?

Ollama is a focused, easy tool for running language models with a curated library. LocalAI is a broader server that also handles images, audio, embeddings and reranking, offers OpenAI and Anthropic-compatible endpoints, and can switch between backends such as llama.cpp and vLLM. Ollama is simpler; LocalAI covers more.

Does LocalAI need a GPU?

No. It runs on CPU, which is fine for small language models, embeddings and Whisper transcription. A GPU makes larger language models and image generation practical. LocalAI publishes container images for NVIDIA CUDA, AMD ROCm, Intel and Vulkan, and runs natively on Apple Silicon.

Can I use LocalAI with Open WebUI?

Yes. Add an OpenAI API connection in Open WebUI pointing at http://localai:8080/v1. Open WebUI will list LocalAI's models and can also use it for image generation and speech.

Is LocalAI free for commercial use?

LocalAI is MIT-licensed and free for commercial use. The models you run have their own licenses, which may restrict commercial use, so check each model card.

How do I install models in LocalAI?

Use the web UI's model gallery, run local-ai models install with a gallery name, or point to a Hugging Face or OCI URL. LocalAI downloads the model and the backend it needs, and writes a YAML config you can edit.

Sources

  1. LocalAI on GitHub
  2. LocalAI docs
  3. LocalAI model gallery
  4. LocalAI releases