What it is
LocalAI is an open-source AI engine with a small core. Each backend (llama.cpp, vLLM, whisper.cpp, stable-diffusion, MLX and others) ships as its own image and is pulled only when a model needs it. It exposes LLMs, vision, voice, image and video models behind one API with OpenAI, Anthropic and ElevenLabs compatibility. It runs on many hardware types, including CPU-only systems.
Who it's for
- Developers who want a self-hosted, drop-in replacement for OpenAI/Anthropic-style APIs
- Teams that need privacy-first inference where data stays on their own infrastructure
- Operators running multi-user or distributed deployments with API key auth, quotas and role-based access
- Users who want to run models on varied hardware (NVIDIA, AMD, Intel, Apple Silicon, Vulkan, CPU-only)
Requirements
Requirements
- Docker, podman or another container runtime for the container install, or macOS for the DMG
- No GPU required; GPU options include NVIDIA (CUDA 12/13, Jetson), AMD ROCm, Intel oneAPI and Vulkan
- macOS DMG is not signed by Apple, so quarantine must be removed after install
Setup
Run on CPU only (Docker)
Start LocalAI in a container exposing port 8080. To restart an existing container, use
docker start -i local-ai.bashdocker run -ti --name local-ai -p 8080:8080 localai/localai:latestRun with NVIDIA GPU (CUDA 12)
Use the CUDA-enabled image with GPU access. A CUDA 13 image is also listed in the README.
bashdocker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-gpu-nvidia-cuda-12macOS DMG quarantine fix
The DMG is not signed by Apple. After installing, remove the quarantine attribute.
bashsudo xattr -d com.apple.quarantine /Applications/LocalAI.app
Examples
Load a model from the gallery
bashlocal-ai run llama-3.2-1b-instruct:q4_k_mWhat it does: Runs a model from the model gallery. Available models can be listed with local-ai models list or at models.localai.io.
Load a model from Hugging Face
bashlocal-ai run huggingface://TheBloke/phi-2-GGUF/phi-2.Q8_0.ggufWhat it does: Loads a GGUF model directly from Hugging Face.
Load a model from the Ollama registry
bashlocal-ai run ollama://gemma:2bWhat it does: Pulls a model from the Ollama OCI registry.
Chat with the terminal agent
bash# Terminal 1
local-ai run llama-3.2-1b-instruct:q4_k_m
# Terminal 2
local-ai chat --model llama-3.2-1b-instruct:q4_k_mWhat it does: Starts the server in one shell and the built-in agent in another. The agent asks for approval before anything that changes state.
Pros & cons
Pros
- Pro:Modular design: backends are pulled on demand, so you install only what your models need
- Pro:Broad modality and hardware support, including CPU-only operation
- Pro:Drop-in compatibility with OpenAI, Anthropic and ElevenLabs APIs
- Pro:Multi-user features (API key auth, quotas, role-based access) and built-in agents with MCP and RAG
Cons
- Con:The macOS DMG is unsigned and needs a manual quarantine removal command
- Con:Backends are downloaded on demand, so a model may need an extra backend download before first use
Images
