{"record":{"id":"99525d86ee51f544","repo":"BerriAI/litellm","slug":"trying-to-use-llm-guardyou-must-be-a-litellm-enter","errorCode":null,"errorMessage":"Trying to use Llm 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 Llm 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":275,"sourceCode":"                        \"Trying to use Google Text Moderation,\"\n                        + CommonProxyErrors.missing_enterprise_package_docker.value\n                    )\n\n                if premium_user is not True:\n                    raise Exception(\"Trying to use Google Text Moderation\" + CommonProxyErrors.not_premium_user.value)\n\n                google_text_moderation_obj = _ENTERPRISE_GoogleTextModeration()\n                imported_list.append(google_text_moderation_obj)\n            elif isinstance(callback, str) and callback == \"llmguard_moderations\":\n                try:\n                    from litellm_enterprise.enterprise_callbacks.llm_guard import (\n                        _ENTERPRISE_LLMGuard,\n                    )\n                except ImportError:\n                    raise Exception(\"Trying to use Llm Guard\" + CommonProxyErrors.missing_enterprise_package.value)\n\n                if premium_user is not True:\n                    raise Exception(\"Trying to use Llm Guard\" + CommonProxyErrors.not_premium_user.value)\n\n                llm_guard_moderation_obj = _ENTERPRISE_LLMGuard()\n                imported_list.append(llm_guard_moderation_obj)\n            elif isinstance(callback, str) and callback == \"blocked_user_check\":\n                try:\n                    from enterprise.enterprise_hooks.blocked_user_list import (\n                        _ENTERPRISE_BlockedUserList,\n                    )\n                except ImportError:\n                    raise Exception(\n                        \"Trying to use Blocked User List\" + CommonProxyErrors.missing_enterprise_package_docker.value\n                    )\n\n                if premium_user is not True:\n                    raise Exception(\"Trying to use ENTERPRISE BlockedUser\" + CommonProxyErrors.not_premium_user.value)\n\n                blocked_user_list = _ENTERPRISE_BlockedUserList(prisma_client=prisma_client)\n                imported_list.append(blocked_user_list)","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/common_utils/callback_utils.py#L257-L293","documentation":"The callback 'llmguard_moderations' resolved its import (litellm-enterprise is installed), but premium_user is not True. The proxy therefore rejects the callback with the not_premium_user message appended to 'Trying to use Llm Guard'. premium_user is computed once at proxy startup from the LITELLM_LICENSE key.","triggerScenarios":"litellm-enterprise is installed and callbacks include 'llmguard_moderations', but LITELLM_LICENSE is missing, expired, or invalid. The import in callback_utils.py:267 succeeded, then the check at line 275 failed.","commonSituations":"Package installed but the license env var was never exported. A trial key expired between runs. The license is set in a shell but the proxy runs under Docker or systemd without that env.","solutions":["Set LITELLM_LICENSE to a valid enterprise key (7-day trial: https://www.litellm.ai/enterprise#trial) and restart the proxy.","Or remove 'llmguard_moderations' from litellm_settings.callbacks.","Confirm the env var reaches the proxy process (Docker: pass -e LITELLM_LICENSE=...; compose: list it under environment)."],"exampleFix":"# before\ndocker run litellm/litellm --config config.yaml   # no LITELLM_LICENSE\n\n# after\ndocker run -e LITELLM_LICENSE=\"sk-...\" litellm/litellm --config config.yaml","handlingStrategy":"validation","validationCode":"import os\n\ndef llm_guard_config_ok(cfg: dict) -> str | None:\n    callbacks = (cfg.get(\"litellm_settings\") or {}).get(\"callbacks\") or []\n    if \"llmguard_moderations\" in callbacks and not os.environ.get(\"LITELLM_LICENSE\"):\n        return \"llmguard_moderations requires LITELLM_LICENSE\"\n    return None\n\nmsg = llm_guard_config_ok(cfg)\nif msg:\n    raise SystemExit(msg)","typeGuard":null,"tryCatchPattern":"try:\n    start_proxy(cfg)\nexcept Exception as e:\n    if \"Llm Guard\" in str(e) and \"LiteLLM Enterprise user\" in str(e):\n        log.error(\"license missing for llmguard_moderations; export LITELLM_LICENSE\")\n        raise SystemExit(2)\n    raise","preventionTips":["Store LITELLM_LICENSE in the same secret store as LITELLM_MASTER_KEY and inject both together.","Monitor license expiry so callback configs do not break at renewal time.","Document in the repo README which callbacks in config.yaml are enterprise-gated."],"tags":["litellm","enterprise","license","config","llm-guard"],"backgroundTag":"enterprise-license-required","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}