{"record":{"id":"8e61d5c317e94d4d","repo":"BerriAI/litellm","slug":"trying-to-use-google-text-moderationyou-must-be-a","errorCode":null,"errorMessage":"Trying to use Google Text ModerationYou must be a LiteLLM Enterprise user to use this feature. If you have a license please set `LITELLM_LICENSE` in your env. Get a 7 day trial key here: https://www.litellm.ai/enterprise#trial. \nPricing: https://www.litellm.ai/#pricing","messagePattern":"Trying to use Google Text ModerationYou must be a LiteLLM Enterprise user to use this feature\\. If you have a license please set `LITELLM_LICENSE` in your env\\. Get a 7 day trial key here: https://www\\.litellm\\.ai/enterprise#trial\\. \nPricing: https://www\\.litellm\\.ai/#pricing","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/proxy/common_utils/callback_utils.py","lineNumber":262,"sourceCode":"                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:\n                    raise Exception(\"Trying to use Llm Guard\" + CommonProxyErrors.not_premium_user.value)\n\n                llm_guard_moderation_obj = _ENTERPRISE_LLMGuard()\n                imported_list.append(llm_guard_moderation_obj)\n            elif isinstance(callback, str) and callback == \"blocked_user_check\":\n                try:","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/common_utils/callback_utils.py#L244-L280","documentation":"The LiteLLM proxy raises this while loading the config at startup. The callback name 'google_text_moderation' was listed in litellm_settings.callbacks, but the proxy did not verify an enterprise license, so premium_user is False. The message text is a direct string concat of 'Trying to use Google Text Moderation' and CommonProxyErrors.not_premium_user, which is why the two parts run together. The proxy stops startup when this fires.","triggerScenarios":"Start litellm proxy with a config.yaml that contains litellm_settings: callbacks: ['google_text_moderation'] while the LITELLM_LICENSE env var is unset, empty, invalid, or expired. premium_user is decided once at proxy startup from LITELLM_LICENSE, so any later env change needs a restart.","commonSituations":"Copying a guardrail example config from the LiteLLM docs that includes enterprise callbacks. A trial key expired. LITELLM_LICENSE was added to a .env file that the Docker container or systemd unit does not load.","solutions":["Remove 'google_text_moderation' from litellm_settings.callbacks in the proxy config, or replace it with an open-source moderation option such as the open-source guardrails callbacks.","Get a license or 7-day trial key at https://www.litellm.ai/enterprise#trial, set LITELLM_LICENSE in the proxy process env, and restart the proxy.","If a license should be active, confirm it reaches the process: print os.environ.get('LITELLM_LICENSE') inside the proxy env (name only, never the value) and check startup logs for license verification failure."],"exampleFix":"# config.yaml — before\nlitellm_settings:\n  callbacks: [\"google_text_moderation\"]\n\n# config.yaml — after (no enterprise license)\nlitellm_settings:\n  callbacks: []\n\n# or, with a license:\nexport LITELLM_LICENSE=\"sk-...\"\n# config.yaml stays as before","handlingStrategy":"validation","validationCode":"ENTERPRISE_CALLBACKS = {\"google_text_moderation\", \"llmguard_moderations\", \"blocked_user_check\", \"banned_keywords\"}\nimport os\n\ndef config_will_load(cfg: dict) -> list[str]:\n    problems = []\n    callbacks = (cfg.get(\"litellm_settings\") or {}).get(\"callbacks\") or []\n    used = {c for c in callbacks if isinstance(c, str)} & ENTERPRISE_CALLBACKS\n    if used and not os.environ.get(\"LITELLM_LICENSE\"):\n        problems.append(f\"enterprise callbacks {sorted(used)} need LITELLM_LICENSE\")\n    return problems\n\nproblems = config_will_load(yaml.safe_load(open(\"config.yaml\")))\nassert not problems, problems","typeGuard":"def is_premium_callback(callback_name: str) -> bool:\n    return callback_name in {\n        \"google_text_moderation\", \"llmguard_moderations\",\n        \"blocked_user_check\", \"banned_keywords\",\n    }","tryCatchPattern":"try:\n    run_proxy(config)  # config load that raises on gated callbacks\nexcept Exception as e:\n    if \"must be a LiteLLM Enterprise user\" in str(e):\n        fix_license_or_callbacks(e)  # set LITELLM_LICENSE or strip the callback\n    else:\n        raise","preventionTips":["Keep enterprise callbacks in a separate overlay config used only on licensed deployments.","Add a CI check that fails when config.yaml uses enterprise callbacks and LITELLM_LICENSE is absent from the deploy env.","Treat a startup failure naming an enterprise feature as a license problem first; check the env before debugging code."],"tags":["litellm","enterprise","license","config","moderation","startup"],"backgroundTag":"enterprise-license-required","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}