# Configuration

> Configure workers on your engine.

**URL:** https://inference.sh/docs/private/config
**Last updated:** 2026-10-12

---

Configure workers on your engine.

---

## Config file

The engine reads **`~/.config/inferencesh/engine.yml`** (XDG config directory on Linux).

Legacy path **`/etc/inferencesh/engine.yml`** (used before engine v1.10.9) is migrated automatically on first start when the new file does not exist yet. Check engine logs for `Migrated config from ...` if you upgraded from an older install.

CLI credentials (`infsh`, `belt`) are stored separately in **`~/.inferencesh/config.json`** — set your API key with `belt login` or `INFERENCE_API_KEY`.

Print resolved paths (config, cache, logs):

```bash
engine config
```

```yaml
# ~/.config/inferencesh/engine.yml
api_url: https://api.inference.sh
api_key: inf_your_key

name: my-server

workers:
  cpu:
    count: 2
  gpu:
    - gpus: [0]
    - gpus: [1]
```

---

## CPU workers

For tasks that don't need GPU:

```yaml
workers:
  cpu:
    count: 4
```

GPU-only engines do **not** get automatic CPU workers. The platform only defaults to two CPU workers when you have **no** GPU workers configured (pure CPU engine). If you run CPU-only apps on a GPU machine, set `workers.cpu.count` explicitly.

---

## GPU workers

One worker per GPU:

```yaml
workers:
  gpu:
    - gpus: [0]
    - gpus: [1]
    - gpus: [2]
```

---

## Multi-GPU workers

For large models needing multiple GPUs:

```yaml
workers:
  gpu:
    - gpus: [0, 1]  # Uses both
```

---

## Engine name

```yaml
name: gpu-server-1
```

Shows in the workspace to identify this machine.

---

## Runtime

Controls how workers are isolated on the host:

```yaml
runtime: docker   # default on Linux
runtime: bare     # default on macOS — native visor process, no Docker
```

When `runtime` is omitted, the engine picks `bare` on macOS and `docker` on Linux. Use `bare` on macOS for local development without a Docker daemon. Production Linux hosts should use `docker`.

---

## After changes

Restart the engine process (for example `sudo systemctl restart inferencesh-engine` if you use the [example unit](/docs/private/installing#run-as-service)).

---

## Next

→ [Using Private Workers](/docs/private/using)
