{"record":{"id":"3787d19f87d182b8","repo":"mlflow/mlflow","slug":"currently-mlflow-only-supports-the-following-engin","errorCode":null,"errorMessage":"Currently mlflow only supports the following engine types: {SUPPORTED_ENGINES}. {engine_type} is not supported, so please use one of the above types.","messagePattern":"Currently mlflow only supports the following engine types: (.+?)\\. (.+?) is not supported, so please use one of the above types\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mlflow/llama_index/model.py","lineNumber":83,"sourceCode":"        that, at a minimum, contains these requirements.\n    \"\"\"\n    return [_get_pinned_requirement(\"llama-index\")]\n\n\ndef get_default_conda_env():\n    \"\"\"\n    Returns:\n        The default Conda environment for MLflow Models produced by calls to\n        :func:`save_model()` and :func:`log_model()`.\n    \"\"\"\n    return _mlflow_conda_env(additional_pip_deps=get_default_pip_requirements())\n\n\ndef _validate_engine_type(engine_type: str):\n    from mlflow.llama_index.pyfunc_wrapper import SUPPORTED_ENGINES\n\n    if engine_type not in SUPPORTED_ENGINES:\n        raise ValueError(\n            f\"Currently mlflow only supports the following engine types: \"\n            f\"{SUPPORTED_ENGINES}. {engine_type} is not supported, so please \"\n            \"use one of the above types.\"\n        )\n\n\ndef _get_llama_index_version() -> str:\n    try:\n        import llama_index.core\n\n        return llama_index.core.__version__\n    except ImportError:\n        raise MlflowException(\n            \"The llama_index module is not installed. \"\n            \"Please install it via `pip install llama-index`.\"\n        )\n\n","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/llama_index/model.py#L65-L101","documentation":"When saving a LlamaIndex index via the legacy serialization path, MLflow validates the engine_type argument against SUPPORTED_ENGINES = {\"chat\", \"query\", \"retriever\"} (mlflow/llama_index/pyfunc_wrapper.py:14). Any other string raises ValueError. MLflow can only wrap and serve these three engine types at prediction time.","triggerScenarios":"Calling mlflow.llama_index.save_model(model=index, engine_type=\"<other>\") with an unsupported engine_type string such as \"node_postprocessor\", \"query_engine\", a typo like \"qurey\", or a custom engine name.","commonSituations":"Copy-pasting engine_type from LlamaIndex terminology rather than MLflow's supported set; typos or casing issues; trying to log a raw LLM or custom pipeline via the legacy path.","solutions":["Set engine_type to one of \"chat\", \"query\", or \"retriever\".","If you need another engine type, save the model in Model-from-Code mode (pass a script path) where engine_type constraints differ.","Check the value for typos/case — the set match is exact.","Upgrade MLflow if a newer engine type may have been added to SUPPORTED_ENGINES."],"exampleFix":"// before\nmlflow.llama_index.save_model(index, name=\"model\", engine_type=\"query_engine\")\n// after\nmlflow.llama_index.save_model(index, name=\"model\", engine_type=\"query\")","handlingStrategy":"validation","validationCode":"from mlflow.llama_index.pyfunc_wrapper import SUPPORTED_ENGINES\n\nif engine_type not in SUPPORTED_ENGINES:\n    raise ValueError(f\"engine_type must be one of {SUPPORTED_ENGINES}, got {engine_type!r}\")","typeGuard":"from typing import Literal\nEngineType = Literal[\"chat\", \"query\", \"retriever\"]\n\ndef is_valid_engine_type(t: str) -> bool:\n    return t in {\"chat\", \"query\", \"retriever\"}","tryCatchPattern":"try:\n    mlflow.llama_index.save_model(index, name=\"model\", engine_type=engine_type)\nexcept ValueError as e:\n    if \"not supported\" in str(e):\n        mlflow.llama_index.save_model(index, name=\"model\", engine_type=\"query\")\n    else:\n        raise","preventionTips":["Use a Literal/enum type for engine_type in your code so typos fail at type-check time","Import SUPPORTED_ENGINES and validate against it rather than hardcoding strings","Verify exact lowercase spelling: chat, query, retriever"],"tags":["llama-index","engine-type","invalid-parameter","model-saving"],"backgroundTag":"unsupported-engine-type","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}