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

# WandBLogger

> Callback for logging metrics to Weights & Biases.

Uses environment variables for authentication:

* WANDB\_API\_KEY: Your WandB API key (required for online logging)
* WANDB\_ENTITY: Username or team name (optional)
* WANDB\_PROJECT: Project name (optional, overrides constructor project)

If wandb is not installed, this callback will log warnings but not crash.

## Parameters

<ResponseField name="project" type="str" required>
  WandB project name. Can be overridden by WANDB\_PROJECT env var.
</ResponseField>

<ResponseField name="config" type="dict[str, Any] | None" default="None">
  Hyperparameters and configuration to log.
</ResponseField>

## Methods

### on\_optimization\_start

Initialize WandB run.

**Parameters**

<ResponseField name="context" type="CallbackContext" required />

### on\_step\_end

Log metrics to WandB.

**Parameters**

<ResponseField name="context" type="CallbackContext" required />

### on\_optimization\_end

Finish WandB run.

**Parameters**

<ResponseField name="context" type="CallbackContext" required />

## Example

```python theme={null}
wandb_logger = WandBLogger(
    project="protein-design",
    config={"temperature": 1.0, "n_steps": 1000}
)
```
