BerriAI/litellm · error · Exception

MissingTrying to use Llama GuardMissing litellm-enterprise p

Error message

MissingTrying to use Llama GuardMissing litellm-enterprise package. Please install it to use this feature. Run `pip install litellm-enterprise`

What it means

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.

Source

Thrown at litellm/proxy/common_utils/callback_utils.py:191

                    presidio_logging_only = bool(presidio_logging_only)  # validate boolean given

                _presidio_params = {}
                if "presidio" in callback_specific_params and isinstance(callback_specific_params["presidio"], dict):
                    _presidio_params = callback_specific_params["presidio"]

                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
                    )

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Install the enterprise package: pip install litellm-enterprise.
  2. If you do not have a license, remove 'llamaguard_moderations' from callbacks to start the proxy.
  3. After installing, also set a valid LITELLM_LICENSE or the next check (premium user) will fail.
  4. Verify with python -c "from litellm_enterprise.enterprise_callbacks.llama_guard import _ENTERPRISE_LlamaGuard".

Example fix

# before (config.yaml)
litellm_settings:
  callbacks: ["llamaguard_moderations"]

# after
pip install litellm-enterprise
# and keep the callback only if you hold an enterprise license
Defensive patterns

Strategy: fallback

Validate before calling

import importlib.util

HAS_LITELLM_ENTERPRISE = importlib.util.find_spec('litellm_enterprise') is not None
CALLBACKS = ['llamaguard_moderations'] if HAS_LITELLM_ENTERPRISE else []  # build config accordingly

Try / catch

try:
    start_proxy(config_with_enterprise_callbacks)
except Exception as e:
    if 'litellm-enterprise' in str(e):
        start_proxy(config_without_enterprise_callbacks)  # degrade to OSS feature set
    else:
        raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/c6e67d5abf528942. Report an issue: GitHub.