Repo Models & Inference

mudler/LocalAI

Open-source, OpenAI-compatible AI engine that runs LLM, vision, voice, image and video models on NVIDIA, AMD, Intel, Apple Silicon, Vulkan or CPU-only hardware.

  • 50.5k GitHub stars
  • Go
  • ⚖️ MIT
  • 🎯 Intermediate

Last verified: repo last pushed

docker run -ti --name local-ai -p 8080:8080 localai/localai:latest
mudler/LocalAI preview image

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

  1. Run on CPU only (Docker)

    Start LocalAI in a container exposing port 8080. To restart an existing container, use docker start -i local-ai.

    bash
    docker run -ti --name local-ai -p 8080:8080 localai/localai:latest
  2. Run with NVIDIA GPU (CUDA 12)

    Use the CUDA-enabled image with GPU access. A CUDA 13 image is also listed in the README.

    bash
    docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-gpu-nvidia-cuda-12
  3. macOS DMG quarantine fix

    The DMG is not signed by Apple. After installing, remove the quarantine attribute.

    bash
    sudo xattr -d com.apple.quarantine /Applications/LocalAI.app

Examples

Load a model from the gallery

bash
bash
local-ai run llama-3.2-1b-instruct:q4_k_m

What 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

bash
bash
local-ai run huggingface://TheBloke/phi-2-GGUF/phi-2.Q8_0.gguf

What it does: Loads a GGUF model directly from Hugging Face.

Load a model from the Ollama registry

bash
bash
local-ai run ollama://gemma:2b

What it does: Pulls a model from the Ollama OCI registry.

Chat with the terminal agent

bash
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_m

What 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