# LocalElasticAgent Source: https://www.tensorplay.cn/docs/generated/tensorplay.distributed.elastic.agent.server.LocalElasticAgent.html ```python class tensorplay.distributed.elastic.agent.server.LocalElasticAgent(spec, logs_specs=None, start_method: str = 'spawn', exit_barrier_timeout: float = 300, log_line_prefix_template: str | None = None, shutdown_timeout: int = 30, health_check_server=None, uninterruptible_state_timeout: float | None = None, log_dir: str | None = None) ``` Agent managing workers on the local node. Workers are launched through start_processes (subprocesses for command entrypoints, multiprocessing for callables) with per-rank environments carrying the elastic contract; failures and restarts are handled by the base-class run loop. ```python run(role: str = 'default') → RunResult ``` Run the agent to a terminal state, shutting down on any exit path.