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

# Configure Weave environment variables

> Configure Weave's behavior at runtime using environment variables

Weave provides a set of environment variables to configure and optimize its behavior. You can set these variables in your shell or within scripts to control specific functionality.

```bash theme={null}
# Example of setting environment variables in the shell
export WEAVE_PARALLELISM=10  # Controls the number of parallel workers
export WEAVE_PRINT_CALL_LINK=false  # Disables call link output
```

```python lines theme={null}
# Example of setting environment variables in Python
import os

os.environ["WEAVE_PARALLELISM"] = "10"
os.environ["WEAVE_PRINT_CALL_LINK"] = "false"
```

## Available environment variables

| Variable                        | Type     | Default      | Description                                                                                                                                                                                                                                                                                                                                                |
| ------------------------------- | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `WANDB_API_KEY`                 | `string` | `None`       | If set, automatically log into W\&B Weave without being prompted for your API key. To generate an API key, log in to your W\&B account and go to [User Settings](https://wandb.ai/settings).                                                                                                                                                               |
| `WEAVE_DISABLED`                | `bool`   | `false`      | When set to `true`, disables all Weave tracing. Weave ops will behave like regular functions.                                                                                                                                                                                                                                                              |
| `WEAVE_PRINT_CALL_LINK`         | `bool`   | `true`       | Controls whether to print a link to the Weave UI when calling a Weave op. You can also set this directly in your code by configuring the `settings` argument for `weave.init()` like this: `weave.init("your-project-name", settings={"print_call_link": False})`                                                                                          |
| `WEAVE_LOG_LEVEL`               | `str`    | `INFO`       | Controls the log level of the weave logger.                                                                                                                                                                                                                                                                                                                |
| `WEAVE_CAPTURE_CODE`            | `bool`   | `true`       | Controls whether to save code for ops so they can be reloaded for later use.                                                                                                                                                                                                                                                                               |
| `WEAVE_DEBUG_HTTP`              | `bool`   | `false`      | When set to `true`, turns on HTTP request and response logging for debugging.                                                                                                                                                                                                                                                                              |
| `WEAVE_PARALLELISM`             | `int`    | `20`         | In evaluations, controls the number of examples to evaluate in parallel. Set to `1` to run examples sequentially.                                                                                                                                                                                                                                          |
| `WEAVE_TRACE_LANGCHAIN`         | `bool`   | `true`       | Controls global tracing for LangChain. Set to `false` to explicitly disable LangChain tracing.                                                                                                                                                                                                                                                             |
| `WEAVE_USE_SERVER_CACHE`        | `bool`   | `true`       | Enables server response caching. When enabled, responses from the server are cached to disk to improve performance for repeated queries.                                                                                                                                                                                                                   |
| `WEAVE_SERVER_CACHE_SIZE_LIMIT` | `int`    | `1000000000` | Sets the maximum size limit for the server cache in bytes. When the cache reaches this size, older entries are automatically removed to make space for new ones. Important: the underlying implementation uses SQLite which has a Write-Ahead Log (WAL) that will grow to 4MB regardless of this setting. This WAL will be removed when the program exits. |
| `WEAVE_SERVER_CACHE_DIR`        | `str`    | `None`       | Specifies the directory where cache files should be stored. If not set, a temporary directory is used.                                                                                                                                                                                                                                                     |
| `WEAVE_MAX_CALLS_QUEUE_SIZE`    | `int`    | `100000`     | Sets the maximum size of the calls queue.  Defaults to 100\_000.  Setting a value of 0 means the queue can grow unbounded.                                                                                                                                                                                                                                 |
| `WEAVE_ENABLE_WAL`              | `bool`   | `false`      | Enable the Weave [Write-Ahead Log (WAL)](/weave/guides/tracking/write-ahead-log). When set to `true`, Weave API requests are written to disk before being sent to the server, improving resilience against data loss.                                                                                                                                      |
| `WEAVE_DISABLE_WAL_SENDER`      | `bool`   | `false`      | Disable the WEAVE write-ahead log sender. When set to `true`, Weave requests are written to disk but not flushed to the server. Useful for debugging.                                                                                                                                                                                                      |
| `WEAVE_RETRY_MAX_ATTEMPTS`      | `int`    | `3`          | Sets the maximum number of retry attempts for failed requests.                                                                                                                                                                                                                                                                                             |
| `WEAVE_RETRY_MAX_INTERVAL`      | `float`  | `300.0`      | Sets the maximum interval between retry attempts in seconds.                                                                                                                                                                                                                                                                                               |
| `WANDB_BASE_URL`                | `string` | `None`       | Sets the Weave host URL. Equivalent to entering the host URL when prompted by `wandb.login()`. You can specify `WANDB_BASE_URL` and `WANDB_API_KEY` before using `weave.init()` to automatically log into and authenticate to Weave.                                                                                                                       |

<Note>
  All boolean environment variables accept the following values (case-insensitive):

  * `true`, `1`, `yes`, `on` for True
  * `false`, `0`, `no`, `off` for False
</Note>
