BerriAI/litellm · error · HTTPException

Not Found

Error message

Not Found

What it means

Error "Not Found" thrown in BerriAI/litellm.

Solutions

  1. Verify the requested health endpoint path and resource identifier.
  2. Check that the resource exists (e.g. correct model or key alias).

When it happens

Trigger: Thrown at litellm/proxy/health_endpoints/_health_endpoints.py:1714 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/f9a110f50cf2c92b. Report an issue: GitHub.

Appendix: source

Thrown at litellm/proxy/health_endpoints/_health_endpoints.py:1714

    from service) and blocks until the in-flight request counter drains to
    zero or ``GRACEFUL_SHUTDOWN_TIMEOUT`` elapses. Unlike a fixed ``sleep``,
    this returns as soon as real in-flight work is done.

    Wire it up as:

    ```yaml
    lifecycle:
      preStop:
        httpGet:
          path: /health/drain
          port: 4000
          httpHeaders:
            - name: X-Drain-Token
              value: <same value as drain_endpoint_token>
    ```
    """
    if not _drain_endpoint_enabled():
        raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Not Found")
    _authorize_drain_request(request)
    GracefulShutdownManager.start_shutdown()
    drained: Final = await GracefulShutdownManager.wait_for_drain(exclude_self=True)
    return {"status": "drained", "drained_requests": drained}


@router.get(
    "/health/liveliness",  # Historical LiteLLM name; doesn't match k8s terminology but kept for backwards compatibility
    tags=["health"],
)
@router.get(
    "/health/liveness",  # Kubernetes has "liveness" probes (https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-command)
    tags=["health"],
)
async def health_liveliness(response: Response):
    """
    Unprotected endpoint for checking if worker is alive.

View on GitHub (pinned to 77b7c6c40c)