localai
by upstreamyard
LocalAI Helm chart for Kubernetes. Self-hosted OpenAI-compatible API for LLMs, embeddings, images, speech and agents on CPU or GPU (NVIDIA CUDA, AMD ROCm, Intel, Vulkan), as a single server or in distributed mode with scalable frontends and GPU workers on PostgreSQL and NATS. API key by default, admin account created on install, non-root, Prometheus metrics. Community chart by upstreamyard, not an official LocalAI chart.
About this chart
LocalAI Helm chart: the LocalAI self-hosted OpenAI-compatible AI server on Kubernetes
Have any questions, feedback or need help (e.g. setup, hardened images, etc.)? Reach out to [email protected]
Helm chart for LocalAI, the self-hosted, OpenAI-compatible API for LLMs, embeddings, reranking, image generation, speech-to-text, text-to-speech and agents: an open-source alternative to the OpenAI API and Ollama that runs GGUF models with llama.cpp and many other backends on CPU or GPU (NVIDIA CUDA 12 and 13, AMD ROCm, Intel, Vulkan, NVIDIA Jetson). It runs a single server, or LocalAI's distributed mode: stateless API frontends that place models on GPU worker pods, coordinated through PostgreSQL and NATS, with failover between workers and several frontends for high availability. It is secure by default: a generated API key, user accounts with an admin account the chart creates on install, invite-only registration, workers reachable only from the frontends, non-root pods with a read-only root filesystem that pass the restricted Pod Security level. Models install declaratively (gallery names, Hugging Face, Ollama and OCI references, or model YAML), and the chart includes Prometheus metrics, a ServiceMonitor and a helm test that runs a real chat completion.
Community chart by upstreamyard, not an official LocalAI chart. LocalAI is © its authors, licensed under MIT. The chart uses LocalAI's official images unchanged.
AI agents and coding assistants: this README is the complete reference for the chart. Every value is listed under Values, and values.schema.json validates them.
Install
helm repo add upstreamyard https://upstreamyard.github.io/helm-charts
helm install localai upstreamyard/localai
Or from the OCI registry:
helm install localai oci://ghcr.io/upstreamyard/charts/localai
The install notes show the in-cluster URL and the command that prints the generated API key. To start with a small model and check that it answers:
helm install localai upstreamyard/localai \
--set 'models.install={qwen3-0.6b}' --set tests.chatModel=qwen3-0.6b
helm test localai
Verifying the chart
Chart packages are PGP-signed. Import the public key (fingerprint 9B416F989B7E6C65F7F3BFAE7689688B20EC7813) and install with --verify:
curl -s https://upstreamyard.github.io/helm-charts/pgp_keys.asc | gpg --dearmor > upstreamyard.gpg
helm install localai upstreamyard/localai --verify --keyring upstreamyard.gpg
The OCI copy on GHCR is signed with cosign instead (see the repository README).
What the chart does
- Server (
local-ai run) on port 8080: the OpenAI-compatible API under/v1, the web UI at/, and Anthropic (/v1/messages) and Ollama (/api/chat,/api/tags) endpoints. LocalAI downloads backends (llama.cpp, whisper, diffusers and others) on first use; the chart keeps them on the volume. - Storage: one PersistentVolumeClaim, mounted at
/models,/backends,/configurationand/data(LocalAI's documented paths), kept when the release is uninstalled. - API key (
LOCALAI_API_KEY) from a Secret, generated on install and kept across upgrades, or from your own Secret. It protects the API, the web UI and/metrics; requests without it get401. - User accounts (optional in standalone mode, always on in distributed mode): registration is invite-only, and a hook Job creates the admin account from
auth.admin.emailright after install, so nobody else becomes the first (and therefore admin) account. - Distributed mode: frontends plus a worker StatefulSet with a stable DNS name and volume per worker, a registration token generated by the chart, one HMAC secret shared by all frontends (sessions and user API keys work on every frontend), and a NetworkPolicy that lets only the frontends reach the workers.
- Models:
models.installinstalls gallery models and Hugging Face, Ollama or OCI references before the server starts;models.configsadds model definitions as YAML. - Probes:
/healthzfor startup and liveness,/readyzfor readiness. The startup probe allows 1 hour, because LocalAI downloadsmodels.installbefore its HTTP server starts. - Security: UID 1000 instead of the image's root user, read-only root filesystem with
/tmpas an emptyDir, all capabilities dropped,RuntimeDefaultseccomp, no ServiceAccount token. Tested in a namespace withpod-security.kubernetes.io/enforce=restricted. - Validation: the install fails with a clear message on combinations that don't work, e.g. distributed mode without PostgreSQL, or several frontends without a ReadWriteMany volume.
Why this chart
LocalAI's documentation links a chart in the go-skynet/helm-charts repository. Compared with its latest version (3.4.2, read in October 2026):
| This chart | Chart linked from LocalAI's docs | |
|---|---|---|
| LocalAI version | 4.12.1, a new chart version for every release | appVersion 2.23, image tag latest |
| Backends (LocalAI 3+ downloads them at runtime) | kept on the volume | not persisted, downloaded again after every restart |
| Authentication | API key generated; user accounts with admin created on install | no API key setting |
| Probes | startup, liveness, readiness | none on the LocalAI container |
| Runs as | UID 1000, read-only root filesystem | the image's root user |
| Distributed mode (frontends + GPU workers) | yes, with failover tested | no |
| GPU images | every official variant via image.variant | set the tag by hand |
helm test | readiness, API key, workers, chat completion | none |
The only other LocalAI chart on Artifact Hub targets LocalAI 1.25 (2023).
Deployment modes
Standalone (default)
One server downloads the models and runs them itself. Give it the memory (and GPU) of the largest model you load:
models:
install: [qwen3-0.6b]
resources:
requests:
cpu: "4"
memory: 8Gi
limits:
memory: 16Gi
persistence:
size: 100Gi
- Tested in kind (CPU image, 16-core host): installed and ready in about 40 seconds, including the 462 MB download of
qwen3-0.6band its llama.cpp backend; the first chat completion, which loads the model, answered within 3 seconds. - One pod only. Upgrades replace it (delete, then create), so the API is briefly unavailable; models and backends stay on the volume and are not downloaded again (tested).
- User accounts are optional here:
auth.enabled: truestores them in SQLite under/data, or in PostgreSQL withdatabase.url.
Distributed: frontends and GPU workers
The frontends receive API requests and route each model to a worker; the workers run the models. A worker installs the backend it needs when the first request for a model arrives, and the frontend copies the model files to it. Bring your own PostgreSQL (with pgvector if you use agents and collections) and NATS; plain NATS without JetStream is enough, e.g. the official NATS Helm chart. The chart installs neither.
mode: distributed
database:
existingSecret: localai-db # key: database-url, postgresql://user:password@host:5432/localai
distributed:
nats:
url: nats://nats.nats.svc:4222
auth:
admin:
email: [email protected]
models:
install: [qwen3-0.6b]
worker:
replicaCount: 2
image:
variant: gpu-nvidia-cuda-12
resources:
limits:
nvidia.com/gpu: 1
- Tested in kind with PostgreSQL 17 (pgvector) and NATS 2.12, 1 frontend and 2 CPU workers: installed in 43 seconds. The first chat completion installed llama.cpp on a worker, copied the 462 MB model to it and answered within 5 seconds.
- Worker failover: deleting the worker that held the model while a client sent a request every second: 0 of 87 requests failed. The model moved to the other worker within one request (6 seconds), and the deleted worker was back within 2 seconds with its backends and model still on its volume. Deleting a worker together with its volume: 0 of 109 failed.
- NATS outage: NATS down for 40 seconds: 0 of 110 requests to the loaded model failed. The workers reported not ready and none restarted.
- Workers register with the frontends using the registration token, which also protects their file transfer and model ports. Each worker has its own volume (
worker.persistence) for backends and model copies; it must hold every model placed on it. - New workers are approved automatically (
distributed.autoApproveNodes), since they must present the token anyway. LocalAI adds the labelsgpu.vendor,gpu.vramandnode.name; add your own withworker.labelsand use them in placement rules in the web UI (Operate → Swarm).
Several frontends (high availability)
Frontends share the models directory, so more than 1 needs a ReadWriteMany volume (e.g. EFS, Azure Files, Filestore, CephFS or NFS):
mode: distributed
replicaCount: 2
persistence:
accessModes: [ReadWriteMany]
storageClass: efs-sc # any ReadWriteMany storage class
database:
existingSecret: localai-db
distributed:
nats:
url: nats://nats.nats.svc:4222
worker:
replicaCount: 2
- The frontends run as a StatefulSet: they start and roll one at a time, so only the first downloads
models.installand the others find the files on the shared volume. Started at the same time, two frontends wrote the same download and one failed withfailed to rename temporary file ... .partial(found in testing, and the reason for this design). - All frontends get the same HMAC secret (
LOCALAI_AUTH_HMAC_SECRET). Tested: a login session and a user API key created through one frontend worked on the other. Without it, LocalAI generates a secret per data directory. - Tested in kind with 2 frontends and 2 workers: deleting a frontend under load failed 1 of 82 requests (see Known issues).
GPUs
LocalAI publishes an image per hardware type for every release; image.variant (and worker.image.variant for workers) picks it, and the chart appends it to the tag (v5.0.1-<variant>):
| Variant | Hardware | Platforms |
|---|---|---|
| (empty, default) | CPU | amd64, arm64 |
gpu-nvidia-cuda-12 | NVIDIA, CUDA 12 drivers | amd64 |
gpu-nvidia-cuda-13 | NVIDIA, CUDA 13 drivers | amd64 |
gpu-hipblas | AMD (ROCm) | amd64 |
gpu-intel | Intel GPUs | amd64 |
gpu-vulkan | Vulkan, any vendor | amd64, arm64 |
nvidia-l4t-arm64 | NVIDIA Jetson (CUDA 12) | arm64 |
nvidia-l4t-arm64-cuda-13 | NVIDIA Jetson / DGX Spark (CUDA 13) | arm64 |
A standalone server on an NVIDIA GPU node, with the NVIDIA device plugin installed:
image:
variant: gpu-nvidia-cuda-12
resources:
limits:
nvidia.com/gpu: 1
runtimeClassName: nvidia # only if the NVIDIA runtime isn't the node default
shareProcessNamespace: true
tolerations:
- key: nvidia.com/gpu
operator: Exists
effect: NoSchedule
- The GPU images were not tested by us (no GPU in our test cluster); the CPU image was. All tags in the table exist for 5.0.1.
shareProcessNamespace: truemakes the pod's pause process PID 1 (tested), the Kubernetes equivalent of Docker'sinit: true. LocalAI recommends it for NVIDIA workers, becausenvidia-smicalls otherwise fail now and then, which blanks the free-VRAM figures.- In distributed mode only the workers need the GPU image; the frontends stay on the CPU image.
Models
-
models.installtakes gallery names (browse them in the web UI under Models),huggingface://<repo>/<file>,ollama://<name>,oci://<image>or URLs of model YAML files. They are installed before the server starts and stay on the volume; at later starts LocalAI only checks them. -
models.configsadds models in LocalAI's model YAML format. Tested: a config pointing at a file installed bymodels.install, and one whoseparameters.modelis ahuggingface://URI, which LocalAI downloaded at startup:models: configs: - name: qwen-short backend: llama-cpp context_size: 2048 parameters: model: Qwen3-0.6B.Q4_K_M.gguf temperature: 0.2 - name: granite-embed backend: llama-cpp embeddings: true parameters: model: huggingface://bartowski/granite-embedding-107m-multilingual-GGUF/granite-embedding-107m-multilingual-f16.gguf -
Models can also be installed at runtime in the web UI or through the API; they are stored on the volume too. See LocalAI's model configuration reference for all fields.
-
Gated Hugging Face models need a token: put
HF_TOKENin a Secret and reference it inextraEnvFrom.
Authentication
- API key: clients send
Authorization: Bearer <key>(orx-api-key). It grants full admin rights, also in the web UI, where it works as a login. - User accounts (
auth.enabled, always on in distributed mode) add roles, sessions, per-user API keys and usage statistics. The chart setsauth.registrationMode: invite, so new accounts need an invite link from an admin; LocalAI's own default isopen, where anyone who reaches the server can create an account (tested: an uninvited registration got400 an invite code is required to register). - The first account is always an admin. Set
auth.admin.email: a hook Job creates that account after every install and upgrade, withauth.admin.passwordor a generated password (Secret keyadmin-password), and fails if the account isn't an admin. - Single sign-on: set
baseUrla
Deploy localai with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has localai on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartlocalai is pinned at v0.1.5 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply