> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# setup()

[View source](https://github.com/wandb/wandb/blob/main/wandb/sdk/wandb_setup.py#L512)

## function wandb.setup()

Prepares W\&B for use in the current process and its children.

You can usually ignore this as it is implicitly called by `wandb.init()`.

When using wandb in multiple processes, calling `wandb.setup()`
in the parent process before starting child processes may improve
performance and resource utilization.

Note that `wandb.setup()` modifies `os.environ`, and it is important
that child processes inherit the modified environment variables.

See also `wandb.teardown()`.

```python theme={"system"}
settings: 'Settings | None' = None
```

## Args

**settings** `Settings | None`

Configuration settings to apply globally. These can be overridden by subsequent `wandb.init()` calls.

## Examples

```python theme={"system"}
import multiprocessing

import wandb


def run_experiment(params):
    with wandb.init(config=params):
        # Run experiment
        pass


if __name__ == "__main__":
    # Start backend and set global config
    wandb.setup(settings={"project": "my_project"})

    # Define experiment parameters
    experiment_params = [
        {"learning_rate": 0.01, "epochs": 10},
        {"learning_rate": 0.001, "epochs": 20},
    ]

    # Start multiple processes, each running a separate experiment
    processes = []
    for params in experiment_params:
        p = multiprocessing.Process(target=run_experiment, args=(params,))
        p.start()
        processes.append(p)

    # Wait for all processes to complete
    for p in processes:
        p.join()

    # Optional: Explicitly shut down the backend
    wandb.teardown()
```
