BerriAI/litellm · error · ValueError

WANDB_PROJECT_ID must be set for Weave OpenTelemetry…

Error message

WANDB_PROJECT_ID must be set for Weave OpenTelemetry integration. Format: <entity>/<project_name>

What it means

Configuration guard for Weave OpenTelemetry: WANDB_PROJECT_ID is not set (or malformed). It must be '<entity>/<project_name>' so the exporter knows which W&B project to trace into.

Solutions

  1. Set WANDB_PROJECT_ID in the format <entity>/<project_name>.

Example fix

export WANDB_PROJECT_ID=myteam/my_project
Defensive patterns

Strategy: validation

When it happens

Trigger: Enabling Weave OpenTelemetry export without WANDB_PROJECT_ID set.

Common situations: Only WANDB_API_KEY set; project id omitted or in the wrong format.


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

Appendix: source

Thrown at litellm/integrations/weave/weave_otel.py:142

        WANDB_API_KEY: Required. W&B API key for authentication.
        WANDB_PROJECT_ID: Required. Project ID in format <entity>/<project_name>.
        WANDB_HOST: Optional. Custom Weave host URL. Defaults to cloud endpoint.

    Returns:
        WeaveOtelConfig: A Pydantic model containing Weave OTEL configuration.

    Raises:
        ValueError: If required environment variables are missing.
    """
    api_key: Final = os.getenv("WANDB_API_KEY")
    project_id: Final = os.getenv("WANDB_PROJECT_ID")
    host = os.getenv("WANDB_HOST")

    if not api_key:
        raise ValueError("WANDB_API_KEY must be set for Weave OpenTelemetry integration.")

    if not project_id:
        raise ValueError(
            "WANDB_PROJECT_ID must be set for Weave OpenTelemetry integration. Format: <entity>/<project_name>"
        )

    if host:
        if not host.startswith("http"):
            host = "https://" + host
        # Self-managed instances use a different path
        endpoint = host.rstrip("/") + WEAVE_OTEL_ENDPOINT
        verbose_logger.debug("Using Weave OTEL endpoint from host: %s", endpoint)
    else:
        endpoint = WEAVE_BASE_URL + WEAVE_OTEL_ENDPOINT
        verbose_logger.debug("Using Weave cloud endpoint: %s", endpoint)

    # Weave uses Basic auth with format: api:<WANDB_API_KEY>
    auth_header: Final = _get_weave_authorization_header(api_key=api_key)
    otlp_auth_headers: Final = f"Authorization={auth_header},project_id={project_id}"

    # Set standard OTEL environment variables

View on GitHub (pinned to 77b7c6c40c)