BerriAI/litellm · error · HTTPException

Invalid Langfuse host: {e}

Error message

Invalid Langfuse host: {e}

What it means

URL parse failure in _normalize_langfuse_base_url: httpx.URL rejected the configured Langfuse host (after auto-prefixing http:// for host-only values), and the parser's exception '{e}' is included. The value is structurally invalid as a URL — stray characters, bad brackets, or malformed IPv6, for example.

Source

Thrown at litellm/proxy/vertex_ai_endpoints/langfuse_endpoints.py:62

def _decode_to_convergence(value: str) -> str:
    previous = value
    while True:
        decoded = unquote(previous)
        if decoded == previous:
            return decoded
        previous = decoded


def _normalize_langfuse_base_url(base_target_url: str) -> str:
    if not (base_target_url.startswith("http://") or base_target_url.startswith("https://")):
        # Existing behavior allows host-only Langfuse settings.
        base_target_url = "http://" + base_target_url

    try:
        base_url: Final = httpx.URL(base_target_url)
    except Exception as e:
        raise HTTPException(
            status_code=status.HTTP_400_BAD_REQUEST,
            detail={"error": f"Invalid Langfuse host: {e}"},
        )

    if base_url.scheme not in ("http", "https") or not base_url.host:
        raise HTTPException(
            status_code=status.HTTP_400_BAD_REQUEST,
            detail={"error": "Invalid Langfuse host"},
        )

    if base_url.userinfo:
        raise HTTPException(
            status_code=status.HTTP_400_BAD_REQUEST,
            detail={"error": "Langfuse host must not include credentials"},
        )

    return str(base_url)

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Provide a valid http(s) Langfuse host URL without credentials or invalid characters.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at litellm/proxy/vertex_ai_endpoints/langfuse_endpoints.py:62 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/719a336115f4df96. Report an issue: GitHub.