# Mirli for developers and AI agents

> Mirli is a free, open-source (MIT) app that generates sound effects, music, speech and cloned voices on your own machine from open-weight models. Inference runs locally through the audio.cpp engine on an NVIDIA, Apple or CPU backend, so there is no account, no API key and no per-generation cost. One local server process serves the desktop and web UI, an HTTP API and an MCP server, all on 127.0.0.1:17494, and every result is a WAV file on disk with an absolute path.

Version 0.7.3. Canonical page: https://mirli.app/developers/. Source: https://github.com/HamSanders/soundbox.

Kept identifiers: the product is Mirli, but the MCP tools are `soundbox.*`, the CLI is `soundbox` and the Docker image is `ghcr.io/hamsanders/soundbox`. The environment variables are `MIRLI_*`; the old `SOUNDBOX_*` names still work, and are the only ones 0.5.0 and earlier read.

## Facts

- **Server:** `http://127.0.0.1:17494`
- **MCP endpoint:** `http://127.0.0.1:17494/mcp` (Streamable HTTP)
- **Health check:** `GET http://127.0.0.1:17494/api/health`
- **Auth:** None by default; the server binds to loopback. Set `MIRLI_API_TOKEN` to require `Authorization: Bearer <token>`.
- **Output:** WAV files on local disk, returned as absolute paths
- **Licence:** MIT (the app). Each model has its own licence.
- **Docker image:** `ghcr.io/hamsanders/soundbox:latest` (amd64), `:cuda` for NVIDIA
- **Source:** https://github.com/HamSanders/soundbox

## Install

### Desktop app (Windows, macOS)

A person's own Windows 10/11 x64 or macOS machine (Apple silicon or Intel).

Download the installer for the machine from https://mirli.app/download/ (the latest GitHub release: an `x64-setup.exe`, an `aarch64.dmg` or an `x64.dmg`) and run it. The app carries its own Node and server.

The builds are not code-signed yet, so the first launch shows SmartScreen (Windows) or Gatekeeper (macOS). An agent cannot click through that; ask the person to confirm it.

With the app open, the server answers on `127.0.0.1:17494`:

```bash
curl http://127.0.0.1:17494/api/health
```

### Docker (Linux server, NAS, rented GPU)

A headless machine. Server and web UI in one container, no desktop app. Prebuilt images are amd64 only.

CPU image, port published on loopback only:

```bash
docker run -d --name soundbox -p 127.0.0.1:17494:17494 \
  -v soundbox-data:/data -v soundbox-models:/data/models \
  ghcr.io/hamsanders/soundbox:latest
```

NVIDIA GPU (needs the NVIDIA Container Toolkit and a driver that supports CUDA 12.9, 575 or newer on GeForce):

```bash
docker run -d --name soundbox --gpus all -p 127.0.0.1:17494:17494 \
  -v soundbox-data:/data -v soundbox-models:/data/models \
  ghcr.io/hamsanders/soundbox:cuda
```

The audio.cpp runtime is already in the image. Pull a model inside the container:

```bash
docker exec soundbox soundbox pull audiocpp-stable-audio-3-sfx
```

Each release is also tagged by version (`:vX.Y.Z`, `:vX.Y.Z-cuda`). There is no authentication unless `MIRLI_API_TOKEN` is set, so never publish `0.0.0.0:17494` without a token or an authenticating proxy. Reaching `/mcp` by any name other than localhost needs that name in `MIRLI_ALLOWED_HOSTS`.

### From source (Linux, or any OS)

Linux desktops, development, or arm64. Needs Node 22.12+ and git. The CLI is not published to npm.

Clone, build, install the audio.cpp runtime for this machine, and start the server:

```bash
git clone https://github.com/HamSanders/soundbox
cd soundbox
npm install
npm run build
npx soundbox model install audiocpp
npx soundbox
```

`npx soundbox` starts the server on port 17494 and serves the web app at the same address. `npx soundbox --help` lists the subcommands.

### Rules for an agent installing Mirli

