[Docs] Email notifs (#10733)

* docs emails

* docs email notifs
This commit is contained in:
Ishaan Jaff 2025-05-10 17:24:18 -07:00 • committed by GitHub
parent 07cb100fdc
commit 7942f6f595
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 55 additions and 28 deletions

View file

@ -1,35 +1,75 @@
import Image from '@theme/IdealImage';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Email Notifications
Send an Email to your users when:
- A Proxy API Key is created for them
- Their API Key crosses it's Budget
- All Team members of a LiteLLM Team -> when the team crosses it's budget
<Image
img={require('../../img/email_2.png')}
style={{width: '70%', display: 'block', margin: '0 0 2rem 0'}}
/>
<p style={{textAlign: 'left', color: '#666'}}>
LiteLLM Email Notifications
</p>
<Image img={require('../../img/email_notifs.png')} style={{ width: '500px' }}/>
## Overview
## Quick Start
Send LiteLLM Proxy users emails for specific events.
| Category | Details |
|----------|---------|
| Supported Events | • User added as a user on LiteLLM Proxy<br/>• Proxy API Key created for user |
| Supported Email Integrations | • Resend API<br/>• SMTP |
## Usage
### 1. Configure email integration
<Tabs>
<TabItem value="smtp" label="SMTP">
Get SMTP credentials to set this up
```yaml showLineNumbers title="proxy_config.yaml"
litellm_settings:
callbacks: ["smtp_email"]
```
Add the following to your proxy env
```shell
```shell showLineNumbers
SMTP_HOST="smtp.resend.com"
SMTP_TLS="True"
SMTP_PORT="587"
SMTP_USERNAME="resend"
SMTP_PASSWORD="*******"
SMTP_SENDER_EMAIL="support@alerts.litellm.ai" # email to send alerts from: `support@alerts.litellm.ai`
SMTP_SENDER_EMAIL="notifications@alerts.litellm.ai"
SMTP_PASSWORD="xxxxx"
```
Add `email` to your proxy config.yaml under `general_settings`
</TabItem>
<TabItem value="resend" label="Resend API">
```yaml
general_settings:
master_key: sk-1234
alerting: ["email"]
Add `resend_email` to your proxy config.yaml under `litellm_settings`
set the following env variables
```shell showLineNumbers
RESEND_API_KEY="re_1234"
```
That's it ! start your proxy
```yaml showLineNumbers title="proxy_config.yaml"
litellm_settings:
callbacks: ["resend_email"]
```
</TabItem>
</Tabs>
### 2. Create a new user
On the LiteLLM Proxy UI, go to users > create a new user.
After creating a new user, they will receive an email invite a the email you specified when creating the user.
## Customizing Email Branding

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 KiB

View file

@ -8,16 +8,3 @@ model_list:
litellm_settings:
callbacks: ["smtp_email"]
guardrails:
- guardrail_name: "bedrock-pre-guard"
litellm_params:
guardrail: bedrock # supported values: "aporia", "bedrock", "lakera"
mode: "pre_call"
guardrailIdentifier: wf0hkdb5x07f # your guardrail ID on bedrock
guardrailVersion: "DRAFT" # your guardrail version on bedrock
mask_request_content: true
mask_response_content: true
general_settings:
store_model_in_db: true
store_prompts_in_spend_logs: true