class Settings
Description
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.
Args
allow_media_symlink: Whether to symlink media files to the run directory.
allow_offline_artifacts: Flag to allow table artifacts to be synced in offline mode.
allow_val_change: Flag to allow modification ofConfigvalues after they’ve been set.anonymous: Deprecated and will be removed.api_key: The W&B API key.azure_account_url_to_access_key: Mapping of Azure account URLs to their corresponding access keys for Azure integration.app_url_override: Override for the ‘app’ URL for the W&B UI.
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.
base_url: The URL of the W&B backend for data synchronization.code_dir: Directory containing the code to be tracked by W&B.config_paths: Paths to files to load configuration from into theConfigobject.console: The type of console capture to be applied.
- “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. console_multipart: Enable multipart console logging.
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.
console_chunk_max_bytes: Size-based rollover threshold for multipart console logs, in bytes.
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.
console_chunk_max_seconds: Time-based rollover threshold for multipart console logs, in seconds.
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.
capture_loggers: Names of Python loggers to capture into the run’s Logs tab.
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:
credentials_file: Path to file for writing temporary access tokens.disable_code: Whether to disable capturing the code.disable_git: Whether to disable capturing the git state.disable_git_fork_point: Whether to disable inferring fork point from remote branches
disable_job_creation: Whether to disable the creation of a job artifact for W&B Launch.docker: The Docker image used to execute the script.email: The email address of the user.entity: The W&B entity, such as a user or a team.organization: The W&B organization.force: Whether to pass theforceflag towandb.login().fork_from: Specifies a point in a previous execution of a run to fork from.
git_commit: The git commit hash to associate with the run.git_remote: The git remote to associate with the run.git_remote_url: The URL of the git remote repository.git_root: Root directory of the git repository.host: Hostname of the machine running the script.http_proxy: Custom proxy servers for http requests to W&B.https_proxy: Custom proxy servers for https requests to W&B.identity_token_file: Path to file containing an identity token (JWT) for authentication.ignore_globs: Unix glob patterns relative tofiles_dirspecifying files to exclude from upload.init_timeout: Time in seconds to wait for thewandb.initcall to complete before timing out.finish_timeout: Time in seconds to wait for data to upload at the end of a run.
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.
finish_timeout_raises: Whether to raise a TimeoutError if finish_timeout expires.
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 block
This does not cause wandb.teardown() to raise an error (since it runs
at the end of a script anyway).
insecure_disable_ssl: Whether to insecurely disable SSL verification.job_name: Name of the Launch job running the script.job_source: Source type for Launch.label_disable: Whether to disable automatic labeling features.launch_config_path: Path to the launch configuration file.login_timeout: Time in seconds to wait for login operations before timing out.mode: The operating mode for W&B logging and synchronization.notebook_name: Name of the notebook if running in a Jupyter-like environment.program: Path to the script that created the run, if available.program_abspath: The absolute path from the root repository directory to the script that created the run.
program_relpath: The relative path to the script that created the run.project: The W&B project ID.quiet: Flag to suppress non-essential output.reinit: What to do whenwandb.init()is called while a run is active.
- “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.
relogin: Flag to force a new login attempt.resume: Specifies the resume behavior for the run.
- “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.
resume_from: Specifies a point in a previous execution of a run to resume from.
root_dir: The root directory to use as the base for all run-related paths.
run_group: Group identifier for related runs.
run_id: The ID of the run.run_job_type: Type of job being run (e.g., training, evaluation).run_name: Human-readable name for the run.run_notes: Additional notes or description for the run.run_tags: Tags to associate with the run for organization and filtering.sagemaker_disable: Flag to disable SageMaker-specific functionality.save_code: Whether to save the code associated with the run.settings_system: Path to the system-wide settings file.stop_fn: A callback to execute to stop the run.
max_end_of_run_history_metrics: Maximum number of history sparklines to display at the end of a run.max_end_of_run_summary_metrics: Maximum number of summary metrics to display at the end of a run.show_errors: Whether to display error messages.show_info: Whether to display informational messages.show_warnings: Whether to display warning messages.silent: Flag to suppress all output.stop_on_fatal_error: Whether to stop the run after a fatal error.
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.
strict: Whether to enable strict mode for validation and error checking.summary_timeout: Time in seconds to wait for summary operations before timing out.sweep_id: Identifier of the sweep this run belongs to.sweep_param_path: Path to the sweep parameters configuration.symlink: Whether to use symlinks (True by default except on Windows).sync_tensorboard: Whether to synchronize TensorBoard logs with W&B.table_raise_on_max_row_limit_exceeded: Whether to raise an exception when table row limits are exceeded.use_dot_wandb: Whether to use a hidden.wandbor visiblewandbdirectory for run data.
.wandb. If False, wandb.
If not set, defaults to .wandb if it already exists, otherwise wandb.
username: Username.x_disable_meta: Flag to disable the collection of system metadata.x_disable_stats: Flag to disable the collection of system metrics.x_extra_http_headers: Additional headers to add to all outgoing HTTP requests.x_label: Label to assign to system metrics and console logs collected for the run.
x_primary: Determines whether to save internal wandb files and metadata.
x_save_requirements: Flag to save the requirements file.x_server_side_derived_summary: Flag to delegate automatic computation of summary from history to the server.
x_service_wait: Time in seconds to wait for the wandb-core internal service to start.x_skip_transaction_log: Whether to skip saving the run events to the transaction log.
x_stats_sampling_interval: Sampling interval for the system monitor in seconds.x_stats_open_metrics_endpoints: OpenMetrics/metricsendpoints to monitor for system metrics.x_stats_open_metrics_filters: Filter to apply to metrics collected from OpenMetrics/metricsendpoints.
{"metric regex pattern, including endpoint name as prefix": {"label": "label value regex pattern"}}("metric regex pattern 1", "metric regex pattern 2", ...)x_stats_open_metrics_http_headers: HTTP headers to add to OpenMetrics requests.x_stats_disk_paths: System paths to monitor for disk usage.x_stats_cpu_count: System CPU count.
x_stats_cpu_logical_count: Logical CPU count.
x_stats_gpu_count: GPU device count.
x_stats_gpu_type: GPU device type.
x_stats_gpu_device_ids: GPU device indices to monitor.
x_stats_track_process_tree: Monitor the entire process tree for resource usage, starting fromx_stats_pid.
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.
x_stats_no_cgroup: Disable cgroup v2 CPU and memory limits for system metric percentages.x_sync_dir_suffix: Suffix to add to the run’s directory name (sync_dir).
x_update_finish_state: Flag to indicate whether this process can update the run’s final state on the server.
Properties
property app_url
The URL for the W&B UI, usually https://wandb.ai. This is different frombase_url (like https://api.wandb.ai) which
is used to access W&B APIs programmatically.
property colab_url
The URL to the Colab notebook, if running in Colab.property deployment
property files_dir
Absolute path to the local directory where the run’s files are stored.property is_local
property log_dir
The directory for storing log files.property log_internal
The path to the file to use for internal logs.property log_symlink_internal
The path to the symlink to the internal log file of the most recent run.property log_symlink_user
The path to the symlink to the user-process log file of the most recent run.property log_user
The path to the file to use for user-process logs.property project_url
The W&B URL where the project can be viewed.property resume_fname
The path to the resume file.property run_mode
The mode of the run. Can be either “run” or “offline-run”.property run_url
The W&B URL where the run can be viewed.property settings_workspace
The path to the workspace settings file.property sweep_url
The W&B URL where the sweep can be viewed.property sync_dir
The directory for storing the run’s files.property sync_file
Path to the append-only binary transaction log file.property sync_symlink_latest
Path to the symlink to the most recent run’s transaction log file.property timespec
The time specification for the run.property wandb_dir
Full path to the wandb directory.Methods
method validate_anonymous
Arguments
value:
method validate_x_extra_http_headers
Arguments
value:
method validate_x_stats_coreweave_metadata_base_url
Arguments
value: