{"record":{"id":"47a9a413e83975e2","repo":"mlflow/mlflow","slug":"unknown-gateway-vendor-vendor-r","errorCode":null,"errorMessage":"Unknown Gateway vendor: {vendor!r}","messagePattern":"Unknown Gateway vendor: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mlflow/assistant/gateway_connection.py","lineNumber":24,"sourceCode":"from mlflow.tracking._tracking_service.utils import _get_store\n\n_GATEWAY_VENDOR_MODELS = {\n    \"openai\": \"gpt-5.5\",\n    \"anthropic\": \"claude-sonnet-5\",\n    \"gemini\": \"gemini-3-pro\",\n}\n\n_NOT_FOUND = ErrorCode.Name(RESOURCE_DOES_NOT_EXIST)\n\n\nclass GatewayUnsupportedError(Exception):\n    \"\"\"Raised when the tracking store has no AI Gateway support.\"\"\"\n\n\ndef ensure_gateway_connection(vendor: str, api_key: str) -> str:\n    \"\"\"Create or rotate the Gateway resources for an Assistant vendor key.\"\"\"\n    if (model_name := _GATEWAY_VENDOR_MODELS.get(vendor)) is None:\n        raise ValueError(f\"Unknown Gateway vendor: {vendor!r}\")\n\n    name = f\"mlflow-assistant-{vendor}\"\n    store = _get_store()\n\n    try:\n        try:\n            secret = store.get_secret_info(secret_name=name)\n        except MlflowException as e:\n            if e.error_code != _NOT_FOUND:\n                raise\n            secret = store.create_gateway_secret(\n                secret_name=name,\n                secret_value={\"api_key\": api_key},\n                provider=vendor,\n            )\n        else:\n            store.update_gateway_secret(\n                secret_id=secret.secret_id,","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/assistant/gateway_connection.py#L6-L42","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nensure_gateway_connection(\"Anthropic \", key)\n// after\nensure_gateway_connection(\"anthropic\", key)","handlingStrategy":"validation","validationCode":"from mlflow.assistant.gateway_connection import _GATEWAY_VENDOR_MODELS\nassert vendor in _GATEWAY_VENDOR_MODELS, f\"Unsupported vendor: {vendor!r}\"","typeGuard":"def is_supported_vendor(vendor):\n    return vendor in _GATEWAY_VENDOR_MODELS","tryCatchPattern":"try:\n    ensure_gateway_connection(vendor, api_key)\nexcept ValueError as e:\n    if \"Unknown Gateway vendor\" in str(e):\n        raise SystemExit(f\"{e}. Supported: {sorted(_GATEWAY_VENDOR_MODELS)}\")\n    raise","preventionTips":["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."],"tags":["assistant","gateway","configuration","invalid-value"],"backgroundTag":"invalid-enum-value","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}