Class wandb.Settings
Settings for the W&B SDK. This class manages configuration settings for the W&B SDK, ensuring type safety and validation of all settings. Settings are accessible as attributes and can be initialized programmatically, through environment variables (WANDB_ prefix), and with configuration files.
The settings are organized into three categories:
- Public settings: Core configuration options that users can safely modify to customize W&B’s behavior for their specific needs.
- Internal settings: Settings prefixed with ‘x_’ that handle low-level SDK behavior. These settings are primarily for internal use and debugging. While they can be modified, they are not considered part of the public API and may change without notice in future versions.
- Computed settings: Read-only settings that are automatically derived from other settings or the environment.
- Default values defined on this
Settingsmodel. - Configuration files (
~/.config/wandb/settings, or thesettingsfile in the directory named by theWANDB_CONFIG_DIRenvironment variable). - Environment variables (those prefixed with
WANDB_, e.g.WANDB_MODE). - Values detected from the runtime environment, such as the hostname, the running program/script path, the Python executable, the Docker image, and Jupyter notebook details.
- SageMaker settings, when running in an Amazon SageMaker environment.
- The
settingsparameter ofwandb.setup(). - The
settingsparameter ofwandb.init(). - Certain
wandb.init()parameters (for example,mode=overrides themodesetting).
Args
bool
Whether to symlink media files to the run directory.If true, media files will be symlinked or hardlinked to the
run directory instead of copied. This may result in faster
logging and reduced disk usage. However, deleting or modifying
the original files before upload to the W&B server will be
reflected in the uploaded data.
bool
Flag to allow table artifacts to be synced in offline mode.To revert to the old behavior, set this to False.
bool
Flag to allow modification of
Config values after they’ve been set.object
Deprecated and will be removed.
str | None
The W&B API key.
dict[str, str] | None
Mapping of Azure account URLs to their corresponding access keys for Azure integration.
str | None
Override for the ‘app’ URL for the W&B UI.The
app_url is normally computed based on base_url, but this can be
used to set it explicitly.WANDB_APP_URL is the corresponding environment variable.str
The URL of the W&B backend for data synchronization.
str | None
Directory containing the code to be tracked by W&B.
collections.abc.Sequence[str] | None
Paths to files to load configuration from into the
Config object.Literal['auto', 'off', 'wrap', 'redirect', 'wrap_raw', 'wrap_emu']
The type of console capture to be applied.Possible values are:
- “auto” - Automatically selects the console capture method based on the system environment and settings.
- “off” - Disables console capture.
- “redirect” - Redirects low-level file descriptors for capturing output.
- “wrap” - Overrides the write methods of sys.stdout/sys.stderr. Will be mapped to either “wrap_raw” or “wrap_emu” based on the state of the system.
- “wrap_raw” - Same as “wrap” but captures raw output directly instead of
through an emulator. Derived from the
wrapsetting and should not be set manually. - “wrap_emu” - Same as “wrap” but captures output through an emulator.
Derived from the
wrapsetting and should not be set manually.
bool
Enable multipart console logging.When True, the SDK writes console output to timestamped files
under the
logs/ directory instead of a single output.log.Each part is uploaded as soon as it is closed, giving users live
access to logs while the run is active. Rollover cadence is
controlled by console_chunk_max_bytes and/or console_chunk_max_seconds.
If both limits are 0, all logs are uploaded once at run finish.Note: Uploaded chunks are immutable; terminal control sequences
that modify previous lines (e.g., progress bars using carriage returns)
only affect the current chunk.int
Size-based rollover threshold for multipart console logs, in bytes.Starts a new console log file when the current part reaches this
size. Has an effect only when
console_multipart is True.
Can be combined with console_chunk_max_seconds; whichever limit is
hit first triggers the rollover. A value of 0 disables the
size-based limit.int
Time-based rollover threshold for multipart console logs, in seconds.Starts a new console log file after this many seconds have elapsed
since the current part began. Requires
console_multipart to be
True. May be used with console_chunk_max_bytes; the first limit
reached closes the part. A value of 0 disables the time-based
limit.dict[str, str] | None
Names of Python loggers to capture into the run’s Logs tab.A mapping of logger name to minimum log level. When set, wandb installs a
logging.Handler on each named logger and removes it when the run finishes.
Log records emitted by those loggers are published as console output to the
run, similar to stdout/stderr capture.Log records are formatted the same as
logging.basicConfig(), like
INFO:my_module:Some message. This is not currently customizable.To capture all logs, pass the name of the root logger, which is ‘root’.This is independent of the console setting: both can be active
simultaneously.Example:str
Path to file for writing temporary access tokens.
bool
Whether to disable capturing the code.
bool
Whether to disable capturing the git state.
bool
Whether to disable inferring fork point from remote branchesWhen set to True, the SDK will use the latest commit from the upstream
branch, if one is set. Otherwise skip generating the diff patch.When set to False, the SDK will try to use the latest commit from the upstream branch,
if one is set.
Otherwise, it will find the closest commit from all remote branches.
This may impact performance for repos with many upstream branches.
bool
Whether to disable the creation of a job artifact for W&B Launch.
str | None
The Docker image used to execute the script.
str | None
The email address of the user.
str | None
The W&B entity, such as a user or a team.
str | None
The W&B organization.
bool
Whether to pass the
force flag to wandb.login().wandb.sdk.lib.run_moment.RunMoment | None
Specifies a point in a previous execution of a run to fork from.The point is defined by the run ID, a metric, and its value.
Currently, only the metric ‘_step’ is supported.
str | None
The git commit hash to associate with the run.
str
The git remote to associate with the run.
str | None
The URL of the git remote repository.
str | None
Root directory of the git repository.
str | None
Hostname of the machine running the script.
str | None
Custom proxy servers for http requests to W&B.
str | None
Custom proxy servers for https requests to W&B.
str | None
Path to file containing an identity token (JWT) for authentication.
collections.abc.Sequence[str]
Unix glob patterns relative to
files_dir specifying files to exclude from upload.float
Time in seconds to wait for the
wandb.init call to complete before timing out.float
Time in seconds to wait for data to upload at the end of a run.Setting this can limit costs caused by slow uploads to W&B at the end of a
run, with the trade-off that the run will be marked crashed and may be
missing some data. The default is for
run.finish() to block until all
data finishes uploading.If this is set to a number greater than zero, W&B gives up on uploading a
run’s data after this many seconds at the end of a run, unblocking your
script. After some time, the run becomes Crashed or Failed in the UI. Any
unuploaded data is still stored on disk and can be uploaded with wandb sync.Use the finish_timeout_raises setting to raise an error in addition to
printing a warning message.Runs shut down by wandb.teardown() (which automatically runs at the end
of a script in an atexit hook) will also respect this setting.bool
Whether to raise a TimeoutError if finish_timeout expires.Using this together with the
finish_timeout setting causes run.finish()
to raise a TimeoutError after a timeout in addition to printing a message.Note that run.finish() is called implicitly when using a Run as a context
manager:with wandb.init() as run:
… # run.finish() executes at the end of the with blockThis does not cause wandb.teardown() to raise an error (since it runs
at the end of a script anyway).bool
Whether to insecurely disable SSL verification.
str | None
Name of the Launch job running the script.
Optional[Literal['repo', 'artifact', 'image']]
Source type for Launch.
bool
Whether to disable automatic labeling features.
str | None
Path to the launch configuration file.
float | None
Time in seconds to wait for login operations before timing out.
Literal['online', 'offline', 'shared', 'disabled', 'dryrun', 'run']
The operating mode for W&B logging and synchronization.
str | None
Name of the notebook if running in a Jupyter-like environment.
str | None
Path to the script that created the run, if available.
str | None
The absolute path from the root repository directory to the script that
created the run.Root repository directory is defined as the directory containing the
.git directory, if it exists. Otherwise, it’s the current working directory.
str | None
The relative path to the script that created the run.
str | None
The W&B project ID.
bool
Flag to suppress non-essential output.
Union[Literal['default', 'return_previous', 'finish_previous', 'create_new'], bool]
What to do when
wandb.init() is called while a run is active.Options:- “default”: Use “finish_previous” in notebooks and “return_previous” otherwise.
- “return_previous”: Return the most recently created run
that is not yet finished. This does not update
wandb.run; see the “create_new” option. - “finish_previous”: Finish all active runs, then return a new run.
- “create_new”: Create a new run without modifying other active runs.
Does not update
wandb.runand top-level functions likewandb.log. Because of this, some older integrations that rely on the global run will not work.
bool
Flag to force a new login attempt.
Optional[Literal['allow', 'must', 'never', 'auto']]
Specifies the resume behavior for the run.Options:
- “must”: Resumes from an existing run with the same ID. If no such run exists, it will result in failure.
- “allow”: Attempts to resume from an existing run with the same ID. If none is found, a new run will be created.
- “never”: Always starts a new run. If a run with the same ID already exists, it will result in failure.
- “auto”: Automatically resumes from the most recent failed run on the same machine.
wandb.sdk.lib.run_moment.RunMoment | None
Specifies a point in a previous execution of a run to resume from.The point is defined by the run ID, a metric, and its value.
Currently, only the metric ‘_step’ is supported.
str
The root directory to use as the base for all run-related paths.In particular, this is used to derive the wandb directory and the run directory.
str | None
Group identifier for related runs.Used for grouping runs in the UI.
str | None
The ID of the run.
str | None
Type of job being run (e.g., training, evaluation).
str | None
Human-readable name for the run.
str | None
Additional notes or description for the run.
tuple[str, ...] | None
Tags to associate with the run for organization and filtering.
bool
Flag to disable SageMaker-specific functionality.
bool | None
Whether to save the code associated with the run.
str | None
Path to the system-wide settings file.
collections.abc.Callable[[], None] | None
A callback to execute to stop the run.A run can be stopped through the web UI, or after a fatal error
(if configured via a setting).By default, to stop a run, W&B sends a SIGINT to the main thread.
Set this callback to override this behavior, like to use a different
signal or to take some other action before interrupting.The callback runs in a separate thread. It runs soon after a stop is
requested, but not immediately.
int
Maximum number of history sparklines to display at the end of a run.
int
Maximum number of summary metrics to display at the end of a run.
bool
Whether to display error messages.
bool
Whether to display informational messages.
bool
Whether to display warning messages.
bool
Flag to suppress all output.
bool
Whether to stop the run after a fatal error.After W&B hits an unrecoverable error while uploading data, it prints
a message and stops uploading, but still allows logging more data.
This is usually desirable: your training metrics get stored on disk
and can be recovered using
wandb sync, even if they aren’t uploaded.This is not useful if your files get deleted after training.
In that case, setting this to True will stop the run after a fatal error,
as if the stop button was pressed in the web UI.bool | None
Whether to enable strict mode for validation and error checking.
int
Time in seconds to wait for summary operations before timing out.
str | None
Identifier of the sweep this run belongs to.
str | None
Path to the sweep parameters configuration.
bool
Whether to use symlinks (True by default except on Windows).
bool | None
Whether to synchronize TensorBoard logs with W&B.
bool
Whether to raise an exception when table row limits are exceeded.
bool | None
Whether to use a hidden
.wandb or visible wandb directory for run data.If True, the SDK uses .wandb. If False, wandb.
If not set, defaults to .wandb if it already exists, otherwise wandb.str | None
Username.
bool
Flag to disable the collection of system metadata.
bool
Flag to disable the collection of system metrics.
dict[str, str] | None
Additional headers to add to all outgoing HTTP requests.
str | None
Label to assign to system metrics and console logs collected for the run.This is used to group data by on the frontend and can be used to distinguish data
from different processes in a distributed training job.
bool
Determines whether to save internal wandb files and metadata.In a distributed setting, this is useful for avoiding file overwrites
from secondary processes when only system metrics and logs are needed,
as the primary process handles the main logging.
bool
Flag to save the requirements file.
bool
Flag to delegate automatic computation of summary from history to the server.This does not disable user-provided summary updates.
float
Time in seconds to wait for the wandb-core internal service to start.
bool
Whether to skip saving the run events to the transaction log.This is only relevant for online runs. Can be used to reduce the amount of
data written to disk.Should be used with caution, as it removes the gurantees about
recoverability.
float
Sampling interval for the system monitor in seconds.
dict[str, str] | None
OpenMetrics
/metrics endpoints to monitor for system metrics.dict[str, dict[str, str]] | collections.abc.Sequence[str] | None
Filter to apply to metrics collected from OpenMetrics
/metrics endpoints.Supports two formats:{"metric regex pattern, including endpoint name as prefix": {"label": "label value regex pattern"}}("metric regex pattern 1", "metric regex pattern 2", ...)
dict[str, str] | None
HTTP headers to add to OpenMetrics requests.
collections.abc.Sequence[str] | None
System paths to monitor for disk usage.
int | None
System CPU count.If set, overrides the auto-detected value in the run metadata.
int | None
Logical CPU count.If set, overrides the auto-detected value in the run metadata.
int | None
GPU device count.If set, overrides the auto-detected value in the run metadata.
str | None
GPU device type.If set, overrides the auto-detected value in the run metadata.
collections.abc.Sequence[int] | None
GPU device indices to monitor.If not set, the system monitor captures metrics for all GPUs.
Assumes 0-based indexing matching CUDA/ROCm device enumeration.
bool
Monitor the entire process tree for resource usage, starting from
x_stats_pid.When True, the system monitor aggregates the RSS, CPU%, and thread count
from the process with PID x_stats_pid and all of its descendants.
This can have a performance overhead and is disabled by default.bool
Disable cgroup v2 CPU and memory limits for system metric percentages.
str
Suffix to add to the run’s directory name (sync_dir).This is set in wandb.init() to avoid naming conflicts.
If set, it is joined to the default name with a dash.
bool
Flag to indicate whether this process can update the run’s final state on the server.Set to False in distributed training when only the main process should determine the final state.