- Check the hardware first. `GET /api/health` reports `device` (`cuda`, `metal` or `cpu`), `gpu_name`, `vram_total_mb` and `vram_free_mb`.
- Say what each model costs before downloading it: `GET /api/models` gives `vram_estimate_mb`, `license.name` and `license.commercial` (`yes`, `conditional` or `no`). Wait for a yes.
- Never accept a model licence on the person's behalf.
- Reuse weights that are already installed; they live under `~/.mirli/models` and are shared by every profile.
- Do not change network or firewall settings. The server binds to loopback and needs nothing opened.

## Connect the MCP server

Endpoint: `http://127.0.0.1:17494/mcp` (Streamable HTTP, no auth by default).

### Claude Code

Run in a terminal:

```bash
claude mcp add --transport http soundbox http://127.0.0.1:17494/mcp
```

Add `--scope user` to make it available in every project. With an access token, add `--header "Authorization: Bearer <token>"`.

Syntax from https://code.claude.com/docs/en/mcp

### Cursor

`~/.cursor/mcp.json` (every project) or `.cursor/mcp.json` (one project):

```json
{
  "mcpServers": {
    "soundbox": {
      "url": "http://127.0.0.1:17494/mcp"
    }
  }
}
```

One-click: [Add to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=soundbox&config=eyJ1cmwiOiJodHRwOi8vMTI3LjAuMC4xOjE3NDk0L21jcCJ9)

Syntax from https://cursor.com/docs/context/mcp

### VS Code

Run in a terminal:

```bash
code --add-mcp '{"name":"soundbox","type":"http","url":"http://127.0.0.1:17494/mcp"}'
```

Or in `.vscode/mcp.json`:

```json
{
  "servers": {
    "soundbox": {
      "type": "http",
      "url": "http://127.0.0.1:17494/mcp"
    }
  }
}
```

One-click: [Add to VS Code](vscode:mcp/install?%7B%22name%22%3A%22soundbox%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22http%3A%2F%2F127.0.0.1%3A17494%2Fmcp%22%7D)

Syntax from https://code.visualstudio.com/docs/agents/reference/mcp-configuration

### Codex CLI

Run in a terminal:

```bash
codex mcp add soundbox --url http://127.0.0.1:17494/mcp
```

Or in `~/.codex/config.toml`:

```toml
[mcp_servers.soundbox]
url = "http://127.0.0.1:17494/mcp"
```

Syntax from https://learn.chatgpt.com/docs/extend/mcp?surface=cli

### Gemini CLI

Run in a terminal:

```bash
gemini mcp add --transport http soundbox http://127.0.0.1:17494/mcp
```

Or in `~/.gemini/settings.json` (`httpUrl` is Streamable HTTP; `url` would mean SSE):

```json
{
  "mcpServers": {
    "soundbox": {
      "httpUrl": "http://127.0.0.1:17494/mcp"
    }
  }
}
```

Syntax from https://geminicli.com/docs/tools/mcp-server/

### Zed

Zed's `settings.json`:

```json
{
  "context_servers": {
    "soundbox": {
      "url": "http://127.0.0.1:17494/mcp"
    }
  }
}
```

Syntax from https://zed.dev/docs/ai/mcp

### Claude Desktop and other stdio-only clients

`claude_desktop_config.json`, or the client's own MCP config:

```json
{
  "mcpServers": {
    "soundbox": {
      "command": "node",
      "args": [
        "/absolute/path/to/soundbox/server/dist/mcp/stdio.js"
      ]
    }
  }
}
```

Claude Desktop's config file takes stdio servers, and its custom connectors connect from Anthropic's cloud, which cannot reach 127.0.0.1. The stdio bridge proxies onto the running server and loads no models. It needs a source checkout after `npm run build` and an absolute path, and covers six tools: `generate`, `enhance_prompt`, `list_models`, `list_sounds`, `get_sound` and `delete_sound`. Use HTTP for the rest. `MIRLI_URL` and `MIRLI_API_TOKEN` point it at another server.

Syntax from https://modelcontextprotocol.io/docs/develop/connect-local-servers

- The MCP server runs inside the main Mirli process. There is no separate daemon: if the app or `soundbox` server is running, the tools are there; if not, connecting fails.
- The URL has no trailing slash.
- The server name in the configs above (`soundbox`) is the client-side label; the tool names are `soundbox.*` whatever you call it.
- Generation is serialised: one GPU, one job at a time. Parallel calls queue. Use `variations` for several takes of one idea.
- Tool calls block until the audio is on disk and return absolute file paths, so there is no job id to poll over MCP.
- Licences are per model. `soundbox.list_models` reports `commercial_use` as yes, conditional or no; check it before generating for commercial work.
- Optional agent skills ship with the server: `soundbox skills install` copies them to `~/.claude/skills/` (`--target cursor` for `~/.cursor/skills/`).

