class_docstr: CLI describes a command line interface for interacting with igel, there
  are several different functions that can be performed.
class_docstr_tok: ["CLI","describes","a","command","line","interface","for","interacting","with","igel",",","there","are","several","different","functions","that","can","be","performed","."]
docstr: expose a REST endpoint in order to use the trained ML model
docstr_tok: ["expose","a","REST","endpoint","in","order","to","use","the","trained","ML","model"]
code: def serve(self):
      """
      expose a REST endpoint in order to use the trained ML model
      """
      try:
          os.environ[Constants.model_results_path] = self.dict_args[
              "model_results_dir"
          ]
          uvicorn_params = {}
          if "host" in self.dict_args and "port" in self.dict_args:
              uvicorn_params["host"] = self.dict_args.get("host")
              uvicorn_params["port"] = int(self.dict_args.get("port"))
  
          fastapi_server.run(**uvicorn_params)
  
      except Exception as ex:
          logger.exception(ex)
  
imports: import argparse
  import logging
  import os
  import subprocess
  import sys
  from pathlib import Path
  import igel
  import pandas
  from igel import Igel, metrics_dict, models_dict
  from igel.constants import Constants
  from igel.servers import fastapi_server
label_desc: Use image node_id 17 for calling the CLI obj's underlying member method code with example usage: obj.serve() without return types