mlflow/mlflow · error · ValueError
Unknown Gateway vendor: {vendor!r}
Error message
Unknown Gateway vendor: {vendor!r} What it means
ensure_gateway_connection(vendor, api_key) looks up the vendor in _GATEWAY_VENDOR_MODELS to find the Gateway model definition for the Assistant's LLM connection. If the vendor string is not a registered key, it raises ValueError 'Unknown Gateway vendor: ...'. Only vendors with an explicit mapping are supported.
Source
Thrown at mlflow/assistant/gateway_connection.py:24
from mlflow.tracking._tracking_service.utils import _get_store
_GATEWAY_VENDOR_MODELS = {
"openai": "gpt-5.5",
"anthropic": "claude-sonnet-5",
"gemini": "gemini-3-pro",
}
_NOT_FOUND = ErrorCode.Name(RESOURCE_DOES_NOT_EXIST)
class GatewayUnsupportedError(Exception):
"""Raised when the tracking store has no AI Gateway support."""
def ensure_gateway_connection(vendor: str, api_key: str) -> str:
"""Create or rotate the Gateway resources for an Assistant vendor key."""
if (model_name := _GATEWAY_VENDOR_MODELS.get(vendor)) is None:
raise ValueError(f"Unknown Gateway vendor: {vendor!r}")
name = f"mlflow-assistant-{vendor}"
store = _get_store()
try:
try:
secret = store.get_secret_info(secret_name=name)
except MlflowException as e:
if e.error_code != _NOT_FOUND:
raise
secret = store.create_gateway_secret(
secret_name=name,
secret_value={"api_key": api_key},
provider=vendor,
)
else:
store.update_gateway_secret(
secret_id=secret.secret_id,View on GitHub (pinned to 6a27f2decc)
Solutions
- Check the exact supported vendor strings in _GATEWAY_VENDOR_MODELS in mlflow/assistant/gateway_connection.py and use one verbatim.
- Fix casing/typos/whitespace in the vendor value in your config or CLI argument.
- Upgrade MLflow if the vendor is supported only in newer releases.
Example fix
// before
ensure_gateway_connection("Anthropic ", key)
// after
ensure_gateway_connection("anthropic", key) Defensive patterns
Strategy: validation
Validate before calling
from mlflow.assistant.gateway_connection import _GATEWAY_VENDOR_MODELS
assert vendor in _GATEWAY_VENDOR_MODELS, f"Unsupported vendor: {vendor!r}" Type guard
def is_supported_vendor(vendor):
return vendor in _GATEWAY_VENDOR_MODELS Try / catch
try:
ensure_gateway_connection(vendor, api_key)
except ValueError as e:
if "Unknown Gateway vendor" in str(e):
raise SystemExit(f"{e}. Supported: {sorted(_GATEWAY_VENDOR_MODELS)}")
raise Prevention
- Copy vendor names exactly from the supported list (check casing/whitespace).
- Centralize vendor constants instead of free-form strings in configs.
- Upgrade MLflow if you need a vendor added in newer releases.
When it happens
Trigger: Calling ensure_gateway_connection (directly or via _store_gateway_api_key, e.g. `mlflow assistant` key setup) with a vendor name not in _GATEWAY_VENDOR_MODELS — typos ('anthropic ' with whitespace, 'Anthropic' casing mismatch) or a genuinely unsupported vendor.
Common situations: Config file naming a provider that this MLflow version's Assistant doesn't support; case/whitespace mistakes in vendor string; using a vendor added in a newer MLflow release than the installed one.
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
- project_path is required for 'project' skills location
- custom_path is required for 'custom' skills location
- This MLflow server's tracking backend does not support the A
- Provider configuration not found for {name}
- {self._display_name} is not configured. {self._connection_hi
AI-assisted analysis of mlflow/mlflow@6a27f2decc (2026-08-29).
Data as JSON: /api/errors/47a9a413e83975e2.
Report an issue: GitHub.