BerriAI/litellm · error · Exception
Trying to use Llama GuardYou must be a LiteLLM Enterprise us
Error message
Trying to use Llama GuardYou must be a LiteLLM Enterprise user to use this feature. If you have a license please set `LITELLM_LICENSE` in your env. Get a 7 day trial key here: https://www.litellm.ai/enterprise#trial. Pricing: https://www.litellm.ai/#pricing
What it means
Raised at startup after the Llama Guard import succeeds but premium_user is not True. LiteLLM resolves premium status from the LITELLM_LICENSE environment variable (checked against the enterprise license service); with no/invalid license, enterprise callbacks like llamaguard_moderations refuse to run. The message appends the not-premium-user boilerplate pointing at LITELLM_LICENSE and the trial-key URL.
Source
Thrown at litellm/proxy/common_utils/callback_utils.py:196
params: dict[str, Any] = {
"logging_only": presidio_logging_only,
**_presidio_params,
}
pii_masking_object = _OPTIONAL_PresidioPIIMasking(**params)
imported_list.append(pii_masking_object)
elif isinstance(callback, str) and callback == "llamaguard_moderations":
try:
from litellm_enterprise.enterprise_callbacks.llama_guard import (
_ENTERPRISE_LlamaGuard,
)
except ImportError:
raise Exception(
"MissingTrying to use Llama Guard" + CommonProxyErrors.missing_enterprise_package.value
)
if premium_user is not True:
raise Exception("Trying to use Llama Guard" + CommonProxyErrors.not_premium_user.value)
llama_guard_object = _ENTERPRISE_LlamaGuard()
imported_list.append(llama_guard_object)
elif isinstance(callback, str) and callback == "hide_secrets":
try:
from litellm_enterprise.enterprise_callbacks.secret_detection import (
_ENTERPRISE_SecretDetection,
)
except ImportError:
raise Exception(
"Trying to use Secret Detection" + CommonProxyErrors.missing_enterprise_package.value
)
if premium_user is not True:
raise Exception("Trying to use secret hiding" + CommonProxyErrors.not_premium_user.value)
_secret_detection_object = _ENTERPRISE_SecretDetection()
imported_list.append(_secret_detection_object)View on GitHub (pinned to 77b7c6c40c)
Solutions
- Set a valid license: export LITELLM_LICENSE=<key> on every proxy process (docker -e, helm values, unit Environment=).
- No license yet? Get the 7-day trial key from https://www.litellm.ai/enterprise#trial.
- Restart the proxy after setting the variable; premium status is evaluated at callback load.
- If you do not intend to license, drop the callback from config.
Example fix
# before docker run ... litellm/litellm # LITELLM_LICENSE missing # after docker run -e LITELLM_LICENSE=$LITELLM_LICENSE ... litellm/litellm
Defensive patterns
Strategy: validation
Validate before calling
import os
if 'llamaguard_moderations' in desired_callbacks and not os.environ.get('LITELLM_LICENSE'):
raise SystemExit('llamaguard_moderations requires LITELLM_LICENSE; set it or drop the callback') Prevention
- Add LITELLM_LICENSE to the deployment's env spec next to the callback in config review.
- Fail CI fast: a config containing enterprise callbacks must pair with a non-empty LITELLM_LICENSE.
- Track license expiry dates; startups die at config load when the trial lapses.
When it happens
Trigger: litellm-enterprise installed and callbacks: ['llamaguard_moderations'] configured, but the proxy process has no LITELLM_LICENSE env var, an expired trial, or a license for a different deployment count.
Common situations: Trials expiring; env var set in the shell but not in the systemd unit/docker container running the proxy; license configured on one replica but not others; local dev against a prod license file that is not mounted.
Related errors
- Trying to use secret hidingYou must be a LiteLLM Enterprise
- Trying to use OpenAI Moderations CheckYou must be a LiteLLM
- MissingTrying to use Llama GuardMissing litellm-enterprise p
- You must be a LiteLLM Enterprise user to use this feature. I
- Setting tag-based guardrails is only available in litellm-en
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/26e7474b44adac93.
Report an issue: GitHub.