{"record":{"id":"63f4446b8e59c8d4","repo":"mlflow/mlflow","slug":"bad-request-63f444","errorCode":"BAD_REQUEST","errorMessage":"No suitable adapter found for model_uri='{model_uri}'.","messagePattern":"No suitable adapter found for model_uri='(.+?)'\\.","errorType":"exception","errorClass":"MlflowException","httpStatus":null,"severity":"error","filePath":"mlflow/genai/judges/adapters/utils.py","lineNumber":63,"sourceCode":"    # Importing mlflow.metrics.genai.model_utils triggers mlflow.metrics.__init__\n    # → mlflow.metrics.genai → genai_metric → pandas, breaking the skinny client.\n    from mlflow.genai.judges.adapters.databricks_managed_judge_adapter import (\n        DatabricksManagedJudgeAdapter,\n    )\n    from mlflow.genai.judges.adapters.gateway_adapter import GatewayAdapter\n    from mlflow.genai.judges.adapters.litellm_adapter import LiteLLMAdapter\n\n    adapters = [\n        DatabricksManagedJudgeAdapter,\n        GatewayAdapter,\n        LiteLLMAdapter,\n    ]\n\n    for adapter_class in adapters:\n        if adapter_class.is_applicable(model_uri=model_uri, prompt=prompt):\n            return adapter_class()\n\n    raise MlflowException(\n        f\"No suitable adapter found for model_uri='{model_uri}'.\",\n        error_code=BAD_REQUEST,\n    )\n\n\n# ---------------------------------------------------------------------------\n# Shared HTTP / error handling\n# ---------------------------------------------------------------------------\n\n\nclass ChatCompletionError(Exception):\n    def __init__(self, status_code: int, message: str, is_context_window_error: bool = False):\n        self.status_code = status_code\n        self.message = message\n        self.is_context_window_error = is_context_window_error\n        super().__init__(message)\n\n","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/genai/judges/adapters/utils.py#L45-L81","documentation":"get_adapter is the judge adapter factory: it tries DatabricksManagedJudgeAdapter, GatewayAdapter, and LiteLLMAdapter in order, each via is_applicable(model_uri, prompt). If none matches the given model_uri/prompt combination, it raises BAD_REQUEST 'No suitable adapter found'. This means the model_uri isn't recognized as a Databricks judge, a gateway route, or a litellm-supported provider URI.","triggerScenarios":"Passing a model_uri with an unknown or missing scheme (e.g. 'my-model', 'foo:/bar', or a bare deployment name) to judge invocation APIs (invoke_judge_model and higher-level judges), where it matches none of the adapters' is_applicable checks.","commonSituations":"Typos in URI prefix ('openai//gpt-4', missing ':'); using a local model path or HuggingFace id where a provider-prefixed URI is required; pointing at a gateway route name that isn't registered so GatewayAdapter doesn't apply; older MLflow code paths passing legacy model URIs no longer supported.","solutions":["Use a recognized judge model_uri format: 'databricks', a gateway route ('routes:/<name>' style), or a litellm provider URI like 'openai:/gpt-4o'.","Check for typos in the URI scheme (prefix and ':/' separator).","If intending a gateway judge, confirm the route exists/registered in the MLflow gateway so GatewayAdapter.is_applicable matches.","Upgrade/verify MLflow version if using a legacy model URI format that current adapters no longer accept."],"exampleFix":"// before\ninvoke_judge_model(model_uri=\"gpt-4o\", ...)\n\n// after\ninvoke_judge_model(model_uri=\"openai:/gpt-4o\", ...)","handlingStrategy":"validation","validationCode":"KNOWN_SCHEMES = {\"databricks\", \"endpoints\", \"routes\", \"openai\", \"anthropic\", \"azure\", \"bedrock\", \"vertex_ai\", \"ollama\"}\n\ndef validate_judge_model_uri(model_uri: str) -> str:\n    scheme = model_uri.split(\":\", 1)[0].lower()\n    if scheme not in KNOWN_SCHEMES:\n        raise ValueError(f\"Unsupported judge model_uri scheme '{scheme}': use e.g. 'openai:/gpt-4o', 'databricks', or a gateway route\")\n    return model_uri","typeGuard":null,"tryCatchPattern":"from mlflow.exceptions import MlflowException\n\ntry:\n    feedback = invoke_judge_model(model_uri=uri, ...)\nexcept MlflowException as e:\n    if \"No suitable adapter found\" in str(e):\n        raise ValueError(f\"Bad judge model_uri '{uri}'. Use 'openai:/<model>', 'databricks', or a registered gateway route.\") from e\n    raise","preventionTips":["Always use provider-prefixed URIs ('openai:/gpt-4o') for litellm judges","Register gateway routes before referencing them","Centralize judge model URIs in config validated at startup","Spell-check URI schemes; missing ':' or '/' typos are common"],"tags":["configuration","adapter","judge","model-uri"],"backgroundTag":"unsupported-model-uri","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}