BerriAI/litellm · error · ValueError

Unknown hook: . Available hooks

Error message

Unknown hook: {hook_name}. Available hooks: {list(PROXY_HOOKS.keys())}

What it means

Error "Unknown hook: {hook_name}. Available hooks: {list(PROXY_HOOKS.keys())}" thrown in BerriAI/litellm.

Solutions

  1. Use one of the available hooks listed in the error message.
  2. Check the hook name for typos against PROXY_HOOKS keys.

When it happens

Trigger: Thrown at litellm/proxy/hooks/__init__.py:42 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/4c8ecb44e1091f6a. Report an issue: GitHub.

Appendix: source

Thrown at litellm/proxy/hooks/__init__.py:42

    "litellm_skills": SkillsInjectionHook,
    "max_iterations_limiter": _PROXY_MaxIterationsHandler,
    "max_budget_per_session_limiter": _PROXY_MaxBudgetPerSessionHandler,
    "sensitive_data_routing": _PROXY_SensitiveDataRoutingHandler,
}

## FEATURE FLAG HOOKS ##
if os.getenv("LEGACY_MULTI_INSTANCE_RATE_LIMITING", "false").lower() == "true":
    PROXY_HOOKS["parallel_request_limiter"] = _PROXY_MaxParallelRequestsHandler


def get_proxy_hook(
    hook_name: Literal["max_budget_limiter", "managed_files", "parallel_request_limiter", "cache_control_check"] | str,
):
    """
    Factory method to get a proxy hook instance by name
    """
    if hook_name not in PROXY_HOOKS:
        raise ValueError(f"Unknown hook: {hook_name}. Available hooks: {list(PROXY_HOOKS.keys())}")
    return PROXY_HOOKS[hook_name]


### CHECK IF ENTERPRISE HOOKS ARE AVAILABLE ####

try:
    from enterprise.enterprise_hooks import ENTERPRISE_PROXY_HOOKS
except ImportError:
    ENTERPRISE_PROXY_HOOKS = {}


### update PROXY_HOOKS with ENTERPRISE_PROXY_HOOKS ###

PROXY_HOOKS.update(ENTERPRISE_PROXY_HOOKS)

View on GitHub (pinned to 77b7c6c40c)