Skip to main content
GitHub source Start a sweep agent. Poll the W&B server for hyperparameter configurations from the sweep and start a run for each configuration. The agent exits when the sweep completes, the sweep is stopped/cancelled, or the --count limit is reached. SWEEP_ID is printed by wandb sweep when a sweep is created. It can include the entity and project path (entity/project/sweep_id). Examples: Start an agent for a sweep
wandb agent SWEEP_ID
Start an agent with a run limit
wandb agent --count 10 SWEEP_ID
Start an agent for a sweep in a specific project
wandb agent -p PROJECT_NAME -e ENTITY SWEEP_ID
Forward signals to child runs for clean shutdown
wandb agent --forward-signals SWEEP_ID

Usage

wandb agent [OPTIONS] SWEEP_ID

Options

project

Set the project to upload runs to.
FlagDefaultType
-p, --projectNoneSTRING

entity

Set the entity to scope the project to.
FlagDefaultType
-e, --entityNoneSTRING

count

Maximum number of runs this agent will execute. Continues until the sweep completes if not set.
FlagDefaultType
--countNoneINT

forward_signals

Forward signals (e.g. SIGINT/SIGTERM) to child runs so they can shut down cleanly.
FlagDefaultType
-f, --forward-signalsFalseBOOL

help

Show this message and exit.
FlagDefaultType
--helpFalseBOOL

CLI Help

Usage: agent [OPTIONS] SWEEP_ID

  Start a sweep agent.

  Poll the W&B server for hyperparameter configurations from the sweep and
  start a run for each configuration.

  The agent exits when the sweep completes, the sweep is stopped/cancelled, or
  the `--count` limit is reached.

  SWEEP_ID is printed by `wandb sweep` when a sweep is created. It can include
  the entity and project path (`entity/project/sweep_id`).

  Examples:

  Start an agent for a sweep

  ```bash wandb agent SWEEP_ID ```

  Start an agent with a run limit

  ```bash wandb agent --count 10 SWEEP_ID ```

  Start an agent for a sweep in a specific project

  ```bash wandb agent -p PROJECT_NAME -e ENTITY SWEEP_ID ```

  Forward signals to child runs for clean shutdown

  ```bash wandb agent --forward-signals SWEEP_ID ```

Options:
  -p, --project TEXT     Set the project to upload runs to.
  -e, --entity TEXT      Set the entity to scope the project to.
  --count INTEGER        Maximum number of runs this agent will execute.
                         Continues until the sweep completes if not set.
  -f, --forward-signals  Forward signals (e.g. SIGINT/SIGTERM) to child runs
                         so they can shut down cleanly.
  --help                 Show this message and exit.