apache/seatunnel · error · ValueError

Unknown AI provider '{name}'. Available: {available}

Error message

Unknown AI provider '{name}'. Available: {available}

What it means

After lowercasing and trimming the requested provider name, create_provider() looks it up in the _PROVIDERS registry. A ValueError naming the unknown provider and listing the available ones is raised when the name is not a registered key.

Source

Thrown at seatunnel-cli/seatunnel_cli/llm_provider.py:1458

    # 4. Auto-detect
    if not name:
        name = _auto_detect_provider()

    if not name:
        raise ValueError(
            f"No AI provider configured. Set up with one of:\n"
            f"  1. Run: seatunnel --init              (interactive setup)\n"
            f"  2. Set: export AI_PROVIDER=<{available}>\n"
            f"  3. Set provider credentials:\n"
            f"     - Anthropic: export ANTHROPIC_API_KEY=sk-ant-...\n"
            f"     - OpenAI:    export OPENAI_API_KEY=sk-...\n"
            f"     - Bedrock:   configure AWS credentials (aws configure)"
        )

    name = name.lower().strip()
    cls = _PROVIDERS.get(name)
    if cls is None:
        raise ValueError(f"Unknown AI provider '{name}'. Available: {available}")
    return cls()

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Use one of the listed available providers exactly as printed in the error
  2. Check AI_PROVIDER for typos and set it to a supported value (e.g. anthropic, openai, bedrock, orcarouter)
  3. Upgrade the CLI if the provider you need was added in a newer version

Example fix

// before
export AI_PROVIDER=gemini
// after
export AI_PROVIDER=openai
Defensive patterns

Strategy: validation

Validate before calling

VALID = {"anthropic", "openai", "bedrock", "orcarouter"}
name = os.environ.get("AI_PROVIDER", "").lower().strip()
assert not name or name in VALID, f"AI_PROVIDER must be one of {sorted(VALID)}"

Try / catch

try:
    provider = create_provider(name)
except ValueError as e:
    if str(e).startswith("Unknown AI provider"):
        print(f"Choose from: {e.split('Available: ')[-1]}")
    else:
        raise

Prevention

When it happens

Trigger: Calling create_provider(name) (or setting AI_PROVIDER) with a string not present in _PROVIDERS — e.g. a typo like "anthropic-api", an unsupported provider like "gemini", or wrong casing handled upstream of the registry lookup.

Common situations: Typos in AI_PROVIDER values; docs or blog posts referencing providers this CLI version doesn't ship; stale config files naming a provider removed in an upgrade.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/1e5326fde53755ea. Report an issue: GitHub.