Configuration
Inspect WandB works out-of-the-box after running wandb init from the command line where you will run Inspect - no additional configuration is required! There are also programmatic configuration options that can be used for automated environments. For basic setup, see Installation and Setup.
For advanced users who want to customize the behavior, you can configure Inspect WandB using environment variables or pyproject.toml. This page provides detailed configuration options.
Available settings
The following is a list of all of the configurable settings you can tweak in Inspect WandB.
WandB Models Configuration
INSPECT_WANDB_MODELS_# where # can be set to:
Setting name |
Purpose |
Default |
|---|---|---|
ENABLED |
Controls whether the WandB Models integration is active. |
|
PROJECT |
Specifies the WandB project for the WandB Models integration. Can also be set using the |
Required |
ENTITY |
Defines the WandB entity (team or username) for the WandB Models integration. Can also be set using the |
Required |
CONFIG |
Optional dictionary containing configuration parameters that will be passed directly to |
|
FILES |
Optional list of files/folders to upload during the models run. File paths should be specified relative to the current working directory (in which Inspect is being run). Example: |
|
TAGS |
Optional tags to add to the models run, e.g. |
|
ADD_METADATA_TO_CONFIG |
Whether or not to write the entire Inspect metadata to WandB run config. |
|
ENVIRONMENT_VALIDATIONS |
An optional dict with the format |
|
WandB Weave Configuration
INSPECT_WANDB_WEAVE_# where # can be set to:
Setting name |
Purpose |
Default |
|---|---|---|
ENABLED |
Controls whether the WandB Weave integration is active. |
|
PROJECT |
Specifies the WandB project for the WandB Weave integration. Can also be set using the |
Required |
ENTITY |
Defines the WandB entity (team or username) for the WandB Weave integration. Can also be set using the |
Required |
SAMPLE_NAME_TEMPLATE |
Sets a template which is used to name sample traces in the Weave UI. The three variables |
|
EVAL_TRACES_ONLY |
When |
|
Configuration Priority
The priority for settings is:
evaloreval-setmetadata configurations (highest priority)Environment variables (for automated environments)
WandB settings file (for entity/project only)
pyproject.toml(repo-level settings, lowest priority)
Configuring using env variables
The simplest way to configure WandB (Models and Weave) is with wandb init in the terminal, which must be run in the same directory you’ll run Inspect in. For use cases where an interactive terminal session is not an option, or for finer config granularity, the following environment variables can be set instead.
WANDB_PROJECT: Sets the WandB project for both Models and WeaveWANDB_ENTITY: Sets the Wandb entity/team for both Models and Weave
You can also configure any of the settings listed above by setting environment variables using the syntax INSPECT_WANDB_MODELS_# or INSPECT_WANDB_WEAVE_#, replacing # appropriately.
Note: If you want to write data for a single eval to different WandB projects based on whether Inspect is writing to the Models API or Weave, you can set
INSPECT_WANDB_MODELS_PROJECTandINSPECT_WANDB_WEAVE_PROJECTto different values, pushing Models and Weave data to different projects. Likewise forINSPECT_WANDB_MODELS_ENTITYandINSPECT_WANDB_WEAVE_ENTITY.
Configuring using eval or eval-set metadata
For fine-grained control, you can override any settings at the script level using eval or eval-set metadata. The syntax for overriding this way is the same as environment variables (neither are case-sensitive). This takes highest priority over all other configuration methods.
With script:
eval(
my_eval,
model="mockllm/model",
metadata={
"inspect_wandb_weave_enabled": True,
"inspect_wandb_models_enabled": False
}
)
or with command:
inspect eval my_eval --metadata inspect_wandb_weave_enabled=True
Configuring using pyproject.toml
It is possible to configure using a pyproject.toml as follows.
[tool.inspect-wandb.weave]
enabled = true # Enable/disable Weave integration (default: true)
sample_name_template = "{task_name}_s{sample_id}_e{epoch}" # Customize sample names in Weave traces (default: "{task_name}-sample-{sample_id}-epoch-{epoch}")
[tool.inspect-wandb.models]
enabled = false # Enable/disable Models integration (default: true)
files = ["pyproject.toml", "log/*"] # Files/folders to upload with Models run, path relative to your current working directory (default: none)
You can also manually set the wandb entity and project in pyproject.toml e.g.
[tool.inspect-wandb.weave]
wandb_entity = "test-entity"
wandb_project = "test-project"
[tool.inspect-wandb.models]
enabled = false # Enable/disable Models integration (default: true)
wandb_entity = "test-entity"
wandb_project = "test-project"
files = ["pyproject.toml", "log/*"] # Files/folders to upload with Models run, path relative to your current working directory (default: none)
As a general rule, settings in pyproject.toml are the same as the environment variable settings above, but rather than having prefixes like INSPECT_WANDB_MODELS_, they are adding to the relevant block.
This configuration level is lowest priority i.e. any environment variables or metadata settings will override settings in pyproject.toml
Full Configuration Options
The following table shows all available settings and how to configure them using different methods:
Setting |
Purpose |
|
Environment Variables |
|
Inspect metadata |
|---|---|---|---|---|---|
Models: Enabled |
Controls whether the WandB Models integration is active |
|
|
N/A |
|
Models: Project |
Specifies the WandB project for Models integration |
|
|
Run in directory from which you’ll run Inspect |
|
Models: Entity |
Defines the WandB entity (team or username) for Models integration |
|
|
Run in directory from which you’ll run Inspect |
|
Models: Config |
Dictionary of configuration parameters passed to |
|
|
N/A |
|
Models: Files |
List of files/folders to upload during the models run |
|
|
N/A |
|
Models: Tags |
Tags to add to the models run |
|
|
N/A |
|
Models: Add Metadata to Config |
Whether to write the entire Inspect metadata to WandB run config |
|
|
N/A |
|
Models: Environment Validations |
Dict for secondary validation of environment variables |
|
|
N/A |
|
Weave: Enabled |
Controls whether the WandB Weave integration is active |
|
|
N/A |
|
Weave: Project |
Specifies the WandB project for Weave integration |
|
|
Run in directory from which you’ll run Inspect |
|
Weave: Entity |
Defines the WandB entity (team or username) for Weave integration |
|
|
Run in directory from which you’ll run Inspect |
|
Weave: Sample Name Template |
Template for naming sample traces in the Weave UI |
|
|
N/A |
|
Weave: Eval Traces Only |
When |
|
|
N/A |
|