{"record":{"id":"c6e67d5abf528942","repo":"BerriAI/litellm","slug":"missingtrying-to-use-llama-guardmissing-litellm-en","errorCode":null,"errorMessage":"MissingTrying to use Llama GuardMissing litellm-enterprise package. Please install it to use this feature. Run `pip install litellm-enterprise`","messagePattern":"MissingTrying to use Llama 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":191,"sourceCode":"                    presidio_logging_only = bool(presidio_logging_only)  # validate boolean given\n\n                _presidio_params = {}\n                if \"presidio\" in callback_specific_params and isinstance(callback_specific_params[\"presidio\"], dict):\n                    _presidio_params = callback_specific_params[\"presidio\"]\n\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","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/common_utils/callback_utils.py#L173-L209","documentation":"Raised at proxy startup when config enables the 'llamaguard_moderations' callback but the import of litellm_enterprise.enterprise_callbacks.llama_guard._ENTERPRISE_LlamaGuard fails with ImportError. The message is a concatenation glitch ('MissingTrying to use Llama Guard' + the missing-enterprise boilerplate), but the meaning is simply: Llama Guard moderation ships in the separate paid litellm-enterprise package, which is not installed in this environment.","triggerScenarios":"Adding callbacks: ['llamaguard_moderations'] to litellm_settings in config.yaml on a plain pip install of litellm (open-source only). The import runs immediately during callback resolution, so the proxy fails during config load, before serving.","commonSituations":"Copying an enterprise example config into an OSS deployment; enabling guardrails from docs that do not flag the enterprise dependency; new team members unaware which callbacks are gated.","solutions":["Install the enterprise package: pip install litellm-enterprise.","If you do not have a license, remove 'llamaguard_moderations' from callbacks to start the proxy.","After installing, also set a valid LITELLM_LICENSE or the next check (premium user) will fail.","Verify with python -c \"from litellm_enterprise.enterprise_callbacks.llama_guard import _ENTERPRISE_LlamaGuard\"."],"exampleFix":"# before (config.yaml)\nlitellm_settings:\n  callbacks: [\"llamaguard_moderations\"]\n\n# after\npip install litellm-enterprise\n# and keep the callback only if you hold an enterprise license","handlingStrategy":"fallback","validationCode":"import importlib.util\n\nHAS_LITELLM_ENTERPRISE = importlib.util.find_spec('litellm_enterprise') is not None\nCALLBACKS = ['llamaguard_moderations'] if HAS_LITELLM_ENTERPRISE else []  # build config accordingly","typeGuard":null,"tryCatchPattern":"try:\n    start_proxy(config_with_enterprise_callbacks)\nexcept Exception as e:\n    if 'litellm-enterprise' in str(e):\n        start_proxy(config_without_enterprise_callbacks)  # degrade to OSS feature set\n    else:\n        raise","preventionTips":["Gate enterprise callbacks behind a find_spec('litellm_enterprise') check when generating config.","Pin litellm-enterprise in the same requirements set as the callbacks that need it.","Document which callbacks in your config are enterprise-gated to avoid surprise startup failures."],"tags":["litellm","proxy","callbacks","llama-guard","enterprise","importerror"],"backgroundTag":"missing-optional-dependency","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}