## MCP tools (27)

Read from the server source (`server/src/mcp/server.ts`) at build time. `?` marks an optional argument.

### `soundbox.enhance_prompt`: Rewrite a prompt for a sound model

Rewrite a short or abstract prompt into a concrete, descriptive one a text-to-audio model responds to, optionally returning several variations, plus a few suggested library tags (a separate field from the prompt — pass these to soundbox.generate's `tags`, not into the prompt itself). Prefer writing a descriptive prompt yourself when you already know the material/action/space; use this when the prompt is vague ('scary sound') or you want options. Only useful when the local prompt assistant is enabled — check the reply if it isn't.

- `prompt: string`: The prompt to rewrite.
- `n?: integer = 1 (1–5)`: How many distinct variations to return.
- `category?: "sfx" | "music"`: Which kind of model this is for — sfx (default) or music.
- `lyrics?: boolean`: True if this sets genre/instrumentation for a lyrics-conditioned model.
- `model?: string`: The model id you intend to pass to soundbox.generate. Grounds the rewrite in that model's own documented prompting conventions — check soundbox.list_models for ids. Omit for generic guidance.

### `soundbox.generate`: Generate a sound effect

Generate one or more sound effects from a text description and save them to the Mirli library. Blocks until the audio is on disk.

- `prompt: string`: What the sound is. Describe material, action and space — 'glass bottle shattering on tile, small reverberant room'. For a lyrics-conditioned model (see `lyrics`), this instead sets the genre and instrumentation — 'dark orchestral-hybrid theme, slow dirge tempo, mournful choir vocals'.
- `duration_s?: number = 5.0 (0.5–300)`: Clip length in seconds. A value above the model's own max_duration_s is refused with an error, except for edit "extend", which renders a longer target in windowed passes; check soundbox.list_models for per-model limits.
- `model?: string`: Model id. Defaults to whichever model is already loaded.
- `negative_prompt?: string`: What to avoid. Ignored by models that lack it.
- `seed?: integer (0–)`: Seed for reproducibility.
- `variations?: integer = 1 (1–4)`: How many different takes to generate.
- `tags?: string[]`: Library tags.
- `lyrics?: string`: Words for a lyrics-conditioned vocal music model (ACE-Step) to sing, e.g. '[verse]\nGame over\nYou have fallen'. Ignored by models that don't support lyrics — check `supports.lyrics` via soundbox.list_models. Omit for an instrumental render.
- `track_name?: string`: Optional track title, only used alongside `lyrics`.
- `source_sound_id?: string`: Edit an existing library sound instead of rendering from scratch. Pair with `edit`. The model must declare `supports.<edit>` in soundbox.list_models (ACE-Step does; MiniMax Music 3 does not). The result is a new sound whose `parent_id` is this one.
- `edit?: "extend" | "cover" | "repaint"`: What to do with `source_sound_id`: 'extend' continues it so the result is `duration_s` seconds long (must exceed the source) with the original kept intact at the start; 'cover' re-renders it in the style of `prompt` (and `lyrics`) at the source's length; 'repaint' regenerates edit_options.repaint_start_s..repaint_end_s.
- `edit_options?: object`

### `soundbox.separate`: Split a sound into stems

Split a library sound into its stems — vocals, drums, bass, other — each saved as its own sound with its own file path. Name `stems` to keep only some of them; `rest: "merge"` sums the ones you didn't name into a single "rest" sound, which is the original minus what you took out. Blocks until the audio is on disk. Needs a separation model installed (`task: "sep"` in soundbox.list_models).

- `sound_id: string`: Library sound to split.
- `model?: string`: Separation model id. Omit for whichever `task: "sep"` model is installed, preferring one already loaded.
- `stems?: string[]`: Which stems to keep, e.g. ["vocals"]. Omit for all of them. A name nothing answers to is reported back, not silently dropped.
- `rest?: "discard" | "merge" = "discard"`: What happens to the stems not named: thrown away, or summed into one "rest" sound — the original minus what was taken out. Ignored when `stems` is omitted, since nothing is left over.

### `soundbox.list_models`: List sound models

List every model, generation and otherwise, with its status and licence. `task` says which surface a model belongs to — "gen" for soundbox.generate, "tts" for the speech tools, "sep" for soundbox.separate — and calling one on the wrong surface is refused. Check `commercial_use` before using output commercially. `supports` says which optional soundbox.generate arguments a model takes: `lyrics`, `negative_prompt`, `seed`, and the `extend` / `cover` / `repaint` edits. For a text-to-speech model this is also where the `delivery` knobs it accepts come from — the authority on those names, since a wrong one is ignored silently rather than rejected.

No arguments.

### `soundbox.list_sounds`: Search the sound library

Search previously generated sounds. Use this before generating — the sound you want may already exist. Pass `voice_id` for what one saved voice has already said.

- `q?: string`: Text to match in prompt or name.
- `tag?: string`: Filter by tag.
- `voice_id?: string`: Only sounds read in this saved voice (an id from soundbox.list_voices). Multi-voice dialogues are not filed under any one speaker.
- `limit?: integer = 20 (1–100)`

### `soundbox.get_sound`: Get one sound

Fetch a single sound by id, including its absolute file path.

- `sound_id: string`

### `soundbox.delete_sound`: Delete a sound

Permanently delete a sound and its audio file.

- `sound_id: string`

### `soundbox.list_voices`: List saved voices

List the saved voices a script can be read in. Call this before writing a story so lines can be cast to real voice ids.

No arguments.

### `soundbox.speak`: Speak a line or a dialogue

Read text aloud in a saved voice and save it to the library. One line or several with different voices, each on its own voice's model unless `model` overrides it. Blocks until the audio is on disk. `delivery` shapes the performance — never write stage directions into the text, they get read aloud. For anything you want to keep and arrange, build a story instead.

- `lines: object[]`: The script. Several lines with different voice_ids is a dialogue.
- `model?: string`: A text-to-speech model id for every line. Omit it and each line is read on its voice's own model (list_voices' `model_id`), or a ready one for a line with no voice or a voice with no model.
- `gap_s?: number (0–5)`: Silence between lines. Default 0.4.
- `name?: string`
- `delivery?: object`: How to read it, using this model's own option names — see the `delivery` list from soundbox.list_models (e.g. {"exaggeration": "1.4"}). Unknown names are ignored silently, so take them from there.

