{"record":{"id":"26e7474b44adac93","repo":"BerriAI/litellm","slug":"trying-to-use-llama-guardyou-must-be-a-litellm-ent","errorCode":null,"errorMessage":"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. \nPricing: https://www.litellm.ai/#pricing","messagePattern":"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\\. \nPricing: https://www\\.litellm\\.ai/#pricing","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/proxy/common_utils/callback_utils.py","lineNumber":196,"sourceCode":"\n                params: dict[str, Any] = {\n                    \"logging_only\": presidio_logging_only,\n                    **_presidio_params,\n                }\n                pii_masking_object = _OPTIONAL_PresidioPIIMasking(**params)\n                imported_list.append(pii_masking_object)\n            elif isinstance(callback, str) and callback == \"llamaguard_moderations\":\n                try:\n                    from litellm_enterprise.enterprise_callbacks.llama_guard import (\n                        _ENTERPRISE_LlamaGuard,\n                    )\n                except ImportError:\n                    raise Exception(\n                        \"MissingTrying to use Llama Guard\" + CommonProxyErrors.missing_enterprise_package.value\n                    )\n\n                if premium_user is not True:\n                    raise Exception(\"Trying to use Llama Guard\" + CommonProxyErrors.not_premium_user.value)\n\n                llama_guard_object = _ENTERPRISE_LlamaGuard()\n                imported_list.append(llama_guard_object)\n            elif isinstance(callback, str) and callback == \"hide_secrets\":\n                try:\n                    from litellm_enterprise.enterprise_callbacks.secret_detection import (\n                        _ENTERPRISE_SecretDetection,\n                    )\n                except ImportError:\n                    raise Exception(\n                        \"Trying to use Secret Detection\" + CommonProxyErrors.missing_enterprise_package.value\n                    )\n\n                if premium_user is not True:\n                    raise Exception(\"Trying to use secret hiding\" + CommonProxyErrors.not_premium_user.value)\n\n                _secret_detection_object = _ENTERPRISE_SecretDetection()\n                imported_list.append(_secret_detection_object)","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/common_utils/callback_utils.py#L178-L214","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before\ndocker run ... litellm/litellm  # LITELLM_LICENSE missing\n\n# after\ndocker run -e LITELLM_LICENSE=$LITELLM_LICENSE ... litellm/litellm","handlingStrategy":"validation","validationCode":"import os\n\nif 'llamaguard_moderations' in desired_callbacks and not os.environ.get('LITELLM_LICENSE'):\n    raise SystemExit('llamaguard_moderations requires LITELLM_LICENSE; set it or drop the callback')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["litellm","proxy","callbacks","llama-guard","enterprise","license","premium"],"backgroundTag":"missing-license-key","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}