mlflow/mlflow · error
Currently mlflow only supports the following engine types: {
Error message
Currently mlflow only supports the following engine types: {SUPPORTED_ENGINES}. {engine_type} is not supported, so please use one of the above types. What it means
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.
Source
Thrown at mlflow/llama_index/model.py:83
that, at a minimum, contains these requirements.
"""
return [_get_pinned_requirement("llama-index")]
def get_default_conda_env():
"""
Returns:
The default Conda environment for MLflow Models produced by calls to
:func:`save_model()` and :func:`log_model()`.
"""
return _mlflow_conda_env(additional_pip_deps=get_default_pip_requirements())
def _validate_engine_type(engine_type: str):
from mlflow.llama_index.pyfunc_wrapper import SUPPORTED_ENGINES
if engine_type not in SUPPORTED_ENGINES:
raise ValueError(
f"Currently mlflow only supports the following engine types: "
f"{SUPPORTED_ENGINES}. {engine_type} is not supported, so please "
"use one of the above types."
)
def _get_llama_index_version() -> str:
try:
import llama_index.core
return llama_index.core.__version__
except ImportError:
raise MlflowException(
"The llama_index module is not installed. "
"Please install it via `pip install llama-index`."
)
View on GitHub (pinned to 6a27f2decc)
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.
Example fix
// before mlflow.llama_index.save_model(index, name="model", engine_type="query_engine") // after mlflow.llama_index.save_model(index, name="model", engine_type="query")
Defensive patterns
Strategy: validation
Validate before calling
from mlflow.llama_index.pyfunc_wrapper import SUPPORTED_ENGINES
if engine_type not in SUPPORTED_ENGINES:
raise ValueError(f"engine_type must be one of {SUPPORTED_ENGINES}, got {engine_type!r}") Type guard
from typing import Literal
EngineType = Literal["chat", "query", "retriever"]
def is_valid_engine_type(t: str) -> bool:
return t in {"chat", "query", "retriever"} Try / catch
try:
mlflow.llama_index.save_model(index, name="model", engine_type=engine_type)
except ValueError as e:
if "not supported" in str(e):
mlflow.llama_index.save_model(index, name="model", engine_type="query")
else:
raise Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- INVALID_PARAMETER_VALUE
- Unsupported engine type: {engine_type}. It must be one of {S
- Message must be either a dict or a Message object, but got:
- Invalid content type. Must be either a string or a list, but
- INVALID_PARAMETER_VALUE
AI-assisted analysis of mlflow/mlflow@6a27f2decc (2026-08-29).
Data as JSON: /api/errors/3787d19f87d182b8.
Report an issue: GitHub.