### `soundbox.create_story`: Start a story

Create a story — a script that persists, whose lines carry a place in time and can be voiced, arranged and mixed down. `delivery` here sets how every line is read unless it overrides it.

- `title?: string`: What this story is.
- `delivery?: object`: How every line in this story should be read unless it says otherwise. Set it here rather than per line — a script usually wants one delivery throughout and an exception on a line or two.

### `soundbox.list_stories`: List stories

List existing stories, most recently worked on first.

- `limit?: integer = 20 (1–200)`

### `soundbox.get_story`: Read a story

Fetch a story with every line: text, voice, timing, and whether it has been voiced yet, plus each touched track's mix and device chain. A clip placed from the MIDI panel also carries `midi`: its notes, tempo, instrument and cover prompt (read-only). This is how you inspect what you have built.

- `story_id: string`

### `soundbox.add_lines`: Add lines to a story

Append lines to a story's script — spoken lines, pauses, or existing library sounds dropped onto the timeline. Adds many at once, each with its own `delivery` if one line should be read differently.

- `story_id: string`
- `lines: object[]`

### `soundbox.update_line`: Edit or arrange a line

Change a line's words, voice, delivery, or where it sits in time — start, track, gain, mute, and the trim that shortens a clip without destroying audio. Changing words or delivery needs the line re-read before it is heard.

- `line_id: string`
- `text?: string`
- `speaker?: string`
- `voice_id?: string`
- `track_index?: integer (-16–16)`
- `start_s?: number (0–)`
- `muted?: boolean`
- `gain_db?: number (-40–24)`
- `duration_s?: number (0–600)`: How much of the clip plays — shorten a clip without destroying its audio.
- `trim_start_s?: number (0–)`: How far into the source sound the clip begins.
- `delivery?: object`: How to read this line, overriding the story's. `{}` puts it back on the story's delivery. Re-read the line afterwards for it to be heard.

