Skip to main content

Overview

LiteLLM integrates with multiple secret management systems to securely store and retrieve API keys and sensitive configuration. This eliminates hardcoded credentials and enables centralized secret management.

Supported Secret Managers

  • AWS Secrets Manager: Full-featured AWS secret storage
  • Azure Key Vault: Microsoft Azure secret management
  • Google Cloud Secret Manager: GCP secret storage
  • HashiCorp Vault: Enterprise secret management
  • CyberArk: Enterprise privileged access management
  • Google KMS: Encryption key management
  • AWS KMS: AWS encryption service
  • Custom: Build your own integration

Quick Start

1

Choose Your Secret Manager

Install required dependencies:
2

Configure Environment

Set up authentication:
3

Initialize Secret Manager

Configure LiteLLM to use your secret manager:
4

Use Secrets in API Calls

Reference secrets by name:

AWS Secrets Manager

Setup

Read Secrets

Write Secrets

Rotate Secrets

Delete Secrets

Azure Key Vault

Setup

Use with LiteLLM

Google Cloud Secret Manager

Setup

Operations

HashiCorp Vault

Setup

Operations

CyberArk

Setup

Operations

Custom Secret Manager

Implement Base Class

Use Custom Secret Manager

Using with LiteLLM Proxy

Configuration

config.yaml
config.yaml
config.yaml
config.yaml

Best Practices

For AWS, prefer IAM roles over access keys:
Regularly rotate secrets:
Reduce API calls with caching:
Gracefully handle missing secrets:
Log all secret access for security auditing:

Reference

Source Code

  • Base secret manager: litellm/secret_managers/base_secret_manager.py:9
  • AWS Secrets Manager: litellm/secret_managers/aws_secret_manager_v2.py:36
  • Secret manager handler: litellm/secret_managers/secret_manager_handler.py:24

Environment Variables