{"record":{"id":"81028a77ffd6808d","repo":"BerriAI/litellm","slug":"unknown-hook-hook-name-available-hooks-list","errorCode":null,"errorMessage":"Unknown hook: {hook_name}. Available hooks: {list(ENTERPRISE_PROXY_HOOKS.keys())}","messagePattern":"Unknown hook: (.+?)\\. Available hooks: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"enterprise/enterprise_hooks/__init__.py","lineNumber":30,"sourceCode":"    \"managed_vector_stores\": _PROXY_LiteLLMManagedVectorStores,\n}\n\n\ndef get_enterprise_proxy_hook(\n    hook_name: Union[\n        Literal[\n            \"managed_files\",\n            \"managed_vector_stores\",\n            \"max_parallel_requests\",\n        ],\n        str,\n    ],\n):\n    \"\"\"\n    Factory method to get a enterprise hook instance by name\n    \"\"\"\n    if hook_name not in ENTERPRISE_PROXY_HOOKS:\n        raise ValueError(\n            f\"Unknown hook: {hook_name}. Available hooks: {list(ENTERPRISE_PROXY_HOOKS.keys())}\"\n        )\n    return ENTERPRISE_PROXY_HOOKS[hook_name]\n","sourceCodeStart":12,"sourceCodeEnd":34,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/enterprise/enterprise_hooks/__init__.py#L12-L34","documentation":"Parameter validation for DALL-E 2 image generation: litellm maps general completion-style optional params onto image-generation calls. For each non-default param not already in optional_params, it must appear in the model's supported OpenAI params; otherwise, unless drop_params=True, a ValueError listing the supported set is raised. DALL-E 2 supports only a small set (prompt, n, size, response_format, user), so richer params (quality, style) fail here.","triggerScenarios":"Calling litellm.image_generation(model='dall-e-2', ...) with parameters DALL-E 2 does not support, e.g. quality='hd', style='natural', or any chat-completion param leaked into the call, without drop_params=True.","commonSituations":"Sharing one image-generation wrapper across dall-e-2, dall-e-3, and gpt-image-1 and passing the union of all params; upgrading from dall-e-3 code to dall-e-2 for cost without trimming params; router configs with default param blocks applied to every model.","solutions":["Remove params not in the error's supported list (for dall-e-2: essentially n, size, response_format, user).","Or set drop_params=True (litellm.drop_params = True or per-request) to silently drop unsupported params.","Or switch to dall-e-3 / gpt-image-1 if you need quality/style params.","Key params per model in config rather than passing a shared dict to all models."],"exampleFix":"# before\nlitellm.image_generation(model=\"dall-e-2\", prompt=\"cat\", quality=\"hd\", style=\"natural\")\n\n# after\nlitellm.image_generation(model=\"dall-e-2\", prompt=\"cat\", size=\"1024x1024\")\n# or: litellm.drop_params = True","handlingStrategy":"validation","validationCode":"from litellm.constants import IMAGE_GENERATION_DEFAULT_PARAMS\n\nDALLE2_SUPPORTED = {\"prompt\", \"n\", \"size\", \"response_format\", \"user\"}\n\ndef validate_dalle2_params(params: dict) -> list[str]:\n    return [k for k in params if k not in DALLE2_SUPPORTED and k != \"prompt\"]  # non-empty => will raise","typeGuard":"def param_set_is_supported(params: dict, supported: set[str]) -> bool:\n    return set(params).issubset(supported)","tryCatchPattern":"try:\n    img = litellm.image_generation(model=\"dall-e-2\", prompt=p, **params)\nexcept ValueError as e:\n    if \"not supported\" in str(e):\n        params = {k: v for k, v in params.items() if k in DALLE2_SUPPORTED}\n        img = litellm.image_generation(model=\"dall-e-2\", prompt=p, **params)\n    else:\n        raise","preventionTips":["Keep a per-model allowlist of image params and filter kwargs before calling.","Set litellm.drop_params = True in apps that must accept user-supplied params safely.","Check get_supported_openai_params(model) programmatically instead of guessing."],"tags":["openai","dall-e-2","image-generation","parameter-validation","litellm"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}