### `soundbox.speak_story`: Voice a story

Read every line of a story that has no audio yet, in its assigned voice and on that voice's own model unless `model` overrides it. Blocks until they are all recorded. This is the slow one.

- `story_id: string`
- `model?: string`: A text-to-speech model id for every line. Omit it and each line is read on its voice's own model (list_voices' `model_id`), or a ready one for a line with no voice or a voice with no model.
- `regenerate?: boolean = false`: Re-read lines that already have audio, not only the silent ones.

### `soundbox.open_in_studio`: Open a sound in the studio

Open a library sound on a timeline, split into its stems on separate tracks where that is possible. Name `stems` to lay out only some of them. Reuses stems the sound already has rather than making more.

- `sound_id: string`
- `separate?: boolean = true`: Split it into stems first, each on its own track. Ignored for a sound that is already a stem or an edit.
- `stems?: string[]`: Which stems get a track, e.g. ["vocals", "drums"]. Omit for all of them.
- `rest?: "discard" | "merge" = "discard"`: What happens to the stems not named: thrown away, or summed into one "rest" track — the original minus what was taken out.

### `soundbox.mix_track`: Mute, solo or set a track's level

Control one lane of a story: name it, mute it, solo it, or set its volume. These belong to the lane, not to the clips on it.

- `story_id: string`
- `track_index: integer (-16–16)`: Which lane.
- `name?: string`
- `muted?: boolean`
- `soloed?: boolean`: With any track soloed, only soloed tracks are heard.
- `gain_db?: number (-40–24)`

### `soundbox.add_device`: Add an effect to a track

Put a device (compressor, eq, reverb, delay, distortion, gate, limiter, autotune) on one lane of a story, at the end of its chain or at `position`. It starts at its defaults; pass `params` to set knobs as it goes on. The studio's device rack shows it straight away. Heard in the studio's playback and in soundbox.export_story's mixdown.

- `story_id: string`
- `track_index: integer (-16–16)`: Which lane.
- `kind: "compressor" | "eq" | "reverb" | "delay" | "distortion" | "gate" | "limiter" | "autotune"`
- `params?: object`
- `bypassed?: boolean`
- `position?: integer (0–)`: Where in the chain, from 0. Omit to add it last.

### `soundbox.set_device`: Turn a device's knobs

Change the knobs on a device already on a track, or bypass it (it stays in the chain with its settings, out of the signal path). Name the device by its id, or by kind when the track has only one of that kind. Values past a knob's range land at its end, and the result says which did.

- `story_id: string`
- `track_index: integer (-16–16)`
- `device: string`: The device's id, or its kind when the track has one.
- `params?: object`
- `bypassed?: boolean`: true takes it out of the signal path and keeps its settings.

### `soundbox.remove_device`: Take an effect off a track

Remove one device from a track's chain, by id, or by kind when the track has only one of that kind. Use `bypassed` on soundbox.set_device instead to switch it off and keep its settings.

- `story_id: string`
- `track_index: integer (-16–16)`
- `device: string`: The device's id, or its kind when the track has one.

### `soundbox.remove_track`: Remove a track

Delete a lane and the clips on it. Lanes above slide down. Use soundbox.get_story first if you are not certain what is on it.

- `story_id: string`
- `track_index: integer (-16–16)`

### `soundbox.delete_line`: Delete a line

Remove one line from a story. Its audio stays in the library.

- `line_id: string`

### `soundbox.split_line`: Split a line in two

Cut a voiced line at a point in it, as it plays on the timeline, giving two clips. The words stay with the first half — there is no honest way to know which fell either side of the cut.

- `line_id: string`
- `at_s: number`: Seconds into the line as it plays on the timeline, after any trim.

### `soundbox.export_story`: Mix a story down

Mix the whole arrangement to one sound, honouring where each clip sits, its trim, its gain, and whether it is muted, with each track run through its device rack.

- `story_id: string`

### `soundbox.studio_context`: Read the open studio

What the studio open in Mirli shows right now: its lanes (name, mute, solo, effects), every clip with its id, lane, position and label, the playhead, the selection and the voices a line can be cast to. Needs a studio open in the app; omit story_id when there is only one. Read this before soundbox.studio_apply — its ids are the only ones that will apply.

