def METHOD_NAME(self, trainer, *args: Any, **kwargs: Any):
    if self.node_rank != 0:
        return {}, args, kwargs
    from lightning.pytorch.serve import ServableModuleValidator
    callbacks = kwargs.get("callbacks", [])
    if self.sanity_serving:
        callbacks = callbacks + [ServableModuleValidator()]
    kwargs["callbacks"] = callbacks
    return {}, args, kwargs