BerriAI/litellm · error · ValueError

image variation provider has no known model info config -…

Error message

image variation provider has no known model info config - required for getting api keys, etc.: {custom_llm_provider}. Supported providers are: {LITELLM_IMAGE_VARIATION_PROVIDERS}

What it means

After the provider passes the LITELLM_IMAGE_VARIATION_PROVIDERS enum check, litellm looks up its provider/model info via ProviderConfigManager.get_provider_model_info; this is what supplies get_api_key/get_api_base defaults. A None result means the provider is nominally supported for variations but your installed litellm has no model-info registry entry for that provider/model pair, so credentials cannot be resolved.

Solutions

  1. Upgrade litellm to the latest release so the variation provider's model info is registered.
  2. Pass a well-known model for the provider (e.g. 'dall-e-2' for openai) so the registry hit is guaranteed.
  3. Pre-flight check: ProviderConfigManager.get_provider_model_info(model, LlmProviders(provider)) must return non-None before you call image_variation.
  4. If it still fails on latest, file a litellm GitHub issue — the registry is missing an entry for that provider.

Example fix

# before
resp = litellm.image_variation(model="topaz/unknown-model", image=img)
# ValueError: image variation provider has no known model info config ...

# after
pip install -U litellm
resp = litellm.image_variation(model="dall-e-2", image=img)
Defensive patterns

Strategy: validation

Validate before calling

from litellm.utils import ProviderConfigManager
from litellm import LlmProviders

info = ProviderConfigManager.get_provider_model_info(model="dall-e-2", provider=LlmProviders.OPENAI)
if info is None:
    raise RuntimeError("installed litellm lacks model info for this variation provider; upgrade litellm")

Try / catch

try:
    resp = litellm.image_variation(model=model, image=img)
except ValueError as e:
    if "no known model info config" in str(e):
        raise RuntimeError(f"litellm registry gap for {model}; upgrade litellm or use dall-e-2") from e
    raise

Prevention

When it happens

Trigger: Using topaz (or openai) image variations on a litellm build where the provider's model-info config is not yet registered; passing an exotic/misspelled model under a supported provider so the registry lookup misses; mixing a new enum value (provider passes step 1) with an older registry.

Common situations: Version skew: enum members and config registry land in different litellm releases; pinning litellm to an old version while following new docs; typos in model names that skip the registry's known models.

Related errors


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

Appendix: source

Thrown at litellm/images/main.py:651

    # route to the correct provider w/ the params
    try:
        llm_provider: Final = LlmProviders(custom_llm_provider)
        image_variation_provider: Final = LITELLM_IMAGE_VARIATION_PROVIDERS(llm_provider)
    except ValueError:
        raise ValueError(
            f"Invalid image variation provider: {custom_llm_provider}. Supported providers are: {LITELLM_IMAGE_VARIATION_PROVIDERS}"
        )
    model_response: Final = ImageResponse()

    response: ImageResponse | None = None

    provider_config: Final = ProviderConfigManager.get_provider_model_info(
        model=model or "",  # openai defaults to dall-e-2
        provider=llm_provider,
    )

    if provider_config is None:
        raise ValueError(
            f"image variation provider has no known model info config - required for getting api keys, etc.: {custom_llm_provider}. Supported providers are: {LITELLM_IMAGE_VARIATION_PROVIDERS}"
        )

    api_key: Final = provider_config.get_api_key(litellm_params.get("api_key", None))
    api_base = provider_config.get_api_base(litellm_params.get("api_base", None))

    if image_variation_provider == LITELLM_IMAGE_VARIATION_PROVIDERS.OPENAI:
        if api_key is None:
            raise ValueError("API key is required for OpenAI image variations")
        if api_base is None:
            raise ValueError("API base is required for OpenAI image variations")

        response = openai_image_variations.image_variations(
            model_response=model_response,
            api_key=api_key,
            api_base=api_base,
            model=model,
            image=image,

View on GitHub (pinned to 77b7c6c40c)