- `story_id?: string`: Which studio. Omit when only one is open.

### `soundbox.studio_apply`: Edit the open studio



- `story_id?: string`: Which studio. Omit when only one is open.
- `actions: object[]`: The edits, in order. See the description for each action's shape.
- `summary?: string`: One line for the studio's toast and history, in the user's terms.
- `allow_delete?: boolean = false`: Let delete_clip actions run. Ask the user first.

### `soundbox.search_docs`: Search Mirli's documentation

Find the sections of Mirli's own documentation (README and docs/) that answer a question — which model to use, licences, stems, the studio, connecting agents. Returns each section's source file, heading and text. Quote these rather than guessing how Mirli works.

- `query: string`: The question, in plain words.
- `limit?: integer = 4 (1–8)`

## HTTP API quick reference

- Base URL `http://127.0.0.1:17494`, JSON in and out.
- The `Host` header must be `localhost`, `127.0.0.1` or `[::1]` (or a name in `MIRLI_ALLOWED_HOSTS`); anything else is `403`. This blocks DNS rebinding.
- `POST`, `PUT`, `PATCH` and `DELETE` under `/api/` need `Content-Type: application/json` (or a raw audio type on uploads) or an `X-Soundbox` header, or they get `403`.
- With `MIRLI_API_TOKEN` set, `/api/*`, `/v1/*`, `/mcp`, `/files` and `/artwork` need `Authorization: Bearer <token>`; `GET /api/health` stays open.

### Is it running, and on what hardware?

Version, `device` (`cuda`, `metal` or `cpu`), GPU name, VRAM, loaded model and queue length. Stays open even when a token is set.

```bash
curl http://127.0.0.1:17494/api/health
```

### Which models are there?

Every enabled model with `status` (`installed`, `loaded`, …), licence, `max_duration_s` and `vram_estimate_mb`.

```bash
curl http://127.0.0.1:17494/api/models
```

### Download a model

Returns `202 { job_id }`. A POST with no JSON body needs the `X-Soundbox` header.

```bash
curl -X POST -H 'X-Soundbox: 1' \
  http://127.0.0.1:17494/api/models/audiocpp-stable-audio-3-sfx/download
```

### Render and get the WAV back in one call

`POST /api/render` runs one job, waits, and answers `200 audio/wav`. The body is a `/api/generate` or `/api/speak` body. `400` on bad input, `429` when the queue is full.

```bash
curl -X POST http://127.0.0.1:17494/api/render \
  -H 'Content-Type: application/json' \
  -d '{"model":"audiocpp-stable-audio-3-sfx","prompt":"heavy wooden door slam, dry room","duration_s":3}' \
  -o door.wav
```

### Queue a generation and follow the job

`POST /api/generate` returns `202 { job_id }`. Poll `GET /api/jobs/{id}` (or `GET /api/jobs/{id}/events` for server-sent events) until `status` is `done`, then read `result.sounds`.

```bash
curl -X POST http://127.0.0.1:17494/api/generate \
  -H 'Content-Type: application/json' \
  -d '{"model":"audiocpp-stable-audio-3-sfx","prompt":"glass bottle shattering on tile","duration_s":2,"variations":2}'

curl http://127.0.0.1:17494/api/jobs/<job_id>
```

### Find a sound and its file

`GET /api/sounds` searches the library; each sound carries `path` (absolute) and `duration_s`.

```bash
curl 'http://127.0.0.1:17494/api/sounds?q=door&limit=5'
curl http://127.0.0.1:17494/api/sounds/<sound_id>
```

### Stream speech as it is made

`POST /api/speak/stream` sends server-sent events with base64 16-bit PCM, or raw PCM with `format: "pcm"`. Not a job: it holds the GPU, never queues (`409` when busy), and closing the connection cancels it.

```bash
curl -N -X POST http://127.0.0.1:17494/api/speak/stream \
  -H 'Content-Type: application/json' \
  -d '{"model":"audiocpp-supertonic-3","text":"Halt! Who goes there?","format":"sse"}'
```

The full route list is at https://mirli.app/docs/api/.

## Environment variables

