BerriAI/litellm · error · ValueError

MAVVRIK_FOCUS_FREQUENCY=

Error message

MAVVRIK_FOCUS_FREQUENCY='{frequency}' is not supported. Only 'daily' is allowed -- the Mavvrik ingestion protocol stores one file per calendar date (metrics/YYYY-MM-DD). Hourly or interval exports would overwrite each other within the same day.

What it means

MavvrikFocusLogger (a FOCUS-format cost export callback) reads MAVVRIK_FOCUS_FREQUENCY and only accepts 'daily' (case-insensitive; it is lowercased before comparison). Anything else raises ValueError at construction with an explanation: the Mavvrik ingestion protocol stores exactly one file per calendar date under metrics/YYYY-MM-DD, so hourly or interval exports would silently overwrite each other within the same day.

Solutions

  1. Remove MAVVRIK_FOCUS_FREQUENCY entirely — the default is already 'daily' and is the only supported value
  2. Or explicitly set it correctly: export MAVVRIK_FOCUS_FREQUENCY=daily
  3. If you genuinely need sub-daily exports, that is not supported by the Mavvrik destination; file a feature request rather than working around the validation

Example fix

# before
MAVVRIK_FOCUS_FREQUENCY=hourly
# after (or just delete the line — 'daily' is the default)
MAVVRIK_FOCUS_FREQUENCY=daily
Defensive patterns

Strategy: validation

Validate before calling

import os

freq = os.getenv('MAVVRIK_FOCUS_FREQUENCY', 'daily').lower()
if freq != 'daily':
    raise SystemExit(
        f"MAVVRIK_FOCUS_FREQUENCY={freq!r} unsupported; only 'daily' is valid "
        '(Mavvrik stores one file per calendar date)'
    )

Try / catch

try:
    logger = MavvrikFocusLogger()
except ValueError as e:
    # config bug, not transient: fix the env value, do not retry
    raise RuntimeError(f'Mavvrik FOCUS export misconfigured: {e}') from e

Prevention

When it happens

Trigger: Setting MAVVRIK_FOCUS_FREQUENCY to any value other than 'daily' (e.g. MAVVRIK_FOCUS_FREQUENCY=hourly, 'weekly', '1h', or even 'Daily ' with odd casing is fine after .lower() but 'DAILY-ish' is not) and then enabling the mavvrik FOCUS export callback, which instantiates MavvrikFocusLogger at startup.

Common situations: Operators templating a generic FREQUENCY env var across integrations (e.g. a shared 'hourly' export cadence) that leaks into the Mavvrik-specific variable; copy-pasting example config from another exporter that supports hourly; attempting sub-daily cost granularity without knowing Mavvrik's one-file-per-day protocol; leaving a placeholder value like 'CHANGEME' in the env.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at litellm/integrations/mavvrik_focus/mavvrik_focus_logger.py:89


def _is_empty_metrics_marker(marker: object | None) -> bool:
    if marker is None:
        return True
    if isinstance(marker, (int, float)):
        return marker == 0
    if isinstance(marker, str):
        return not marker.strip()
    return False


class MavvrikFocusLogger(FocusLogger):
    """FOCUS-based export logger that routes to the Mavvrik destination."""

    def __init__(self, **kwargs: Any) -> None:
        frequency: Final = os.getenv("MAVVRIK_FOCUS_FREQUENCY", "daily").lower()
        if frequency != "daily":
            raise ValueError(
                f"MAVVRIK_FOCUS_FREQUENCY='{frequency}' is not supported. "
                "Only 'daily' is allowed -- the Mavvrik ingestion protocol stores one "
                "file per calendar date (metrics/YYYY-MM-DD). Hourly or interval "
                "exports would overwrite each other within the same day."
            )
        super().__init__(
            provider="mavvrik",
            export_format="csv",
            frequency="daily",
            prefix="mavvrik_focus_exports",
            destination_config={
                "api_key": os.getenv("MAVVRIK_API_KEY"),
                "api_endpoint": os.getenv("MAVVRIK_API_ENDPOINT"),
                "connection_id": os.getenv("MAVVRIK_CONNECTION_ID"),
            },
            **kwargs,
        )
        raw: Final = os.getenv("MAVVRIK_FOCUS_MAX_ROWS")

View on GitHub (pinned to 77b7c6c40c)