code: def start_model_server(
      model_config: Path,
      https: Optional[bool] = None,
      ssl_key: Optional[str] = None,
      ssl_cert: Optional[str] = None,
      port: Optional[int] = None,
  ) -> None:
      server_params = get_server_params(model_config)
  
      host = server_params["host"]
      port = port or server_params["port"]
      model_endpoint = server_params["model_endpoint"]
      model_args_names = server_params["model_args_names"]
  
      ssl_config = get_ssl_params(
          server_params, https, ssl_key=ssl_key, ssl_cert=ssl_cert
      )
  
      model = build_model(model_config)
  
      def batch_decorator(cls: ModelMetaclass) -> ModelMetaclass:
          cls.__annotations__ = {
              arg_name: list for arg_name in model_args_names
          }
          cls.__fields__ = {
              arg_name: ModelField(
                  name=arg_name,
                  type_=list,
                  class_validators=None,
                  model_config=BaseConfig,
                  required=False,
                  field_info=Field(None),
              )
              for arg_name in model_args_names
          }
          return cls
  
      @batch_decorator
      class Batch(BaseModel):
          pass
  
      redirect_root_to_docs(app, "answer", model_endpoint, "post")
  
      model_endpoint_post_example = {
          arg_name: ["string"] for arg_name in model_args_names
      }
  
      @app.post(model_endpoint, summary="A model endpoint")
      async def answer(
          item: Batch = Body(..., example=model_endpoint_post_example)
      ) -> List:
          loop = asyncio.get_event_loop()
          return await loop.run_in_executor(
              None, interact, model, item.dict()
          )
  
      @app.post("/probe", include_in_schema=False)
      async def probe(item: Batch) -> List[str]:
          loop = asyncio.get_event_loop()
          return await loop.run_in_executor(
              None, test_interact, model, item.dict()
          )
  
      @app.get("/api", summary="Model argument names")
      async def api() -> Dict[str, List[str]]:
          if COMPATIBILITY_MODE is not False:
              return model_args_names
          return {"in": model.in_x, "out": model.out_params}
  
      uvicorn.run(
          app,
          host=host,
          port=port,
          log_config=log_config,
          ssl_version=ssl_config.version,
          ssl_keyfile=ssl_config.keyfile,
          ssl_certfile=ssl_config.certfile,
          timeout_keep_alive=20,
      )
  
imports: import asyncio
  import os
  from collections import namedtuple
  from logging import getLogger
  from pathlib import Path
  from ssl import PROTOCOL_TLSv1_2
  from typing import Dict, List, Optional, Union
  import uvicorn
  from fastapi import Body, FastAPI, HTTPException
  from fastapi.utils import generate_operation_id_for_path
  from pydantic import BaseConfig, BaseModel
  from pydantic.fields import Field, ModelField
  from pydantic.main import ModelMetaclass
  from starlette.middleware.cors import CORSMiddleware
  from starlette.responses import RedirectResponse
  from deeppavlov.core.commands.infer import build_model
  from deeppavlov.core.commands.utils import parse_config
  from deeppavlov.core.common.chainer import Chainer
  from deeppavlov.core.common.file import read_json
  from deeppavlov.core.common.log import log_config
  from deeppavlov.core.common.paths import get_settings_path
  from deeppavlov.core.data.utils import check_nested_dict_keys, jsonify_data
  from deeppavlov.utils.connector import DialogLogger
  from deeppavlov.utils.server.metrics import metrics, PrometheusMiddleware
label_desc: Use image node_id 6 for calling a global function with example usage: start_model_server(model_config, https, ssl_key, ssl_cert, port) and returns: cls, unknown, unknown, dict, model_args_names