# Backend Runtime Contract

Dream Server now defines backend runtime behavior in contract files instead of hardcoded installer branches.

## Contract Files

- `config/backends/amd.json`
- `config/backends/nvidia.json`
- `config/backends/cpu.json`
- `config/backends/apple.json`

Each contract defines:

- LLM engine/service name
- public API port and health URL
- OpenClaw provider name + internal provider URL

## Loader

- `scripts/load-backend-contract.sh`

Example:

```bash
eval "$(scripts/load-backend-contract.sh --backend amd --env)"
echo "$BACKEND_PUBLIC_HEALTH_URL $BACKEND_PROVIDER_URL"
```

## Installer Integration

The modular installer loads backend contracts in `installers/lib/detection.sh` via `load_backend_contract()`. Contract values drive:

- runtime health-check endpoint selection (`installers/phases/12-health.sh`)
- OpenClaw provider wiring (`installers/phases/06-directories.sh`)
- LLM API summary endpoint (`installers/phases/13-summary.sh`)

See [INSTALLER-ARCHITECTURE.md](INSTALLER-ARCHITECTURE.md) for the full module map.
