local-ai

by sebastien-prudhomme

Helm chartv4.0.0App 1.25.0MITVerified publisher

A drop-in replacement REST API compatible with OpenAI API specifications for local inferencing

About this chart

LocalAI

LocalAI is a drop-in replacement REST API compatible with OpenAI API specifications for local inferencing.

DISCLAIMER: This is an unofficial chart not supported by LocalAI authors.

TL;DR;

$ helm repo add cowboysysop https://cowboysysop.github.io/charts/
$ helm install my-release cowboysysop/local-ai

or for an OCI-based registry:

$ helm install my-release oci://ghcr.io/cowboysysop/charts/local-ai

Introduction

This chart bootstraps a LocalAI deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

  • Kubernetes >= 1.24
  • Helm >= 3.9

Installing

Install the chart using:

$ helm repo add cowboysysop https://cowboysysop.github.io/charts/
$ helm install my-release cowboysysop/local-ai

or for an OCI-based registry:

$ helm install my-release oci://ghcr.io/cowboysysop/charts/local-ai

These commands deploy LocalAI on the Kubernetes cluster in the default configuration and with the release name my-release. The deployment configuration can be customized by specifying the customization parameters with the helm install command using the --values or --set arguments. Find more information in the configuration section of this document.

Upgrading

Upgrade the chart deployment using:

$ helm upgrade my-release cowboysysop/local-ai

or for an OCI-based registry:

$ helm upgrade my-release oci://ghcr.io/cowboysysop/charts/local-ai

The command upgrades the existing my-release deployment with the most latest release of the chart.

Upgrading to version 4.0.0

The chart now uses forked versions of the Bitnami charts to reference the Bitnami Legacy repository:

  • https://github.com/bitnami/containers/issues/83267

A label app.kubernetes.io/component will be added to the Deployment. Run this command before upgrading to prevent an immutable field error:

$ kubectl delete deployment/my-local-ai-deployment

Pod and container security contexts are now configured with default values.

Information about services are no more injected into pod's environment variable.

Upgrading to version 3.0.0

The llama backend now uses the GGUF model format. Migrate to the llama-stable backend to continue using the GGML model format.

Upgrading to version 2.0.0

The chart is now tested with Kubernetes >= 1.24 and Helm >= 3.9.

Future upgrades may introduce undetected breaking changes if you continue to use older versions.

Uninstalling

Uninstall the my-release deployment using:

$ helm uninstall my-release

The command deletes the release named my-release and frees all the kubernetes resources associated with the release.

TIP: Specify the --purge argument to the above command to remove the release from the store and make its name free for later use.

Configuration

Global parameters

NameDescriptionDefault
global.imageRegistryGlobal Docker image registry""
global.imagePullSecretsGlobal Docker registry secret names as an array[]

Common parameters

NameDescriptionDefault
kubeVersionOverride Kubernetes version""
nameOverridePartially override local-ai.fullname template with a string (will prepend the release name)""
fullnameOverrideFully override local-ai.fullname template with a string""
namespaceOverrideFully override common.names.namespace template with a string""
commonAnnotationsAnnotations to add to all deployed objects{}
commonLabelsLabels to add to all deployed objects{}
extraDeployArray of extra objects to deploy with the release[]

Parameters

NameDescriptionDefault
replicaCountNumber of replicas (do not change it)1
revisionHistoryLimitNumber of old history to retain to allow rollback10
updateStrategy.typeUpdate strategy type (do not change it)Recreate
image.registryImage registryquay.io
image.repositoryImage repositorygo-skynet/local-ai
image.tagImage tagv1.25.0-ffmpeg
image.digestImage digest""
image.pullPolicyImage pull policyIfNotPresent
pdb.createSpecifies whether a pod disruption budget should be createdfalse
pdb.minAvailableMinimum number/percentage of pods that should remain scheduled1
pdb.maxUnavailableMaximum number/percentage of pods that may be made unavailablenil
serviceAccount.createSpecifies whether a service account should be createdtrue
serviceAccount.annotationsService account annotations{}
serviceAccount.nameThe name of the service account to use (Generated using the local-ai.fullname template if not set)nil
enableServiceLinksWhether information about services should be injected into pod's environment variablefalse
hostAliasesPod host aliases[]
deploymentAnnotationsAdditional deployment annotations{}
podAnnotationsAdditional pod annotations{}
podLabelsAdditional pod labels{}
podSecurityContextPod security context
podSecurityContext.seccompProfile.typeSet pod's Security Context seccomp profileRuntimeDefault
priorityClassNamePriority class namenil
runtimeClassNameRuntime class name""
topologySpreadConstraintsTopology Spread Constraints for pod assignment[]
securityContextContainer security context
securityContext.allowPrivilegeEscalationSet container's Security Context allowPrivilegeEscalationtrue
securityContext.capabilities.dropList of capabilities to be dropped[]
securityContext.readOnlyRootFilesystemSet container's Security Context readOnlyRootFilesystemfalse
securityContext.runAsNonRootWhether the container must run as a non-root userfalse
securityContext.runAsUserThe UID to run the entrypoint of the container process0
securityContext.runAsGroupThe GID to run the entrypoint of the container process0
containerPorts.httpContainer port for HTTP8080
livenessProbe.enabledEnable liveness probetrue
livenessProbe.initialDelaySecondsDelay before the liveness probe is initiated0
livenessProbe.periodSecondsHow often to perform the liveness probe10
livenessProbe.timeoutSecondsWhen the liveness probe times out1
livenessProbe.failureThresholdMinimum consecutive failures for the liveness probe to be considered failed after having succeeded3
livenessProbe.successThresholdMinimum consecutive successes for the liveness probe to be considered successful after having failed1
readinessProbe.enabledEnable readiness probetrue
readinessProbe.initialDelaySecondsDelay before the readiness probe is initiated0
readinessProbe.periodSecondsHow often to perform the readiness probe10
readinessProbe.timeoutSecondsWhen the readiness probe times out1
readinessProbe.failureThresholdMinimum consecutive failures for the readiness probe to be considered failed after having succeeded3
readinessProbe.successThresholdMinimum consecutive successes for the readiness probe to be considered successful after having failed1
startupProbe.enabledEnable startup probefalse
startupProbe.initialDelaySecondsDelay before the startup probe is initiated0
startupProbe.periodSecondsHow often to perform the startup probe10
startupProbe.timeoutSecondsWhen the startup probe times out1
startupProbe.failureThresholdMinimum consecutive failures for the startup probe to be considered failed after having succeeded3
startupProbe.successThresholdMinimum consecutive successes for the startup probe to be consider

Deploy local-ai with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has local-ai 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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartlocal-ai is pinned at v4.0.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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