Skip to main content

Overview

LiteLLM supports configuration via environment variables for API keys, endpoints, and settings.

Provider API Keys

OpenAI

string
OpenAI API key.
string
OpenAI organization ID.

Azure OpenAI

string
Azure OpenAI API key.
string
Azure OpenAI endpoint.
string
Azure OpenAI API version.

Anthropic

string
Anthropic API key for Claude models.

Google (Vertex AI / AI Studio)

string
Path to Google Cloud service account JSON file.
string
Google Cloud project ID.
string
Vertex AI location (e.g., us-central1).
string
Google AI Studio API key.

AWS Bedrock

string
AWS access key ID.
string
AWS secret access key.
string
AWS region (e.g., us-east-1).

Cohere

string
Cohere API key.

Hugging Face

string
Hugging Face API token.

Replicate

string
Replicate API token.

Together AI

string
Together AI API key.

Groq

string
Groq API key.

Mistral

string
Mistral AI API key.

Perplexity

string
Perplexity AI API key.

Anyscale

string
Anyscale API key.

Voyage AI

string
Voyage AI API key (embeddings).

Databricks

string
Databricks API key.
string
Databricks workspace URL.

Cloudflare

string
Cloudflare Workers AI API key.
string
Cloudflare account ID.

LiteLLM Settings

Core Settings

string
default:"INFO"
Log level.Options: DEBUG, INFO, WARNING, ERROR
string
default:"true"
Use local cost map for pricing.
string
default:"false"
Drop unsupported parameters instead of raising errors.

Caching

string
Redis hostname for caching.
string
default:"6379"
Redis port.
string
Redis password.
string
Complete Redis connection URL.

Proxy Server Settings

Authentication

string
Master admin key for proxy.
string
Salt key for hashing API keys.
string
Admin UI username.
string
Admin UI password.

Database

string
PostgreSQL connection string.
string
default:"false"
Store model configurations in database.

Server Configuration

string
default:"4000"
Proxy server port.
string
default:"0.0.0.0"
Proxy server host.
string
default:"1"
Number of Uvicorn workers.
string
Path to SSL key file.
string
Path to SSL certificate file.

Observability

string
Langfuse public key for logging.
string
Langfuse secret key.
string
Langfuse host URL.
string
Lunary public key.
string
Helicone API key.
string
Sentry DSN for error tracking.
string
Slack webhook for alerts.

Budget & Rate Limiting

string
Global budget limit in USD.
string
Budget reset period.

Usage Examples

Basic Setup

Azure OpenAI Setup

Proxy with Database

Full Production Setup

Docker Environment

docker-compose.yml

.env file

Kubernetes ConfigMap

Loading from .env File

Provider-Specific Variables

Some providers require additional environment variables:

AWS Bedrock with Profile

Vertex AI with ADC

Azure with Managed Identity

Security Best Practices

  1. Never commit .env files to version control
  2. Use secret managers in production (AWS Secrets Manager, Kubernetes Secrets, etc.)
  3. Rotate keys regularly
  4. Use least-privilege access for cloud IAM roles
  5. Encrypt sensitive environment variables in CI/CD