class_docstr: The ServableModuleValidator validates to validate a model correctly implement the ServableModule API.
  
  .. warning::  This is an :ref:`experimental <versioning:Experimental API>` feature.
  
  Arguments:
      optimization: The format in which the model should be tested while being served.
      server: The library used to evaluate the model serving. The default is FastAPI.
      host: The host address associated with the server.
      port: The port associated with the server.
      timeout: Timeout period in seconds, that the process should wait for the server to start.
      exit_on_failure: Whether to exit the process on failure.
docstr: This method starts a server with a serve and ping endpoints.
docstr_tok: ["This","method","starts","a","server","with","a","serve","and","ping","endpoints","."]
code: def _start_server(
      servable_model: ServableModule, host: str, port: int, _: bool
  ) -> None:
      """This method starts a server with a serve and ping endpoints."""
      from fastapi import Body, FastAPI
      from uvicorn import run
  
      app = FastAPI()
  
      (
          deserializers,
          serializers,
      ) = servable_model.configure_serialization()
  
      # Note: This isn't the original version, but a copy.
      servable_model.eval()
  
      @app.get("/ping")
      def ping() -> bool:
          return True
  
      @app.post("/serve")
      async def serve(payload: dict = Body(...)) -> Dict[str, Any]:
          body = payload["body"]
  
          for key, deserializer in deserializers.items():
              body[key] = deserializer(body[key])
  
          with torch.no_grad():
              output = servable_model.serve_step(**body)
  
          if not isinstance(output, dict):
              raise Exception(
                  f"Please, return your outputs as a dictionary. Found {output}"
              )
  
          for key, serializer in serializers.items():
              output[key] = serializer(output[key])
  
          return output
  
      run(app, host=host, port=port, log_level="error")
  
imports: import contextlib
  import logging
  import time
  from multiprocessing import Process
  from typing import Any, Dict, Literal, Optional
  import requests
  import torch
  from lightning_utilities.core.imports import RequirementCache
  from typing_extensions import override
  import lightning.pytorch
  from lightning.pytorch.callbacks import Callback
  from lightning.pytorch.serve.servable_module import ServableModule
  from lightning.pytorch.strategies import DeepSpeedStrategy, FSDPStrategy
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning.pytorch.utilities.model_helpers import is_overridden
  from lightning.pytorch.utilities.rank_zero import rank_zero_only
label_desc: Use image node_id 5 for calling the ServableModuleValidator obj's underlying member method code with example usage: obj._start_server(servable_model, host, port, _) and returns: True, output