BerriAI/litellm · error · Exception
Trying to use Llm GuardMissing litellm-enterprise package. P
Error message
Trying to use Llm GuardMissing litellm-enterprise package. Please install it to use this feature. Run `pip install litellm-enterprise`
What it means
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.
Source
Thrown at litellm/proxy/common_utils/callback_utils.py:272
)
except ImportError:
raise Exception(
"Trying to use Google Text Moderation,"
+ CommonProxyErrors.missing_enterprise_package_docker.value
)
if premium_user is not True:
raise Exception("Trying to use Google Text Moderation" + CommonProxyErrors.not_premium_user.value)
google_text_moderation_obj = _ENTERPRISE_GoogleTextModeration()
imported_list.append(google_text_moderation_obj)
elif isinstance(callback, str) and callback == "llmguard_moderations":
try:
from litellm_enterprise.enterprise_callbacks.llm_guard import (
_ENTERPRISE_LLMGuard,
)
except ImportError:
raise Exception("Trying to use Llm Guard" + CommonProxyErrors.missing_enterprise_package.value)
if premium_user is not True:
raise Exception("Trying to use Llm Guard" + CommonProxyErrors.not_premium_user.value)
llm_guard_moderation_obj = _ENTERPRISE_LLMGuard()
imported_list.append(llm_guard_moderation_obj)
elif isinstance(callback, str) and callback == "blocked_user_check":
try:
from enterprise.enterprise_hooks.blocked_user_list import (
_ENTERPRISE_BlockedUserList,
)
except ImportError:
raise Exception(
"Trying to use Blocked User List" + CommonProxyErrors.missing_enterprise_package_docker.value
)
if premium_user is not True:
raise Exception("Trying to use ENTERPRISE BlockedUser" + CommonProxyErrors.not_premium_user.value)View on GitHub (pinned to 77b7c6c40c)
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.
Example fix
# before: config.yaml litellm_settings: callbacks: ["llmguard_moderations"] # after: install package + license pip install litellm-enterprise export LITELLM_LICENSE="sk-..."
Defensive patterns
Strategy: validation
Validate before calling
import importlib.util
def enterprise_deps_ok() -> bool:
return importlib.util.find_spec("litellm_enterprise") is not None
assert enterprise_deps_ok(), "pip install litellm-enterprise before enabling llmguard_moderations" Try / catch
try:
initialize_callbacks_on_proxy(config, premium_user=premium)
except Exception as e:
if "Missing litellm-enterprise package" in str(e):
subprocess.run([sys.executable, "-m", "pip", "install", "litellm-enterprise"], check=False)
raise SystemExit("retry proxy start after installing litellm-enterprise")
raise Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "X is not installed. Please install it with pip install Y": missing optional dependency errors — ImportError/ValueError raised when a library's optional extra was never installed — this error's family across 22 libraries.
Related errors
- Trying to use Llm GuardYou must be a LiteLLM Enterprise user
- Trying to use Blocked User ListThis uses the enterprise fold
- Trying to use Banned KeywordsThis uses the enterprise folder
- Importing torch, transformers, petals failed Try pip install
- Trying to use Google Text ModerationYou must be a LiteLLM En
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/78b1de0343f9d5bb.
Report an issue: GitHub.