BerriAI/litellm · error · ValueError
Trying to Customize Email Alerting
Error message
Trying to Customize Email Alerting
{CommonProxyErrors.not_premium_user.value} What it means
The litellm proxy checks alerting customization at startup/handler init: if the deployment is not premium (no enterprise license resolving premium_user=True) yet the alerting config sets email_logo_url or email_support_contact, a ValueError is raised (litellm/integrations/SlackAlerting/slack_alerting.py:1081-1088). These email-branding fields are enterprise-tier features.
Solutions
- Remove email_logo_url and email_support_contact from the alerting config on community litellm.
- Or obtain an enterprise license and set LITELLM_LICENSE so premium_user is True.
- If you have a license, verify it is actually loaded (correct env var/secret, not expired) since the check is premium_user is not True.
- Keep enterprise-only keys in a separate overlay config applied only to licensed deployments.
Example fix
# before (litellm_config.yaml) litellm_settings: alerting: email_logo_url: "https://corp/logo.png" # ValueError: Trying to Customize Email Alerting ... # after alerting: [] # community build: drop email branding keys # or set LITELLM_LICENSE=<enterprise key> and keep the branding fields
Defensive patterns
Strategy: validation
Validate before calling
# config-level guard before deploying community litellm
import yaml
cfg = yaml.safe_load(open("litellm_config.yaml"))
alerting = cfg.get("litellm_settings", {}).get("alerting") or cfg.get("alerting") or {}
has_license = bool(os.getenv("LITELLM_LICENSE"))
if not has_license:
text = str(alerting)
assert "email_logo_url" not in text and "email_support_contact" not in text, \
"email branding fields require an enterprise license; remove them" Try / catch
try:
await alerting._check_if_using_premium_email_feature(premium_user, email_logo_url, email_support_contact)
except ValueError as e:
if "not_premium_user" in str(e) or "Customize Email Alerting" in str(e):
# drop enterprise-only email branding and continue
email_logo_url = email_support_contact = None
else:
raise Prevention
- Keep enterprise-only config keys in a separate overlay applied only to licensed deployments.
- CI-validate the proxy config against the deployment tier (community vs enterprise).
- If licensed, verify LITELLM_LICENSE actually loads (premium_user True) before enabling branding.
When it happens
Trigger: Adding email_logo_url or email_support_contact under alerting in the proxy config without an enterprise LITELLM_LICENSE key; copying an enterprise example config into a community deployment; license env var present but invalid so premium_user resolves False.
Common situations: Trialing the email branding shown in enterprise docs; expired/removed license keys after a trial; k8s secret with the license not mounted so premium check fails.
Related errors
- Blocked user check was never set. This call has no…
- MissingTrying to use Llama GuardMissing litellm-enterprise…
- Only premium users can add tags to projects. You must be a…
- Trying to use Google Text Moderation,This uses the…
- Trying to use Llama GuardYou must be a LiteLLM Enterprise…
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/50ba2fe65b72f412.
Report an issue: GitHub.
Appendix: source
Thrown at litellm/integrations/SlackAlerting/slack_alerting.py:1088
)
if response.status_code == 200:
return True
else:
print("Error sending webhook alert. Error=", response.text) # noqa: T201
return False
async def _check_if_using_premium_email_feature(
self,
premium_user: bool,
email_logo_url: str | None = None,
email_support_contact: str | None = None,
):
from litellm.proxy.proxy_server import CommonProxyErrors, premium_user
if premium_user is not True:
if email_logo_url is not None or email_support_contact is not None:
raise ValueError(f"Trying to Customize Email Alerting\n {CommonProxyErrors.not_premium_user.value}")
async def _construct_user_invitation_link(self, recipient_user_id: str | None, base_url: str) -> str:
from litellm.proxy.management_helpers.user_invitation import (
create_invitation_for_user,
)
from litellm.proxy.proxy_server import prisma_client
if recipient_user_id is None or prisma_client is None:
return base_url
try:
existing_invitations: Final = TypeAdapter(list[InvitationModel]).validate_python(
await InvitationLinkRepository(prisma_client).table.find_many( # pyright: ignore[reportAny] # untyped prisma boundary (any-ok), result validated by TypeAdapter
where={"user_id": recipient_user_id}, # mutable-ok: prisma find_many requires a dict where filter
order={"created_at": "desc"}, # mutable-ok: prisma find_many requires a dict order arg
),
from_attributes=True,
)View on GitHub (pinned to 77b7c6c40c)