# Configuration

Settings live in zerowidth.json, written by `zerowidth init`. Command-line options override it.

`zerowidth init` writes `zerowidth.json` in the folder you run ZeroWidth from. Command-line options override it, and paths in it are relative to its folder.

zerowidth.json names where keys are, never a key. Keep keys in environment variables.

## Settings

| Setting | What the setting does |
|---|---|
| `store` | The record's file, such as `team.db` |
| `label` | The record's name in the console |
| `user` | Who "user" is in a Claude Code transcript |
| `port` | The port `serve` uses, 4380 unless set |
| `host` | The address `serve` listens on. Anything but this computer asks for a token. |
| `tokenEnv` | The environment variable that holds the team token |
| `model` | The AI model: `name`, `endpoint`, `keyEnv` and `embed`. [AI models and costs](https://zerowidth.ai/docs/self-hosting/ai-models) |
| `decider` | The id of a model that judges whether two decisions are the same, which `zerowidth duplicates` and the dream use. None unless you name one, and nothing is sent to one until you do |
| `zdr` | Always `true`: ZeroWidth uses only model hosts that keep nothing |
| `readings` | Where the numbers are kept, when not beside the record |
| `metrics` | Settings for linking metrics to decisions, such as `rejected` for proposed links you turned down |
| `dream` | When a dream is due. `serve` never dreams on a timer: run `zerowidth dream --if-due` from a scheduler, or Dream now in the console. [Dreaming](https://zerowidth.ai/docs/concepts/dreaming) |
| `import` | What to read: `sources`, and `holdBack` |
| `sources` | Where to pull numbers from. [Metrics](https://zerowidth.ai/docs/self-hosting/metrics) |

## Settings files from elsewhere

A `zerowidth.json` in a folder you did not make, such as a cloned repository or an unpacked archive, can ask for things that send your model key and the text being read to another address, or run a program. Until you approve that file, ZeroWidth reads it without its model endpoint, its key names and its sources, and says so. Run `zerowidth trust` in the folder to approve the file as it is now. If the file changes, it asks again. For a container or pipeline that writes its own file, set `ZEROWIDTH_TRUST_SETTINGS=1`.

## Example

```zerowidth.json
{
  "store": "team.db",
  "label": "Acme",
  "model": { "name": "anthropic/claude-haiku-5.5", "keyEnv": "OPENROUTER_API_KEY" },
  "dream": { "everyHours": 24, "scope": "changed" }
}
```
