{"record":{"id":"cd126a0a32438b5a","repo":"BerriAI/litellm","slug":"trying-to-use-google-text-moderation-this-uses-the","errorCode":null,"errorMessage":"Trying to use Google Text Moderation,This uses the enterprise folder - only available on the Docker image.","messagePattern":"Trying to use Google Text Moderation,This uses the enterprise folder - only available on the Docker image\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/proxy/common_utils/callback_utils.py","lineNumber":256,"sourceCode":"                    callback_specific_params[\"lakera_prompt_injection\"], dict\n                ):\n                    init_params = callback_specific_params[\"lakera_prompt_injection\"]\n                lakera_moderations_object = lakeraAI_Moderation(**init_params)\n                imported_list.append(lakera_moderations_object)\n            elif isinstance(callback, str) and callback == \"aporia_prompt_injection\":\n                from litellm.proxy.guardrails.guardrail_hooks.aporia_ai.aporia_ai import (\n                    AporiaGuardrail,\n                )\n\n                aporia_guardrail_object = AporiaGuardrail()\n                imported_list.append(aporia_guardrail_object)\n            elif isinstance(callback, str) and callback == \"google_text_moderation\":\n                try:\n                    from enterprise.enterprise_hooks.google_text_moderation import (\n                        _ENTERPRISE_GoogleTextModeration,\n                    )\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:","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/common_utils/callback_utils.py#L238-L274","documentation":"Raised at startup when callbacks enables 'google_text_moderation' but importing enterprise.enterprise_hooks.google_text_moderation._ENTERPRISE_GoogleTextModeration fails with ImportError. Like openai_moderations, this hook lives in the 'enterprise' folder that exists only in LiteLLM's official Docker image; a pip-installed proxy cannot load it, and the concatenated message directs you to the Docker image.","triggerScenarios":"callbacks: ['google_text_moderation'] in config.yaml while running litellm from pip, uv, or a custom slim image that does not vendor the enterprise folder. Fails during config load before the server binds.","commonSituations":"Same config reused across pip dev environments and docker prod; teams building minimal images to cut size and accidentally excluding enterprise hooks; OSS-only installs trialing moderation features.","solutions":["Deploy with the official litellm/litellm Docker image that includes the enterprise folder.","Or remove 'google_text_moderation' from callbacks for non-docker installs.","Remember the license gate follows: set LITELLM_LICENSE once the import resolves.","Smoke-test custom images: python -c \"import enterprise.enterprise_hooks.google_text_moderation\"."],"exampleFix":"# before\nuv pip install litellm && litellm --config config.yaml  # config has callbacks: [\"google_text_moderation\"]\n\n# after\ndocker run -e LITELLM_LICENSE=$LITELLM_LICENSE -v $PWD/config.yaml:/app/config.yaml litellm/litellm","handlingStrategy":"validation","validationCode":"import importlib.util\n\nif 'google_text_moderation' in callbacks and importlib.util.find_spec('enterprise.enterprise_hooks.google_text_moderation') is None:\n    callbacks = [c for c in callbacks if c != 'google_text_moderation']\n    logger.warning('google_text_moderation unavailable outside the official Docker image; removed')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Maintain separate config profiles: docker (enterprise hooks allowed) vs pip (OSS callbacks only).","CI should validate that every callback in config resolves on the target runtime.","Remember the license gate follows the import gate for this callback."],"tags":["litellm","proxy","callbacks","moderation","enterprise","docker","importerror"],"backgroundTag":"missing-optional-dependency","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}