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

# Environment variables

> Environment variables used by Tandemn users and administrators.

This page lists the environment variables users and administrators commonly touch. Server-side values live in the control plane `.env` file created by `setup.sh`.

## CLI variables

| Variable        | Required   | Description                                                                          |
| --------------- | ---------- | ------------------------------------------------------------------------------------ |
| `TD_SERVER_URL` | Yes        | URL of the Tandemn server that the CLI should contact.                               |
| `TD_API_KEY`    | If enabled | API key for deployments that require authenticated client and replica communication. |

```bash theme={null}
export TD_SERVER_URL=<your-server-url>
export TD_API_KEY=<your-api-key>
```

Verify the value with:

```bash theme={null}
echo $TD_SERVER_URL
tandemn check
```

## Server variables

Server variables are release-specific. After running `bash setup.sh`, inspect `.env`.

| Variable            | Required         | Description                                                                                             |
| ------------------- | ---------------- | ------------------------------------------------------------------------------------------------------- |
| `S3_UPLOAD_BUCKET`  | Yes              | Existing S3 bucket for uploaded workloads, chunk outputs, assembled output, and metrics.                |
| `HF_TOKEN`          | For gated models | HuggingFace token for models such as Llama and Gemma.                                                   |
| `TD_API_KEY`        | Recommended      | Shared API key for control plane authentication.                                                        |
| `KOI_SERVICE_URL`   | Optional         | URL for optional Koi recommendations and lifecycle callbacks. Leave unset for standalone Orca behavior. |
| `ANTHROPIC_API_KEY` | For LLM advisor  | Enables the LLM placement advisor when the performance database is installed.                           |
| `ORCA_URL`          | Koi service only | URL Koi uses to call back to Orca/Tandemn System.                                                       |

> Do not expose secrets, credentials, tokens, or private hostnames in public documentation or committed files.

## IAM requirements

At minimum, the server's AWS credentials need permission to launch and terminate the instance types you plan to use, read and write objects in `S3_UPLOAD_BUCKET`, and read service quota values for capacity tracking.

The server repository includes a least-privilege IAM policy example at `docs/iam-policy.json`.

## Common mistakes

* Setting `TD_SERVER_URL` in one shell and running `tandemn` from another shell.
* Using a server URL that is reachable from the admin machine but not from the user's network.
* Leaving `S3_UPLOAD_BUCKET` pointed at a bucket that does not exist.
* Setting `KOI_SERVICE_URL` accidentally when you want standalone behavior.
* Committing `.env` by accident.
