Skip to main content

LocalAI

Free open-source local AI — drop-in OpenAI API replacement for self-hosted models

Local AIFree

LocalAI is a free, open-source alternative to the OpenAI API that runs locally. It provides an OpenAI-compatible REST API for running LLMs, image generation, speech-to-text, and text-to-speech — all on your own hardware without GPU requirements for smaller models. Swap `api.openai.com` for `localhost:8080` in your app and run models privately.

Key specs
50,334 GitHub stars source
as of 2026-11-12

What we know

LicenseMITsource, checked 2026-11-30
Open sourceYessource, checked 2026-11-30
PricingFreefrom our original listing, not yet re-checked
GitHub stars50,626source, checked 2026-11-30

Why it matters

  • Drop-in OpenAI API replacement means applications built for OpenAI work locally with zero code changes.
  • Runs on CPU for smaller models — no GPU required, making it accessible to any developer.
  • Covers the full AI API surface: LLMs, image generation, speech-to-text, TTS, and embeddings in one service.
  • 24K+ GitHub stars validates it as the most widely used self-hosted OpenAI API replacement.

Key capabilities

  • OpenAI-compatible API: Full REST API matching OpenAI's endpoints — /v1/chat/completions, /v1/images/generations, /v1/audio/transcriptions, etc.
  • LLM support: Llama, Mistral, Gemma, Phi, CodeLlama, and most GGUF models via llama.cpp.
  • Image generation: Stable Diffusion integration for local image generation.
  • Speech-to-text: Whisper integration for local transcription.
  • Text-to-speech: Multiple TTS backends (piper, coqui).
  • Embeddings: Local embedding generation compatible with OpenAI's embedding API.
  • CPU support: Runs on CPU with quantized models (4-bit GGUF).
  • GPU support: NVIDIA CUDA and Apple Silicon Metal acceleration.
  • Docker deployment: Official Docker image for easy setup.

Technical notes

  • License: MIT (open source)
  • GitHub: github.com/mudler/LocalAI (24K+ stars)
  • Model formats: GGUF (llama.cpp), GGML, safetensors (stable diffusion)
  • Hardware: CPU (any), NVIDIA GPU (CUDA), Apple Silicon (Metal)
  • API: OpenAI-compatible REST; runs on localhost:8080 by default
  • Docker: docker run localai/localai — official image with bundled models
  • Community: Active Discord and GitHub community

Ideal for

  • Developers who built applications using the OpenAI API and want to run them locally without changing code.
  • Organizations with data privacy requirements that prevent sending data to OpenAI's servers.
  • Researchers and hobbyists who want the full AI API stack (LLMs + image + speech) on their own hardware.

Not ideal for

  • Users who just want a chat interface — LM Studio or Open WebUI have better UX for that.
  • Production serving with high throughput — vLLM or SGLang are better optimized.
  • Best model quality — cloud APIs (GPT, Claude) still outperform locally run models.

See also

  • LM Studio — Desktop app for running local LLMs with a better chat UI.
  • Open WebUI — Self-hosted ChatGPT-like interface for local models via Ollama.
  • vLLM — High-throughput LLM serving for production; better than LocalAI for scale.

FAQ

What is LocalAI?

LocalAI is a self-hosted API server that provides an OpenAI-compatible REST API for running AI models locally. It supports LLMs (Llama, Mistral, Gemma, Phi), image generation (Stable Diffusion), speech recognition (Whisper), and text-to-speech. Since it exposes an OpenAI-compatible API, applications built for OpenAI can switch to LocalAI by changing only the base URL — no code changes needed.

Is LocalAI free?

LocalAI is completely free and open source (MIT license). There are no API costs — you run it on your own hardware and pay only for the hardware/electricity. GitHub: github.com/mudler/LocalAI.

What hardware do I need for LocalAI?

LocalAI can run on CPU-only hardware for smaller models (7B), making it unique among local LLM solutions. For larger models or better performance, a NVIDIA GPU with 8GB+ VRAM (RTX 3080, 4090) is recommended. 4-bit quantized models (GGUF format) work well on CPU. Apple Silicon (M1/M2/M3) is supported via Metal acceleration.

How does LocalAI compare to Ollama?

Both are local LLM serving solutions. Ollama is simpler — `ollama run llama3` and you're running. LocalAI is more feature-complete — it supports image generation, speech recognition, TTS, and embeddings in addition to LLMs. LocalAI's OpenAI API compatibility is more complete. Ollama is better for quick local LLM use; LocalAI for replacing the full OpenAI API stack locally.

Alternatives

Is your tool an alternative to LocalAI? Sponsor this spot for 30 days, marked Sponsored.

Integrations

None listed.

Built on

None listed.

Good for these tasks

For the team behind LocalAI

Growth plan: from $399 a month

SEO, AI search (how ChatGPT, Perplexity and Google describe LocalAI), UX, CRO and support from one account manager, with a monthly report. Includes a Featured launch on db.fyi. Starts with a free audit.

Founding offer: $299 a month for your first 3 months, plus a free case study.

Get a free audit

Listed 2026-02-28 · updated 2026-11-12