| Variable | Read by | What it does |
|---|---|---|
| `MIRLI_DATA_DIR` | server | The data folder. Default `~/.mirli`, or `~/.soundbox` when that exists and `~/.mirli` doesn't. `--data-dir` does the same for one run. |
| `MIRLI_AUDIOCPP_BIN` | server | Absolute path to an `audiocpp_cli` of yours. Nothing is downloaded. |
| `MIRLI_LLAMA_SERVER_BIN` | server | The same, for `llama-server`. |
| `MIRLI_SD_SERVER_BIN` | server | The same, for `sd-server`. |
| `MIRLI_AUDIOCPP_BACKEND` | server | Force the audio.cpp backend instead of detecting it: `cuda`, `hip`, `metal`, `vulkan`, `cpu`. |
| `MIRLI_LLAMA_SERVER_BACKEND` | server | Changes the backend that `soundbox model status llm` and the app report for `llama-server`. It does not change the download; use `soundbox model install llm --backend <NAME>` for that. |
| `MIRLI_SD_SERVER_BACKEND` | server | Changes the backend the app reports for `sd-server`. It does not change the download. |
| `MIRLI_ALLOW_UNVERIFIED_BINARIES` | server | `1` installs an engine archive that no published SHA-256 covers. Off by default. A checksum mismatch is refused regardless. |
| `HF_TOKEN` / `HUGGING_FACE_HUB_TOKEN` | server | Hugging Face token for gated models, used when none is saved in Settings. |
| `HF_HOME` | server | Hugging Face cache location. Left alone if set; otherwise Mirli points it at `<DATA_DIR>/models`. |
| `MIRLI_API_TOKEN` | server, stdio MCP bridge, CLI | An access token of at least 16 characters. Set on the server, every `/api/*`, `/v1/*`, `/mcp`, `/files` and `/artwork` request needs it as `Authorization: Bearer <TOKEN>` or a session cookie from the UI's sign-in screen; `GET /api/health` stays open. Set for the stdio bridge, `soundbox ps` or `soundbox enhance`, it is sent to the server. See Access token. |
| `MIRLI_ALLOWED_HOSTS` | server, Vite | Comma-separated `host` (any port) or `host:port` (that port only). Adds `Host` values the server accepts (UI, `/api/*` and `/mcp`) and trusted browser origins (CORS and the MCP `Origin` check); under `npm run dev` also Vite's `server.allowedHosts`, which reads it only as `SOUNDBOX_ALLOWED_HOSTS`. See Host checks and SECURITY.md. |
| `MIRLI_SANDBOXED` | server | `1` for a server whose users don't own the machine: nothing in the UI touches the host. See Sandboxed mode. |
| `MIRLI_DISABLE` | server | Comma-separated capabilities to turn off (`filesystem`, `reveal`, `downloads`, `local_models`, `custom_endpoints`, `updates`, `gpu_status`, `agent_connect`, `skills_install`, `logs`, `setup_wizard`). Turning off `custom_endpoints` also locks the prompt assistant's and artwork's external URLs and the OpenTelemetry endpoint. |
| `MIRLI_URL` | stdio MCP bridge | Where the running server is. Default `http://127.0.0.1:17494`. Set `MIRLI_API_TOKEN` too if that server needs one. |
| `OTEL_EXPORTER_OTLP_ENDPOINT` | server | OpenTelemetry collector for MCP call traces and metrics. Wins over the Settings value. |
| `MIRLI_LOG_LEVEL` | server | `debug`, `info` (default), `warning`, `error` or `critical`; `warn` works too. Used when `--log-level` isn't given, so it reaches `npm run dev`, Docker and the desktop app, none of which pass the flag. An unknown value logs a warning and runs at `info`. See Troubleshoot a source install. |
| `MIRLI_IDLE_EXIT_MINUTES` | server | Exit (status 0) after this many minutes with no requests, none still being answered, and no queued or running jobs. For hosts that scale to zero and start the server again on the next request. Health checks don't count as use. Off by default. |
| `MIRLI_UPDATE_CHECK` | server | `0` (or `false`, `off`, `no`) turns off the daily "is there a newer version?" request, whatever Settings says; Settings shows the switch as locked. `npm run dev` sets it to `0`. See PRIVACY.md. |
| `MIRLI_UPDATE_URL` | server | Where the update check asks. Default `https://mirli.app/api/update`. |
| `PORT` | server, Vite | The Vite dev server's port (default 5174). The server also trusts it as a dev origin. |
| `SOUNDBOX_PORT` | `npm run dev`, Vite | The port `scripts/dev.mjs` starts the server on, and the port Vite proxies to. Default 17494. The `soundbox` CLI itself takes `--port`. |
| `SOUNDBOX_DEV_HOST` | `npm run dev`, Vite | The address Vite listens on (`0.0.0.0`, a LAN IP). Default localhost. The server stays on `127.0.0.1`. No authentication, so open it only on a network you trust. |
| `MIRLI_DESKTOP_PORT` | desktop shell | The port the desktop app starts, or adopts, its server on. Default 17494. Also read as `SOUNDBOX_DESKTOP_PORT`. |
| `SOUNDBOX_NODE` | desktop shell | The Node to run the built server with, if `node` is not on `PATH`. |
| `SOUNDBOX_PROJECT_ROOT` | desktop shell | The path to the checkout, if the shell can't find it from its own location. |
| `VITE_MOCK` | app build | `1` runs the UI against the in-browser fake backend (`npm run dev:mock` sets it). |
| `VITE_MOCK_FIXTURE` | app build | With `VITE_MOCK=1`, `demo` starts the fake backend from the demo library the screenshots are taken from (`npm run capture:media` sets it). |
| `VITE_REPO_URL` | app build | The repository URL in the app's links. Default `https://github.com/HamSanders/soundbox`. |
| `VITE_SITE_ORIGIN` | app and site builds | The absolute origin for canonical URLs and the site's RSS feed. |

