litellm/deploy/aws/example-config.yaml
Julio Quinteros Pro 445c67cfec Add AWS ECS deployment template matching benchmark specifications
This commit adds a complete 1-click deployment solution for LiteLLM on AWS ECS,
configured to match the benchmark specifications from https://docs.litellm.ai/docs/benchmarks

## What's Added

### Infrastructure (1 file)
- cloudformation-ecs.yaml: AWS CloudFormation template for ECS deployment
  - 4 ECS Fargate tasks (4 vCPU, 8 GB RAM each)
  - 4 workers per task (16 total workers)
  - RDS PostgreSQL database (db.t3.medium)
  - Application Load Balancer
  - VPC with public/private subnets across 2 AZs
  - Security groups, NAT Gateway, monitoring

### Deployment Tools (3 files)
- deploy.sh: Automated deployment script with interactive prompts
- test-deployment.sh: Deployment validation and health check script
- cost-calculator.sh: Interactive cost estimation tool

### Documentation (6 files)
- 00-START-HERE.md: Quick start guide and overview
- QUICKSTART.md: 5-minute deployment guide
- README.md: Complete deployment documentation
- ARCHITECTURE.md: Detailed architecture deep-dive with diagrams
- INDEX.md: Master index of all files
- .summary.md: Internal summary document

### Testing & Configuration (2 files)
- locustfile.py: Load testing script to replicate benchmark tests
- example-config.yaml: LiteLLM configuration example

## Configuration

- 4 instances with 4 vCPU and 8 GB RAM each
- 4 workers per instance
- Expected performance:
  - Median latency: ~100 ms
  - P95 latency: ~150 ms
  - Throughput: ~1,170 RPS
  - LiteLLM overhead: ~2 ms

## Usage

```bash
cd deploy/aws
./deploy.sh
```

## Monthly Cost

~$440-460 (pay-as-you-go) or ~$270-370 (with reserved capacity)

## Features

-  CloudFormation template validated with AWS
-  Production-ready with high availability
-  Secure by default (private subnets, security groups, encrypted secrets)
-  Well-documented with comprehensive guides
-  Includes validation and load testing tools
-  Cost-optimized configuration

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-16 13:03:05 -03:00

184 lines
4.9 KiB
YAML

# LiteLLM Proxy Configuration Example for AWS Deployment
#
# This is an example configuration file for LiteLLM proxy server.
# Customize this file with your actual API keys and model configurations.
#
# To use this configuration with your AWS deployment:
# 1. Update the model_list with your actual providers and API keys
# 2. Store API keys in AWS Secrets Manager
# 3. Update the ECS task definition to use this config
#
# Documentation: https://docs.litellm.ai/docs/proxy/configs
model_list:
# OpenAI Models
- model_name: gpt-4
litellm_params:
model: gpt-4
api_key: os.environ/OPENAI_API_KEY
- model_name: gpt-4-turbo
litellm_params:
model: gpt-4-turbo-preview
api_key: os.environ/OPENAI_API_KEY
- model_name: gpt-3.5-turbo
litellm_params:
model: gpt-3.5-turbo
api_key: os.environ/OPENAI_API_KEY
# Anthropic Claude Models
- model_name: claude-3-opus
litellm_params:
model: anthropic/claude-3-opus-20240229
api_key: os.environ/ANTHROPIC_API_KEY
- model_name: claude-3-sonnet
litellm_params:
model: anthropic/claude-3-sonnet-20240229
api_key: os.environ/ANTHROPIC_API_KEY
# Fake endpoint for testing (used in benchmarks)
- model_name: fake-openai-endpoint
litellm_params:
model: openai/fake
api_key: fake-key
api_base: https://exampleopenaiendpoint-production.up.railway.app/
# AWS Bedrock Models (using IAM authentication)
# - model_name: bedrock-claude
# litellm_params:
# model: bedrock/anthropic.claude-v2
# aws_region_name: us-east-1
# Azure OpenAI Models
# - model_name: azure-gpt-4
# litellm_params:
# model: azure/gpt-4
# api_key: os.environ/AZURE_OPENAI_API_KEY
# api_base: os.environ/AZURE_OPENAI_API_BASE
# api_version: "2024-02-01"
# Google Vertex AI Models
# - model_name: gemini-pro
# litellm_params:
# model: vertex_ai/gemini-pro
# vertex_project: os.environ/VERTEX_PROJECT
# vertex_location: os.environ/VERTEX_LOCATION
litellm_settings:
# Enable detailed logging
set_verbose: false
# Request timeout
request_timeout: 600
# Enable fallbacks on errors
fallbacks: []
# Context window fallbacks
context_window_fallbacks: []
# Enable content moderation (requires provider support)
# content_policy_fallbacks: []
router_settings:
# Routing strategy: "simple-shuffle" | "latency-based-routing" | "least-busy" | "usage-based-routing"
routing_strategy: latency-based-routing
# Enable retry on failure
num_retries: 2
# Timeout for retries
timeout: 300
# Redis for caching router decisions (optional but recommended)
# redis_host: os.environ/REDIS_HOST
# redis_port: os.environ/REDIS_PORT
# redis_password: os.environ/REDIS_PASSWORD
# Model-specific cooldown after errors (seconds)
allowed_fails: 3
cooldown_time: 60
general_settings:
# Master key for API authentication (required)
master_key: os.environ/PROXY_MASTER_KEY
# Database URL (automatically set by ECS task definition)
database_url: os.environ/DATABASE_URL
# Store model information in database
store_model_in_db: true
# Enable batch writing to reduce database load
# Recommended for high throughput (1-2K RPS)
proxy_batch_write_at: 60
# Enable logging to external services
# success_callback: ["langsmith", "lunary"]
# failure_callback: ["langsmith", "lunary"]
# Alert webhooks
# alerting: ["slack"]
# alerting_threshold: 300 # seconds
# Cost tracking
# max_budget: 100 # USD
# budget_duration: 30d
# Optional: Cache configuration
# Reduces database load by 60-80%
# cache:
# type: redis
# host: os.environ/REDIS_HOST
# port: os.environ/REDIS_PORT
# password: os.environ/REDIS_PASSWORD
# ttl: 600 # Cache TTL in seconds
# Optional: Prometheus metrics
# prometheus:
# enabled: true
# port: 9090
# Optional: Admin UI settings
# ui_settings:
# master_key: os.environ/PROXY_MASTER_KEY
# disable_ui: false
# Optional: Rate limiting
# rate_limit:
# rpm: 60 # Requests per minute per key
# tpm: 1000 # Tokens per minute per key
# Optional: Team/User management
# team_settings:
# - team_id: team_1
# max_budget: 50
# budget_duration: 30d
# models: ["gpt-4", "gpt-3.5-turbo"]
# Optional: Guardrails (content filtering, PII detection)
# guardrails:
# - guardrail_name: "pii-detection"
# litellm_params:
# guardrail: presidio
# mode: "during_call"
# Optional: Logging integrations
# langsmith:
# api_key: os.environ/LANGSMITH_API_KEY
# project: litellm-proxy
# Optional: Alerting integrations
# slack:
# webhook_url: os.environ/SLACK_WEBHOOK_URL
# Environment variables to set in ECS task definition:
# - OPENAI_API_KEY: Your OpenAI API key
# - ANTHROPIC_API_KEY: Your Anthropic API key
# - PROXY_MASTER_KEY: Master key for proxy authentication
# - DATABASE_URL: PostgreSQL connection string (auto-set)
# - REDIS_HOST: Redis host (optional)
# - REDIS_PORT: Redis port (optional)
# - REDIS_PASSWORD: Redis password (optional)