code: def serve(
      model_uri,
      port,
      host,
      timeout,
      workers,
      env_manager=None,
      no_conda=False,
      install_mlflow=False,
      enable_mlserver=False,
  ):
      """
      Serve a model saved with MLflow by launching a webserver on the specified host and port.
      The command supports models with the ``python_function`` or ``crate`` (R Function) flavor.
      For information about the input data formats accepted by the webserver, see the following
      documentation: https://www.mlflow.org/docs/latest/models.html#built-in-deployment-tools.
  
      .. warning::
  
          Models built using MLflow 1.x will require adjustments to the endpoint request payload
          if executed in an environment that has MLflow 2.x installed. In 1.x, a request payload
          was in the format: ``{'columns': [str], 'data': [[...]]}``. 2.x models require
          payloads that are defined by the structural-defining keys of either ``dataframe_split``,
          ``instances``, ``inputs`` or ``dataframe_records``. See the examples below for
          demonstrations of the changes to the invocation API endpoint in 2.0.
  
      .. note::
  
          Requests made in pandas DataFrame structures can be made in either `split` or `records`
          oriented formats.
          See https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_json.html for
          detailed information on orientation formats for converting a pandas DataFrame to json.
  
      Example:
  
      .. code-block:: bash
  
          $ mlflow models serve -m runs:/my-run-id/model-path &
  
          # records orientation input format for serializing a pandas DataFrame
          $ curl http://127.0.0.1:5000/invocations -H 'Content-Type: application/json' -d '{
              "dataframe_records": [{"a":1, "b":2}, {"a":3, "b":4}, {"a":5, "b":6}]
          }'
  
          # split orientation input format for serializing a pandas DataFrame
          $ curl http://127.0.0.1:5000/invocations -H 'Content-Type: application/json' -d '{
              "dataframe_split": {"columns": ["a", "b"],
                                  "index": [0, 1, 2],
                                  "data": [[1, 2], [3, 4], [5, 6]]}
          }'
  
          # inputs format for List submission of array, tensor, or DataFrame data
          $ curl http://127.0.0.1:5000/invocations -H 'Content-Type: application/json' -d '{
              "inputs": [[1, 2], [3, 4], [5, 6]]
          }'
  
          # instances format for submission of Tensor data
          curl http://127.0.0.1:5000/invocations -H 'Content-Type: application/json' -d '{
              "instances": [
                  {"a": "t1", "b": [1, 2, 3]},
                  {"a": "t2", "b": [4, 5, 6]},
                  {"a": "t3", "b": [7, 8, 9]}
              ]
          }'
  
      """
      env_manager = _EnvManager.LOCAL if no_conda else env_manager
  
      return get_flavor_backend(
          model_uri,
          env_manager=env_manager,
          workers=workers,
          install_mlflow=install_mlflow,
      ).serve(
          model_uri=model_uri,
          port=port,
          host=host,
          timeout=timeout,
          enable_mlserver=enable_mlserver,
      )
  
file_path: mlflow/mlflow/models/cli.py
imports: import logging
  import click
  from mlflow.models import python_api
  from mlflow.models.flavor_backend_registry import get_flavor_backend
  from mlflow.utils import cli_args
  from mlflow.utils import env_manager
label_desc: Use image node_id 2 for calling a global function with example usage: serve(model_uri, port, host, timeout, workers, env_manager, no_conda, install_mlflow, enable_mlserver) and returns: get_flavor_backend