# Self-host LocalAI

> A drop-in OpenAI-compatible API that runs language, image, and speech models on your own hardware.

- Page: https://levelrail.com/templates/localai/
- JSON: https://levelrail.com/templates/localai.json
- Category: AI
- Licence: MIT (Permissive license)
- Source: https://github.com/mudler/LocalAI
- Upstream docs: https://localai.io

## Requirements
- Memory: about 4 GiB
- amd64: published, arm64: published
- Needs configuration before start: no
- Pinned image tag: v3.7.0

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| localai | localai/localai | v3.7.0 | 8080 | localai_models -> /models |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| localai | MODELS_PATH | preset |

## Deploy

### CLI

```bash
levelrail-cli templates deploy localai --name my-localai
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/localai/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## Questions

### Can I deploy LocalAI on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for LocalAI, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image localai/localai:v3.7.0 is what you deploy there.

Self-host LocalAI, LocalAI docker compose file, deploy LocalAI on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
