Skip to Content

LocalAI: self-host an API with multiple model backends

LocalAI provides an OpenAI-compatible API for model backends and gallery configurations. Use it when you want one client configuration for several model types. The chosen backend and model configuration determine memory requirements, supported features, and GPU behavior. See the official documentation  for current platform and model support.

When to choose LocalAI

SignalWhat it means
One baseURL for many backendsRoute different models through the same OpenAI-compatible gateway
Gallery-driven setupPrebuilt configurations instead of hand-written engine flags
Hybrid local + remoteSome backends proxy to cloud APIs while others run locally

The gateway adds operational surface — you still size and lifecycle each backend underneath.

Setup and operation

GuideWhat you’ll learn
Install LocalAIContainers, models path, first start
Choose a backendllama.cpp, vLLM, and gallery options
Connect an OpenAI clientEndpoints, keys, and model names

Model-specific deployment guides

Each guide links the actual upstream configuration, explains hardware and checkpoint variants, and includes a first API request. Browse all documented models for other deployment options.

LocalAI alternatives

ToolChoose when
iwantYou want a documented model name to become a GCP endpoint without assembling VMs, engine flags, and teardown yourself.
vLLMYou manage the GPU host and need continuous batching, prefix caching, and direct control over vllm serve settings.
SGLangYou need RadixAttention prefix reuse, structured generation, or model-specific parsers on hardware you configure.
TGIYou already run Hugging Face Text Generation Inference on Kubernetes and the checkpoint is on the supported-model list.
OllamaYou want local ollama pull ergonomics, IDE chat, and low-ops serving on a single machine.
llama.cppYou serve GGUF weights on CPU, Apple Silicon, or a modest GPU with minimal dependencies.

All launch methods: self-hosting hub.

Related reading

Last updated on