← Blog AI Nov 19, 2026 · 6 min read

LocalAI 5.0: A Free Self-Hosted Replacement for the OpenAI API

LocalAI 5.0 runs an OpenAI-compatible API on your own machine, so scripts can switch from paid APIs by changing one URL. What's new and how to set it up.

LocalAI 5.0: A Free Self-Hosted Replacement for the OpenAI API

If you have scripts, automations or small apps that call the OpenAI API, LocalAI lets you point them at a server on your own computer instead, often by changing a single URL. Version 5.0 landed in November 2026 with a desktop app, server-side chats and native Windows support in 5.0.1. Here is what it does, what changed, and how to switch a script over step by step.

What LocalAI is

LocalAI (github.com/mudler/LocalAI) is an open-source AI engine that runs models for text, vision, speech, images, video and embeddings on your own hardware. Key facts from the README and website:

  • License: MIT. About 50,500 GitHub stars.
  • API compatibility: follows the OpenAI and Anthropic API formats, plus ElevenLabs-compatible text-to-speech and sound generation.
  • Hardware: runs on CPU alone. A GPU is optional but faster: NVIDIA (CUDA 12 and 13), AMD (ROCm), Intel (oneAPI), Apple Silicon (Metal), Vulkan and NVIDIA Jetson are supported.
  • Models: install from a built-in gallery, or load models from Hugging Face, Ollama or OCI registries.
  • Default address: http://localhost:8080, with the web UI at the same address.

The website's pitch sums it up: change the base URL, keep your client.

What's new in LocalAI 5.0

According to the releases page, v5.0.0 came out on 18 November 2026 and v5.0.1 followed on 20 November.

Highlights of 5.0:

  • Desktop app for macOS (Apple Silicon) and Linux that installs, updates, starts and stops LocalAI, or connects to a remote server.
  • Server-side chats that keep running after you close the browser tab, with sub-agents, goals and voice.
  • Projects that group chats around one folder, and a Files page with search, archive extraction, Trash and undo history.
  • Simple Office add-on for Word, Excel, PowerPoint and PDF files.
  • Sandbox for Python and shell with no network by default (Linux only in 5.0).
  • Team sharing, an add-on library and connections to other OpenAI- or Anthropic-compatible endpoints.

And in 5.0.1: native Windows support, including a Windows amd64 server build, plus fixes to the add-on catalog and a safer model downloader that keeps the old file until the new one is verified.

Breaking changes to know before upgrading

If you already run LocalAI, read these first:

  • The old chat page, agents, agent jobs and skills were replaced by the new chats. Old data is converted on first start, but converted triggers and MCP connectors stay off until you enable them.
  • Old API paths such as /api/agents and /api/conversations now return 404, and the local-ai agent command was removed.
  • Some environment variables were renamed; old names still work with a warning.
  • Studio and Talk are now add-ons an admin must install.
  • The liquid-audio backend was removed.
  • The new desktop app replaces the old launcher, which must be downloaded manually once. Local models and settings are kept.

The core OpenAI-style endpoints your scripts use are not in that list, but always test after upgrading.

How to install LocalAI

Pick one route.

Install script (Linux, and macOS on Apple Silicon):

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

Docker:

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

Desktop app or Windows: download from the project's releases or website; Windows builds arrived in 5.0.1.

Then open http://localhost:8080, go to the Models page and install a model from the gallery. Backends download automatically the first time a model needs them. You can also list models from the terminal with local-ai models list.

Switching a script from OpenAI to LocalAI

The website's instructions are three changes:

  1. Set the base URL to http://localhost:8080/v1.
  2. Use any placeholder API key (its example uses "none").
  3. Use a model name you installed from the gallery.

In Python with the official OpenAI client, that looks like this:

from openai import OpenAI

client = OpenAI(base_url="http://localhost:8080/v1", api_key="none")

reply = client.chat.completions.create(
    model="gemma-4-e2b-it-qat-q4_0",  # a model you installed
    messages=[{"role": "user", "content": "Write 3 caption ideas for a rainy-day coffee post."}],
)
print(reply.choices[0].message.content)

The same idea works in n8n, Make or any tool that lets you set a custom OpenAI base URL. If you build automations, our list of no-code automations for creators has ideas to try with a local model.

What to expect

  • Quality: small local models are good at short drafts, classification, summaries and extraction. Hard reasoning still favours big cloud models.
  • Speed: on CPU only, replies are slower. A GPU helps a lot.
  • Cost: no per-token bill, but electricity and hardware are not free.
  • Privacy: prompts and files stay on your machine.

Our guide to open vs closed AI models helps decide which jobs to keep local.

Good first jobs for a local API

  • Tagging and sorting: label support emails or product reviews as positive, negative or question.
  • Summaries: condense meeting notes or long articles you scraped from your own site (see our Firecrawl vs Crawl4AI guide).
  • Transcription: use a Whisper model through the same API.
  • Drafts: first versions of captions or product descriptions, edited by you.
  • Testing: develop an app against LocalAI, then switch to a paid API only for production if you need to.

Security tips

  • Keep it on localhost unless you need remote access. If you expose it, put it behind authentication and HTTPS.
  • Use accounts and permissions in team setups; 5.0 turns many features off by default for new users.
  • Only install models and add-ons from sources you trust.
  • Back up your models folder and settings before major upgrades.

Key takeaways

  • LocalAI is a free, MIT-licensed server that speaks the OpenAI and Anthropic API formats on your own hardware.
  • Switching most scripts means changing the base URL to http://localhost:8080/v1 and the model name.
  • 5.0 (18 November 2026) added a desktop app, server-side chats, projects and add-ons; 5.0.1 added native Windows.
  • Read the breaking changes before upgrading an existing install.
  • Use local models for drafts, tagging, summaries and testing; keep hard reasoning for larger models.

FAQ

Is LocalAI really free?

Yes. LocalAI is open source under the MIT license. You only pay for your own hardware and electricity.

Do I need a GPU for LocalAI?

No. It runs on CPU alone, but a supported GPU from NVIDIA, AMD, Intel or Apple makes responses much faster.

Does LocalAI work on Windows?

Native Windows support arrived in v5.0.1, including a Windows amd64 server build. Docker is another option.

Sources

Read next