## Hardware and limits

- **NVIDIA GPU:** CUDA. A few GB of VRAM covers the verified models; MiniMax Music 3 wants about 10 GB.
- **Apple silicon:** Metal, with installers for Apple silicon and Intel.
- **AMD or Intel GPU:** Runs on the CPU unless `MIRLI_AUDIOCPP_BACKEND=vulkan` is set. Vulkan is not yet confirmed on the verified models.
- **No GPU:** Works, slowly: a clip that takes seconds on a GPU takes minutes on the CPU.
- **Disk:** Model weights are one to ten gigabytes each, under `~/.mirli/models`.
- **Clip length:** `duration_s` 0.5–300, clamped to each model's own `max_duration_s` (see `soundbox.list_models`).
- **Concurrency:** One job at a time on one GPU; the rest queue. Streams never queue and answer `409` when the GPU is busy.
- **Long renders:** `/api/render` holds the request open. Behind a proxy with a ~100 s timeout, use `/api/generate` and follow the job.
- **Platforms:** Desktop installers for Windows 10/11 x64, macOS and Linux x64 (AppImage, .deb). Linux arm64 runs from source or Docker. Docker images are amd64 only.

## Full documentation

- [Installing with a coding agent](https://github.com/HamSanders/soundbox/blob/main/docs/INSTALL-AGENT.md): The step-by-step guide written for an agent.
- [Install](https://mirli.app/docs/install/): The CLI, audio.cpp backends, models, Docker, access tokens, every env var.
- [MCP reference](https://mirli.app/docs/mcp/): Every tool with arguments, the stdio bridge, telemetry, skills.
- [HTTP API](https://mirli.app/docs/api/): Every route, request rules, job and model shapes.
- [Streaming speech](https://github.com/HamSanders/soundbox/blob/main/docs/STREAMING.md): SSE and raw PCM speech streams, with client examples.
- [audio.cpp](https://mirli.app/docs/audiocpp/): The native engine, its backends and how to choose one.
- [Models](https://mirli.app/models/): Every model it runs, with its licence.

## Machine-readable files

- [This page as Markdown](https://mirli.app/developers/index.md): The same content, plain Markdown.
- [llms.txt](https://mirli.app/llms.txt): A curated map of the site for language models (llmstxt.org).
- [llms-full.txt](https://mirli.app/llms-full.txt): This page plus the MCP, API and install docs in one file.
- [server.json](https://github.com/HamSanders/soundbox/blob/main/server.json): The MCP Registry entry for the server.
- [AGENTS.md](https://github.com/HamSanders/soundbox/blob/main/AGENTS.md): How to build, test and change the code, for coding agents.
