BerriAI/litellm · error · Exception
Trying to use Blocked User ListThis uses the enterprise fold
Error message
Trying to use Blocked User ListThis uses the enterprise folder - only available on the Docker image.
What it means
The callback 'blocked_user_check' is handled by code that imports from the 'enterprise' folder (enterprise.enterprise_hooks.blocked_user_list). That folder ships only inside the LiteLLM enterprise Docker image; a plain pip install of litellm does not contain it. The ImportError is caught and re-raised with this message that names the Docker requirement.
Source
Thrown at litellm/proxy/common_utils/callback_utils.py:285
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)
blocked_user_list = _ENTERPRISE_BlockedUserList(prisma_client=prisma_client)
imported_list.append(blocked_user_list)
elif isinstance(callback, str) and callback == "banned_keywords":
try:
from enterprise.enterprise_hooks.banned_keywords import (
_ENTERPRISE_BannedKeywords,
)
except ImportError:
raise Exception(
"Trying to use Banned Keywords" + CommonProxyErrors.missing_enterprise_package_docker.value
)
View on GitHub (pinned to 77b7c6c40c)
Solutions
- Remove 'blocked_user_check' from litellm_settings.callbacks.
- Or run the proxy with the LiteLLM enterprise Docker image, which contains the enterprise folder.
- Note: even on Docker, a valid LITELLM_LICENSE is still required next (error 2884).
Example fix
# before litellm_settings: callbacks: ["blocked_user_check"] # started with: pip install litellm && litellm --config config.yaml # after litellm_settings: callbacks: [] # or run the enterprise docker image with a license
Defensive patterns
Strategy: validation
Validate before calling
import os
def blocked_user_check_ok() -> bool:
return os.path.isdir("enterprise") and os.path.exists("enterprise/enterprise_hooks/blocked_user_list.py")
if "blocked_user_check" in callbacks and not blocked_user_check_ok():
raise SystemExit("blocked_user_check needs the enterprise Docker image") Try / catch
try:
start_proxy(cfg)
except Exception as e:
if "enterprise folder" in str(e):
raise SystemExit("switch to the litellm enterprise docker image or remove the callback")
raise Prevention
- Mark blocked_user_check in the config with a comment: only-on-enterprise-docker.
- Use one base image for all environments so configs do not depend on the host install type.
- Smoke-test config load in CI with the same image the deployment uses.
When it happens
Trigger: Run the proxy from a pip install or from a source checkout with callbacks: ['blocked_user_check']. Any environment where the top-level 'enterprise' package does not exist produces this error at config load.
Common situations: A config that ran on the official enterprise Docker image is reused on a local pip install or on a custom slim image. Someone builds their own Dockerfile with pip install litellm and loses the enterprise folder.
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 Banned KeywordsThis uses the enterprise folder
- Trying to use Llm GuardMissing litellm-enterprise package. P
- Trying to use ENTERPRISE BlockedUserYou must be a LiteLLM En
- Trying to use OpenAI Moderations Check,This uses the enterpr
- Trying to use Google Text Moderation,This uses the enterpris
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/e7205b8d70db97b8.
Report an issue: GitHub.