class_docstr: Custom Handler for integrating vLLM
class_docstr_tok: ["Custom","Handler","for","integrating","vLLM"]
docstr: In this initialize function, the model is loaded
  Args:
      ctx (context): It is a JSON Object containing information
      pertaining to the model artifacts parameters.
docstr_tok: ["In","this","initialize","function",",","the","model","is","loaded","Args",":","ctx","(","context",")",":","It","is","a","JSON","Object","containing","information","pertaining","to","the","model","artifacts","parameters","."]
code: def initialize(self, ctx: Context):
      """In this initialize function, the model is loaded
      Args:
          ctx (context): It is a JSON Object containing information
          pertaining to the model artifacts parameters.
      """
      model_dir = ctx.system_properties.get("model_dir")
      self.max_new_tokens = int(
          ctx.model_yaml_config["handler"]["max_new_tokens"]
      )
      model_name = ctx.model_yaml_config["handler"]["model_name"]
      model_path = ctx.model_yaml_config["handler"]["model_path"]
      tp_size = ctx.model_yaml_config["torchrun"]["nproc-per-node"]
      seed = int(ctx.model_yaml_config["handler"]["manual_seed"])
      torch.manual_seed(seed)
  
      self.model = LLM(model=model_path, tensor_parallel_size=tp_size)
  
      logger.info("Model %s loaded successfully", ctx.model_name)
      self.initialized = True
  
file_path: serve/examples/large_models/vllm/mistral/custom_handler.py
imports: import logging
  import torch
  import vllm
  from vllm import LLM, SamplingParams
  from ts.context import Context
  from ts.torch_handler.base_handler import BaseHandler
label_desc: Use image node_id 2 for calling the CustomHandler obj's underlying member method code with example usage: obj.initialize(ctx) without return types