{"record":{"id":"78b1de0343f9d5bb","repo":"BerriAI/litellm","slug":"trying-to-use-llm-guardmissing-litellm-enterprise","errorCode":null,"errorMessage":"Trying to use Llm GuardMissing litellm-enterprise package. Please install it to use this feature. Run `pip install litellm-enterprise`","messagePattern":"Trying to use Llm GuardMissing litellm-enterprise package\\. Please install it to use this feature\\. Run `pip install litellm-enterprise`","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/proxy/common_utils/callback_utils.py","lineNumber":272,"sourceCode":"                    )\n                except ImportError:\n                    raise Exception(\n                        \"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)","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/common_utils/callback_utils.py#L254-L290","documentation":"The proxy config lists the callback 'llmguard_moderations'. The loader then tries to import litellm_enterprise.enterprise_callbacks.llm_guard._ENTERPRISE_LLMGuard. That import fails because the litellm-enterprise pip package is not installed in the proxy environment. This error fires before the premium-user check, so fixing it alone leads to error 2882 unless a license is also set.","triggerScenarios":"Run the proxy with litellm_settings.callbacks containing 'llmguard_moderations' on a host or image where 'pip show litellm-enterprise' returns nothing. Common when the config was tested on the enterprise Docker image but runs elsewhere.","commonSituations":"Config copied between environments: works on the enterprise Docker image, fails on a plain pip install of litellm. A new team member runs the config locally without the private package. CI starts the proxy without the enterprise dependency.","solutions":["Install the package: pip install litellm-enterprise (it requires an active license to actually pass the next check).","Or remove 'llmguard_moderations' from litellm_settings.callbacks.","After install, also set LITELLM_LICENSE so the premium_user check (error 2882) passes."],"exampleFix":"# before: config.yaml\nlitellm_settings:\n  callbacks: [\"llmguard_moderations\"]\n\n# after: install package + license\npip install litellm-enterprise\nexport LITELLM_LICENSE=\"sk-...\"","handlingStrategy":"validation","validationCode":"import importlib.util\n\ndef enterprise_deps_ok() -> bool:\n    return importlib.util.find_spec(\"litellm_enterprise\") is not None\n\nassert enterprise_deps_ok(), \"pip install litellm-enterprise before enabling llmguard_moderations\"","typeGuard":null,"tryCatchPattern":"try:\n    initialize_callbacks_on_proxy(config, premium_user=premium)\nexcept Exception as e:\n    if \"Missing litellm-enterprise package\" in str(e):\n        subprocess.run([sys.executable, \"-m\", \"pip\", \"install\", \"litellm-enterprise\"], check=False)\n        raise SystemExit(\"retry proxy start after installing litellm-enterprise\")\n    raise","preventionTips":["Pin litellm-enterprise in the same requirements file as the configs that use it.","Run a pre-flight import check in the container entrypoint before starting the proxy.","Remember the package alone is not enough: a valid LITELLM_LICENSE is required for the next check."],"tags":["litellm","enterprise","import-error","dependency","config","llm-guard"],"backgroundTag":"missing-optional-dependency","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}