Skip to main content

Quick Start

The fastest way to deploy LiteLLM is using Docker Compose with the official image.
1

Pull the Docker Image

Stable releases use the -stable tag (undergoes 12-hour load tests):
2

Create Configuration File

Create a config.yaml file with your model configuration:
config.yaml
3

Run with Docker Compose

Use the provided docker-compose.yml for a complete setup with PostgreSQL and Prometheus:
docker-compose.yml
Start all services:
4

Verify Deployment

Check health status:
Access the admin UI at http://localhost:4000/ui

Docker Image Details

Multi-Stage Build

The Dockerfile uses a multi-stage build for security and size optimization:

Environment Variables

Security Best Practice: Use environment variables for sensitive data instead of hardcoding in config files.

Standalone Docker Run

For simple deployments without Docker Compose:

Database Setup

LiteLLM uses Prisma with PostgreSQL for persistence.

Database Schema

The schema includes tables for:
  • API Keys (LiteLLM_VerificationToken) - Virtual keys with budgets and rate limits
  • Teams (LiteLLM_TeamTable) - Team management and spend tracking
  • Users (LiteLLM_UserTable) - User authentication and authorization
  • Models (LiteLLM_ProxyModelTable) - Model configurations
  • Spend Logs (LiteLLM_SpendLogs) - Request logs and cost tracking
  • Organizations (LiteLLM_OrganizationTable) - Multi-tenant support

Migrations

Migrations run automatically on container startup. The proxy takes 15-20 seconds to fully initialize.
The entrypoint script (docker/prod_entrypoint.sh) handles migrations:
Prisma generates the client and applies migrations during the build process.

Prometheus Configuration

Create prometheus.yml for metrics collection:
prometheus.yml
LiteLLM exposes metrics at /metrics endpoint.

Volume Persistence

Always use named volumes for production databases to prevent data loss.

Health Checks

LiteLLM provides multiple health check endpoints:
  • /health/liveliness - Basic service health
  • /health/readiness - Ready to accept traffic
  • /health - Combined health status
Health check configuration:

Upgrading

Troubleshooting

Container won’t start

Database connection errors

Performance issues

Next Steps

Kubernetes

Scale with Kubernetes and Helm charts

Monitoring

Set up observability and alerting

Security

Secure your deployment

High Availability

Deploy for production at scale