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

# Environment variables

> Pass configuration to remote functions through environment variables.

Environment variables can be used to configure a function’s runtime environment.

## Configuration

`client.run()` accepts environment variables through the `env_vars` dictionary:

```python theme={null}
import outerproduct as op

run: op.Run[object] | op.Call[object] = client.run(
    fn=process_data,
    image=image,
    env_vars={
        "APP_LOG_LEVEL": "debug",
        "BATCH_SIZE": "32",
    },
)
```

Literal values, including numeric settings, must be provided as strings.

> [!NOTE]
>
> Reserved environment variable names include `PYTHONPATH`, `LOG_LEVEL`, and names beginning with `OUTERPRODUCT_` or `OTEL_`. Calls that specify reserved names through `env_vars` are rejected with an `invalid_argument` error.

`client.map()` also accepts `env_vars`, and applies the specified environment variables to every call it creates.

## Using secrets

`env_vars` also accepts stored OuterProduct [Secrets](https://docs.outerproduct.com/secrets.md) as values:

```python theme={null}
hf_token: op.Secret = client.get_secret("huggingface-token")

run: op.Run[object] | op.Call[object] = client.run(
    fn=download_model,
    image=image,
    env_vars={"HF_TOKEN": hf_token},
)
```

At runtime, OuterProduct resolves the Secret and supplies its value to the environment as `HF_TOKEN`. In order to be available at runtime, the Secret must already exist, and the caller must have permission to access its value.

Secrets can be created in the OuterProduct UI or through the Python API. See [Secrets](https://docs.outerproduct.com/secrets.md) for more information on creation and access management.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.