BerriAI/litellm · error · NotImplementedError

Provider ' ' not supported for Focus export

Error message

Provider '{provider}' not supported for Focus export

What it means

FocusDestinationFactory.create lowercases the provider string and dispatches to exactly four implementations — s3, vantage, gcs, mavvrik. Any other value falls through every if-branch and raises NotImplementedError with the provider echoed back. Case is normalized, but surrounding whitespace and typos are not.

Solutions

  1. Use one of: 's3', 'vantage', 'gcs', 'mavvrik' (any case)
  2. Strip and normalize input before calling: provider.strip().lower()
  3. Validate provider against the supported set at config-load time and fail early
  4. For a custom destination, implement a FocusDestination subclass and construct it directly instead of via the factory

Example fix

# before
dest = FocusDestinationFactory.create(provider='azure', prefix='focus/')

# after
provider = 'azure '
SUPPORTED = {'s3', 'vantage', 'gcs', 'mavvrik'}
provider = provider.strip().lower()
if provider not in SUPPORTED:
    raise ValueError(f'unsupported Focus provider {provider!r}; choose from {sorted(SUPPORTED)}')
dest = FocusDestinationFactory.create(provider=provider, prefix='focus/')
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED_FOCUS_PROVIDERS = {'s3', 'vantage', 'gcs', 'mavvrik'}
provider = (provider or '').strip().lower()
if provider not in SUPPORTED_FOCUS_PROVIDERS:
    raise ValueError(
        f'unsupported Focus provider {provider!r}; choose from {sorted(SUPPORTED_FOCUS_PROVIDERS)}'
    )
dest = FocusDestinationFactory.create(provider=provider, prefix='focus/')

Type guard

def is_supported_focus_provider(provider: str) -> bool:
    return (provider or '').strip().lower() in {'s3', 'vantage', 'gcs', 'mavvrik'}

Try / catch

try:
    dest = FocusDestinationFactory.create(provider=provider, prefix='focus/')
except NotImplementedError as e:
    raise ValueError(f'config error: {e}') from e  # surface as config problem, not code gap

Prevention

When it happens

Trigger: FocusDestinationFactory.create(provider='azure', ...) or provider='wasabi'; a trailing space ('s3 ') that lower() does not strip; a value read from config/env with a typo like 'gc'; a provider name from a newer/older version mismatch.

Common situations: Config files copied from other tooling with different provider names; user-facing settings that accept free-text provider; adding a new destination type in a fork while the factory only knows the four.

Related errors


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

Appendix: source

Thrown at litellm/integrations/focus/destinations/factory.py:36

    @staticmethod
    def create(
        *,
        provider: str,
        prefix: str,
        config: dict[str, Any] | None = None,
    ) -> FocusDestination:
        """Return a destination implementation for the requested provider."""
        provider_lower: Final = provider.lower()
        normalized_config = FocusDestinationFactory._resolve_config(provider=provider_lower, overrides=config or {})
        if provider_lower == "s3":
            return FocusS3Destination(prefix=prefix, config=normalized_config)
        if provider_lower == "vantage":
            return FocusVantageDestination(prefix=prefix, config=normalized_config)
        if provider_lower == "gcs":
            return FocusGCSDestination(prefix=prefix, config=normalized_config)
        if provider_lower == "mavvrik":
            return FocusMavvrikDestination(prefix=prefix, config=normalized_config)
        raise NotImplementedError(f"Provider '{provider}' not supported for Focus export")

    @staticmethod
    def _resolve_config(
        *,
        provider: str,
        overrides: dict[str, Any],
    ) -> dict[str, Any]:
        if provider == "s3":
            resolved = {
                "bucket_name": overrides.get("bucket_name") or os.getenv("FOCUS_S3_BUCKET_NAME"),
                "region_name": overrides.get("region_name") or os.getenv("FOCUS_S3_REGION_NAME"),
                "endpoint_url": overrides.get("endpoint_url") or os.getenv("FOCUS_S3_ENDPOINT_URL"),
                "aws_access_key_id": overrides.get("aws_access_key_id") or os.getenv("FOCUS_S3_ACCESS_KEY"),
                "aws_secret_access_key": overrides.get("aws_secret_access_key") or os.getenv("FOCUS_S3_SECRET_KEY"),
                "aws_session_token": overrides.get("aws_session_token") or os.getenv("FOCUS_S3_SESSION_TOKEN"),
            }
            if not resolved.get("bucket_name"):
                raise ValueError("FOCUS_S3_BUCKET_NAME must be provided for S3 exports")

View on GitHub (pinned to 77b7c6c40c)