Skip to main content

Bridge configuration

These are the Bridge's own settings. The server has none for it (see the server's configuration). The code is the Bridge's internal/config: bridge.go for the settings on this page, and config.go for the engine's.

The data folder and config.yaml​

Everything the Bridge keeps lives in its data folder. That is /bridge-data in the images (AUDIOSILO_BRIDGE_DATA), else --data, else ~/.audiosilo-bridge. Never point it at a library folder. It holds:

  • config.yaml, written 0600 when a setting is saved from the page. Until then the defaults and the environment apply;
  • the SQLite database bridge.db;
  • the sealed secrets/ and their key secret.key;
  • the tools the Bridge downloads;
  • librivox/, one state file per LibriVox fetch (Staging, resume and cleanup).

Settings are read from <data>/config.yaml, then overridden by AUDIOSILO_BRIDGE_* variables. An empty variable counts as unset. A variable that doesn't parse fails the start rather than being ignored.

A setting the environment sets is shown locked on the Bridge's page, since a value saved to the file would be overridden again at the next start. A save from the page never writes it, and the file keeps its own value for it.

SettingEnvironmentDefaultWhat it is
listenAUDIOSILO_BRIDGE_LISTEN (or --listen):8091the address its page listens on
server.urlAUDIOSILO_BRIDGE_SERVER_URLthe server, as the Bridge reaches it (http://audiosilo:8080 on a compose network). AUDIOSILO_BRIDGE_PAIR_CODE pairs with this address, and the page's pairing form starts with it. It is an absolute http(s) URL without credentials, query or fragment. Once paired, the Bridge keeps the address it paired with, with the pairing
public_urlAUDIOSILO_BRIDGE_PUBLIC_URLits page as your local network reaches it (http://192.168.1.10:8091). The heartbeat sends it as ui_url, and the console's Open its page links to it. Without it the console shows no link. The Workers tab's install command uses it, and so does install.sh when it is fetched at this address's host and port (see Installing a worker)
librariesAUDIOSILO_BRIDGE_LIBRARIES (<id>=<path>;<id>=<path>; a path may hold a comma)the server's own root pathwhere the Bridge sees each library, by the server's library id; absolute paths, each id once (see Library mappings)
mapping.check_minutesAUDIOSILO_BRIDGE_MAPPING_CHECK_MINUTES10how often the mappings are checked, 1 to 1440
AUDIOSILO_BRIDGE_PAIR_CODEpair at the start with this code from the console, when not paired yet (needs server.url)
AUDIOSILO_BRIDGE_SECRET_KEY<data>/secret.keythe key that seals the stored secrets (below)
AUDIOSILO_BRIDGE_DATA/bridge-data in the imagesthe data folder
PUID / PGID1000 / 1000the user and group the container runs the Bridge as (below)

AUDIOSILO_BRIDGE_PAIR_CODE is for the first start. A code works once and only for 15 minutes, and a paired Bridge ignores it. Remove it after pairing.

The engine's settings are tools, asr, agent, supervisor, contribution and metadata, with AUDIOSILO_BRIDGE_TOOLS_*, _ASR_*, _AGENT_* and so on. They came over from audiosilo-sidecars and apply to the engine that runs behind sidecars.generate. They are read at the start, so restart to apply them. The exceptions are asr.worker_fallback and agent.monthly_budget_usd: the page edits them, and they apply live (see the tables below).

The full and cuda images set AUDIOSILO_BRIDGE_ASR_BACKEND=whisper-cpp and AUDIOSILO_BRIDGE_ASR_WHISPER_CLI_PATH=/opt/whisper/whisper-cli for their bundled speech recognition.

Podcasts​

These settings are read at startup, so restart after editing the file or the environment. They apply to guarded feed, artwork and audio requests, independently of speech recognition and the agent.

SettingEnvironmentDefaultWhat it is
podcasts.allow_networksAUDIOSILO_BRIDGE_PODCASTS_ALLOW_NETWORKS[]the CIDR list explicitly allowed for feed, artwork and episode audio fetches: a YAML array, comma-separated in the environment. Invalid CIDRs fail startup. Private, loopback and other non-public addresses are blocked unless allowed, so grant only the ranges needed
podcasts.max_feed_mbAUDIOSILO_BRIDGE_PODCASTS_MAX_FEED_MB32the feed response cap in MiB after decompression, 1 to 64. It is separate from the 24 MiB saved-file cap measured without the repeated folder name (32 MiB absolute) and the fixed 10 MiB artwork cap
podcasts.max_episode_mbAUDIOSILO_BRIDGE_PODCASTS_MAX_EPISODE_MB1024the whole-episode cap in MiB, an integer from 1 to 4096. It is checked against the GET length or resume total and against the received bytes, separately from the feed and artwork limits. It does not use the feed's size estimate

Audio staging is on the show's filesystem, not an agent work volume. That filesystem should support hard links; one that doesn't falls back to a no-replace rename. Keep space for staged downloads and for retained protected episodes.

The server's per-show retention policy is a preference in the server's API and database. It is not a Bridge config key or a disk quota. The default is Keep 3 with seven days' grace. See retention.

These are not Bridge settings:

  • The server's toggle is modules.podcasts.enabled, environment AUDIOSILO_MODULES_PODCASTS_ENABLED, default false.
  • Podcast directory search runs on the server, and the Podcast Index key pair is a server environment variable (server configuration). The Bridge has no directory credential.
  • On-demand fetching adds no configuration key. The reserved interactive download slot is a fixed runner capacity, described in claims and leases.

The internet check after a failed feed connection has no setting of its own. It connects to the host of metadata.base_url and to archive.org:443, sending nothing (Internet reachability).

See Podcasts for the HTTP guard, the on-disk format and the secrets.

ASR workers​

SettingEnvironmentDefaultWhat it is
asr.worker_fallbackAUDIOSILO_BRIDGE_ASR_WORKER_FALLBACKlocalwhat a segment does when no ASR worker is connected. local uses the Bridge's own asr.* backend, and a Bridge with none waits anyway. With wait the book parks asr_worker_waiting until a worker connects. Unlike the rest of asr.* it applies live, to the next segment. The page's Settings edits it, and it is locked when the environment sets it
asr.threadsAUDIOSILO_BRIDGE_ASR_THREADS0whisper.cpp's thread count for the Bridge's own (CPU) transcription. 0 keeps whisper.cpp's default of 4. On a 20-core Mac Studio in Docker, 16 threads ran 3x faster (1.4x real time against 0.4x to 0.5x). Leave room for what else the machine runs. Read at the start

The worker itself takes flags, not this file: --bridge, --token, --data, --backend, --model and --whisper-cli, plus AUDIOSILO_WORKER_DATA and AUDIOSILO_WORKER_TOKEN. How an update chooses each of them is in the service.

Characters and recaps​

The settings sidecars.generate adds, or that matter most to it:

SettingEnvironmentDefaultWhat it is
agent.backendAUDIOSILO_BRIDGE_AGENT_BACKENDclaude (empty is claude)what the agent container runs for this Bridge: claude, codex, or openai-compatible (codex against an OpenAI-compatible endpoint, which must offer the Responses API). The page's Settings > Agent edits it, and the variable locks it there. A change applies at the next start
agent.openai_compatible.base_urlAUDIOSILO_BRIDGE_AGENT_OPENAI_COMPATIBLE_BASE_URLthe endpoint's address up to /v1 (https://api.openai.com/v1, http://192.168.1.20:11434/v1): http or https, with no user name, password or query. Required by openai-compatible. Its API key is set on the page, never here, and is kept for the address it was entered for: another address, set anywhere, removes it. Applies at once
agent.openai_compatible.modelAUDIOSILO_BRIDGE_AGENT_OPENAI_COMPATIBLE_MODELthe model every agent stage uses on the endpoint. It must call tools and take a long context. An endpoint has no default model, so openai-compatible needs this or a model for every stage. Applies at once
agent.openai_compatible.modelsa map from an agent stage to its own endpoint model, replacing model for that stage (config or the page). A key that isn't an agent stage stops the start
agent.staging_dirAUDIOSILO_BRIDGE_AGENT_STAGING_DIR<data>/stagingthe folder shared with the agent container (absolute). The compose example mounts a volume at /staging, outside /bridge-data, because the first start's ownership fix of /bridge-data would otherwise reach it
agent.endpoint_staging_dirAUDIOSILO_BRIDGE_AGENT_ENDPOINT_STAGING_DIRthe folder shared with the endpoint's own agent service (agent-runner --endpoint-only), where openai-compatible runs go: an absolute path on another volume than agent.staging_dir (compose uses /endpoint-staging). Unset, endpoint runs don't run (Problem endpoint_service). Applies at the next start
agent.require_groupAUDIOSILO_BRIDGE_AGENT_REQUIRE_GROUPfalsenever hand the Accounts tab's credential to every uid on the staging volume: where the Bridge would fall back to that, the agent is unavailable instead (Problem group_required). A value that isn't a boolean stops the start. See agent.require_group
agent.claim_timeout_secondsAUDIOSILO_BRIDGE_AGENT_CLAIM_TIMEOUT_SECONDS120how long an agent job waits for the container to claim it before the book parks agent_unavailable (10 to 3600)
agent.monthly_budget_usdAUDIOSILO_BRIDGE_AGENT_MONTHLY_BUDGET_USD100the monthly agent spend cap across every book, for the calendar month in UTC. 0 = no cap. The page's Settings tab edits it, and it is locked when the environment sets it. It applies live: the engine reads it per run (pipeline.Config.MonthlyBudget is a func). A save that changes it resumes the books and description jobs parked budget_exceeded (Parks). One still over the new cap parks again until the next month
agent.budget_reviewed_atwhen an admin last saved the monthly budget on the page (RFC 3339, "" for never). The save writes it, and it is not meant to be set by hand. The setup checklist's budget item is done when it is set or the environment sets the budget (Config.BudgetReviewed)
agent.book_budget_usdAUDIOSILO_BRIDGE_AGENT_BOOK_BUDGET_USD75one book's agent spend cap, read at the start (below)
transcripts.retention_daysAUDIOSILO_BRIDGE_TRANSCRIPTS_RETENTION_DAYS30days a finished book's transcripts are kept after its job ends (0 to 3650; 0 = deleted when it ends)
supervisor.automatic_actionsAUDIOSILO_BRIDGE_SUPERVISOR_AUTOMATIC_ACTIONSonthe supervisor's bounded recoveries: a retry, a readmit, a requeue, each capped per book per day. On by default, because an admin starts the jobs in the console and leaves them to run

supervisor.model_assisted, supervisor.model_automatic_actions and the backend failover are forced off, whatever the file or the environment says. They would run an agent CLI inside the Bridge, which the Bridge never does.

The Bridge's page shows the agent, the speech recognition, the budgets with this month's spend, and the retention on its Status tab (GET /api/engine). It says where each is set:

  • the monthly budget on its Settings tab, or by its variable, read at the next start;
  • the per-book cap and the retention in config.yaml, read at the next start.

That start re-admits a job parked budget_exceeded, unless the caps would park it again with the same reason, figures included.

  • A changed cap, raised or lowered, re-admits it.
  • An unchanged cap re-admits it too when the month's spend grew after a monthly park.
  • A job still over a cap parks again before it spends anything (Parks).

Contributing: GitHub​

Contributions (contribute: issue, sidecars.contribute, meta.correct) file issues on the community repositories with a GitHub token. contrib.TokenSource.Resolve picks one per use, in this order. It returns which one as from (env, device or gh), the page's from. It passes over a token GitHub refused: an environment or gh token until it changes, and the sign-in until there is a new one.

  1. AUDIOSILO_BRIDGE_GITHUB_TOKEN (env), a token of the admin's own. It must be a fine-grained token that can open issues on the community repos and create gists, since a body too long for an issue goes in a gist made with the same token. The Bridge reads it live from the environment at each use, and never seals it. An older Bridge's start sealed it as github_pat. A start now deletes that copy once (forgetSealedGitHubPAT). That is best effort: a copy sealed with another key, or a failed delete, never stops the start.
  2. The Accounts tab's sign-in (device), a user token of the AudioSilo Contributions GitHub App from its device flow, refreshed before it expires (see Contributions).
  3. gh auth token (gh), the gh CLI's sign-in, for a Bridge run outside a container. The token never enters argv, a log or an error.

The heartbeat's can_contribute (see Pairing and jobs) means "a token resolves and GitHub hasn't refused it".

SettingEnvironmentDefaultWhat it is
AUDIOSILO_BRIDGE_GITHUB_TOKENa GitHub token that wins over the sign-in while GitHub accepts it (above). Never logged, never sealed
github.client_idAUDIOSILO_BRIDGE_GITHUB_CLIENT_IDthe App's (ghauth.DefaultClientID, Iv23likw0zS13hG4spdo)the GitHub App the Accounts tab signs in to: letters, digits, ., _, -, at most 64. Empty uses the built-in one at each use, so a saved config.yaml never pins it. Set it only for a fork running its own App
github.web_base_urlAUDIOSILO_BRIDGE_GITHUB_WEB_BASE_URLhttps://github.comwhere the device-code and token endpoints live (an absolute http(s) URL), set for a test against a fake GitHub
contribution.api_base_urlAUDIOSILO_BRIDGE_CONTRIBUTION_API_BASE_URLhttps://api.github.comthe GitHub REST API root the issues, the user lookup and the revoke go to

The App itself:

Id and slug5387686, audiosilo-contributions
Visibilitypublic, since a private App can be authorized by its owner only
Sign-indevice flow on, user tokens expiring
Repository permissionsIssues read and write, and Metadata read, on the repositories it is installed on (audiosilo-meta and audiosilo-meta-community)
Account permissionsGists read and write. A characters or recaps file too long for an issue goes in a secret gist
Webhookinactive

The App's client ID ships in the Bridge. No client secret exists or is needed. Meta routes issues on the App's id; see Contributing data.

The agent container has no config file of its own. Its flags (--staging, --home, --slots) and its credentials are in The agent container. The credentials are CLAUDE_CODE_OAUTH_TOKEN, ANTHROPIC_API_KEY, OPENAI_API_KEY and CODEX_API_KEY, from its environment or /agent/secrets/<lowercase name>. The Bridge can hold the agent's credential instead, on the Accounts tab, and hand it to the container per run. See The credential hand-off.

Audible​

Audible accounts (Audible) have no settings.

  • An admin signs in and maps each account on the Accounts tab. Its sign-in is sealed in the vault as audible_<id> (Secrets).
  • The server's audible module decides whether the accounts are polled and backed up (modules.audible.enabled on the server; see its configuration).
  • An account's backup policy, placement template and position sync are set in the console.

Allow about 2.2 times the largest book's size in the Bridge's data folder. The Bridge uses <data>/audible/tmp/ (0700) for the download and decrypted audio. A backup that fails keeps its decrypted copy there for the next try. At startup the Bridge removes downloads and decrypted copies at least seven days old, and unfinished decrypts at once. See Resume and temp files.

Backups decrypt with the same ffmpeg the Bridge's other jobs use: the one its engine resolved at start, else tools.ffmpeg_path (AUDIOSILO_BRIDGE_TOOLS_FFMPEG_PATH), else ffmpeg on the PATH. Every image has one.

Two variables exist only in a build with the audiblefake tag, for development and tests. Release builds and images never carry the tag, so there they do nothing:

EnvironmentWhat it is
AUDIOSILO_BRIDGE_AUDIBLE_FAKE_URLthe base URL of an Audible fake (go run -tags audiblefake ./cmd/audiblefake): every Audible and Amazon endpoint goes there instead
AUDIOSILO_BRIDGE_AUDIBLE_RECORD_DIRrecords every Audible exchange into a 0600 JSON-lines file in this folder, scrubbed of credentials as it is written. It is for recording fixtures from a real account

LibriVox​

librivox.fetch has no settings of its own. It reads LibriVox manifests from the engine's metadata.base_url (AUDIOSILO_BRIDGE_METADATA_BASE_URL, default https://meta.audiosilo.app). With it empty, the job fails metadata_off. It downloads only from archive.org, over https, through a guarded client that reaches public addresses only (the podcasts' allow_networks does not apply). The book's files go straight into the library's folder, staged in a hidden folder beside the book, so the library needs the room, not the data folder. See Add from LibriVox.

Secrets​

The Bridge's secrets are never in config.yaml. They are:

  • the token from the server;
  • the GitHub sign-in, github_user_token. The access token, the refresh token and both expiries are sealed as one value, so a refresh replaces the pair in one write;
  • the agent credentials set on the Accounts tab: claude_oauth_token, anthropic_api_key and openai_api_key, and the OpenAI-compatible endpoint's key, endpoint_api_key, kept for the address it was entered for;
  • each Audible account's sign-in, audible_<id>: its tokens and device key, with full Amazon account access.

github_pat is only ever deleted now (Contributing: GitHub).

Each secret is an AES-256-GCM sealed file in <data>/secrets/ (0600). The file is bound to its name, so a file renamed onto another name doesn't open. One master key seals them all:

  • AUDIOSILO_BRIDGE_SECRET_KEY: 32 bytes, as 64 hex characters or as base64. Use it to keep the key outside the data volume, so a copy of the volume alone can't open the secrets.
  • Otherwise <data>/secret.key, created (0600) on the first start.

Generate a key with, for example, openssl rand -hex 32. The startup log says where the key came from (environment, key file or new key file), never the key.

If the key changes (a different variable, a replaced key file):

  • the stored server token can't be opened, and the Bridge refuses to start, saying so;
  • a GitHub sign-in or an agent credential sealed with the old key reads as not set. Sign in and set it again;
  • an Audible account sealed with the old key can't be opened either. Sign in to it again.

The page's API never returns a secret. GET /api/accounts says which are set and when. For the agent it gives when its credentials last changed (set_at) and when each was saved (set_at_by_kind), which the page shows.

The page's password​

The page's own password is not a secret in this sense. It is hashed (argon2id) in the database, generated and printed once to the log on the first start, and changed on the page's Settings tab.

An owner who lost it runs audiosilo-bridge reset-password [--data DIR], from v0.3.0. In Docker that is docker exec -u PUID:PGID <container> audiosilo-bridge reset-password. The command:

  • prints a new generated password once, and signs every session out;
  • changes only the password hash and the sessions (app.ResetPassword). The pairing, the mappings, the jobs and the sealed secrets stay, and a running Bridge takes the new password at once;
  • refuses a folder with no Bridge database (a mistyped --data);
  • run as root, refuses a data folder another user owns, since SQLite's new files would be root's. It names the user to run it as.

The command goes before its flags. --data DIR reset-password is refused rather than starting the Bridge.

From v0.4.0 the first start's auth.Manager.EnsureAdmin creates the password only while none is stored (CreatePassword, one statement). So a first start racing a reset on the same data folder never overwrites the reset's password, and prints none.

PUID and PGID​

The images start as root only to own /bridge-data, the Bridge's own data and never a library. Then they drop to PUID:PGID (default 1000:1000) to run the Bridge, which never runs as root.

The data folder is given to that user, and made 0700, only when it isn't theirs yet: on the first start, or after a PUID/PGID change. So a large data folder isn't walked on every start. It is 0700 because it holds the page's password hash and sessions beside the sealed secrets. Files the Bridge creates are 0644 and folders 0755 (umask 022), so the server can read them whatever user it runs as.

Set PUID/PGID to the owner of your library folders, the same as the server, so the files the Bridge writes belong to the share's owner. On Unraid that is 99/100.

An explicit non-root user (docker --user, compose user:) makes the image skip the ownership change and the drop. So that user must own the data folder.

  • The image's own /bridge-data belongs to 1000:1000 (0700), so --user 1000:1000 works with it as it is.
  • A bind-mounted folder must be the user's.

The entrypoint warns when the folder isn't writable.

The images​

ghcr.io/kodestar/audiosilo-bridge, public from v0.3.0 (pulled with no login), built from one Dockerfile with four targets:

TagTargetWhat's in itArch
latestfull (the default)the Bridge, ffmpeg, and a CPU build of whisper.cpp for speech recognitionamd64, arm64
latest-slimslimthe Bridge and ffmpeg only: for a Bridge that never transcribes (including podcast feed following and checks)amd64, arm64
latest-cudacudaspeech recognition on an NVIDIA GPU (run with --gpus all) on the nvidia/cuda runtime baseamd64
latest-agentagentthe agent container: the pinned native claude and codex CLIs and the Bridge binary as their runner (audiosilo-bridge agent-runner), on Debian bookworm-slimamd64, arm64

Tags. The latest tags move only for a release tag (v1.2.3, not a pre-release such as v1.2.3-rc.1). A release tag also publishes <tag>, <tag>-slim, <tag>-cuda and <tag>-agent. A manual dispatch from a branch publishes under the branch's name (<branch>, <branch>-slim, <branch>-cuda, <branch>-agent), never over latest.

whisper.cpp. The native downloader and the full and cuda image builds fetch whisper-cli from the audiosilo-bridge release whisper-v1.9.1. Each downloads the archive for its platform and checks its SHA-256 against the release's checksums.txt. When the pinned tag changes, the native downloader keeps a cached whisper-cli whose SHA-256 the new release's checksums.txt lists for the same build, and re-stamps it with the new tag. Any other cached build, a CPU fallback included, is downloaded again. The Bridge downloads the speech model into its data folder on first use.

Worker builds. latest, latest-slim and latest-cuda (not agent) also carry the gzipped ASR worker builds that the Bridge serves to the computers that run a worker, in /usr/local/share/audiosilo-bridge/workers (see Installing a worker).

Only the agent image carries an AI agent's command-line tool. The Bridge's own images never do, and the Bridge never runs one. Run the same version of the Bridge and its agent image, since they check each other's protocol version.

Running it beside a server​

compose.example.yaml in the Bridge's repository runs the server, the Bridge and its agent container together (its header comment left out):

name: audiosilo

services:
audiosilo:
image: ghcr.io/kodestar/audiosilo-server:latest
restart: unless-stopped
environment:
PUID: "1000"
PGID: "1000"
ports:
- "8080:8080"
volumes:
- ./server-data:/data
- /path/to/audiobooks:/audiobooks:ro

bridge:
# :latest is the full image (CPU transcription); :latest-slim has no
# whisper.cpp, :latest-cuda transcribes on an NVIDIA GPU (amd64).
image: ghcr.io/kodestar/audiosilo-bridge:latest
restart: unless-stopped
depends_on: [audiosilo]
environment:
PUID: "1000"
# &bridge_pgid names this value: the agent container's group_add below
# follows it, so change it here only.
PGID: &bridge_pgid "1000"
# The server as the Bridge reaches it on this network.
AUDIOSILO_BRIDGE_SERVER_URL: http://audiosilo:8080
# The Bridge's page as your LAN reaches it (the console links to it).
AUDIOSILO_BRIDGE_PUBLIC_URL: http://192.168.1.10:8091
# First start only: a code from the server's console.
# AUDIOSILO_BRIDGE_PAIR_CODE: XXXX-XXXX-XXXX-XXXX
# Keep the secrets' key outside the data folder (32 bytes, hex or base64):
# AUDIOSILO_BRIDGE_SECRET_KEY: ...
# The folder shared with the agent container (below). Kept outside
# /bridge-data, whose first-start ownership fix would otherwise reach it.
AUDIOSILO_BRIDGE_AGENT_STAGING_DIR: /staging
# The folder shared with agent-endpoint, where an OpenAI-compatible
# endpoint's runs go (another volume than the one above).
AUDIOSILO_BRIDGE_AGENT_ENDPOINT_STAGING_DIR: /endpoint-staging
# The CLI the agent container runs: claude (the default), codex, or
# openai-compatible (codex against the endpoint below, which needs the
# Responses API; set its key in Settings > Agent). These lock the
# page's Settings > Agent fields; leave them out to set them there.
# AUDIOSILO_BRIDGE_AGENT_BACKEND: codex
# AUDIOSILO_BRIDGE_AGENT_OPENAI_COMPATIBLE_BASE_URL: http://192.168.1.20:11434/v1
# AUDIOSILO_BRIDGE_AGENT_OPENAI_COMPATIBLE_MODEL: qwen3:32b
# Never hand the agent credential to every user on the staging volume
# (the agent waits instead, saying why, when it can't be kept to the
# group_add group below):
# AUDIOSILO_BRIDGE_AGENT_REQUIRE_GROUP: "true"
# A GitHub token (a fine-grained one that can open issues on the community
# repos) lets a job contribute its characters and recaps (contribute: issue).
# Read live and never stored; while set it is used instead of the Accounts
# tab's GitHub sign-in.
# AUDIOSILO_BRIDGE_GITHUB_TOKEN: ${AUDIOSILO_BRIDGE_GITHUB_TOKEN}
ports:
- "8091:8091"
# An OpenAI-compatible server on this same host (the agent's line below):
# Settings > Agent's Test connection runs from the Bridge, so it needs the
# name too.
# extra_hosts: ["host.docker.internal:host-gateway"]
volumes:
- ./bridge-data:/bridge-data
- /path/to/audiobooks:/audiobooks:rw
# Shared with the agent container, at the Bridge's agent.staging_dir.
# The only volume both mount.
- staging:/staging
# Shared with agent-endpoint, at agent.endpoint_staging_dir.
- endpoint-staging:/endpoint-staging

agent:
image: ghcr.io/kodestar/audiosilo-bridge:latest-agent
restart: unless-stopped
user: "10002:10002"
# The Bridge's PGID above (see the notes below).
group_add: [*bridge_pgid]
environment:
# By name only: the value comes from your shell or .env and is never
# written here. Set the one you use; the runner reports which it found.
- CLAUDE_CODE_OAUTH_TOKEN
# - ANTHROPIC_API_KEY
# - OPENAI_API_KEY
volumes:
- staging:/staging
- agent-config:/agent
networks: [agent]
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
read_only: true
tmpfs: ["/tmp"]
# A stop cancels the runs in progress: SIGTERM, then SIGKILL 10 s later.
stop_grace_period: 20s

# An OpenAI-compatible endpoint's own agent service: started only with
# --profile endpoint. Keep it apart from the agent container: its own user
# (never the agent's 10002), its own staging volume, no /agent volume (nor
# agent-config, or a CLI's login, at any other path) and no credential in its
# environment. The runner refuses its runs otherwise.
agent-endpoint:
image: ghcr.io/kodestar/audiosilo-bridge:latest-agent
profiles: [endpoint]
restart: unless-stopped
user: "10003:10003"
# The bridge's PGID, as for the agent container: the endpoint's key is
# handed to this group alone.
group_add: [*bridge_pgid]
# The runner is the container's first process, with no tini before it: a
# run's commands share its user, and could read or trace any other.
entrypoint: ["audiosilo-bridge"]
command: ["agent-runner", "--endpoint-only", "--staging", "/staging"]
volumes:
- endpoint-staging:/staging
networks: [agent-endpoint]
# An OpenAI-compatible server on this same host (Ollama listening on
# 0.0.0.0): reach it as http://host.docker.internal:11434/v1.
# extra_hosts: ["host.docker.internal:host-gateway"]
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
read_only: true
tmpfs: ["/tmp"]
stop_grace_period: 20s

networks:
# The agent's own network: nothing else of this stack. It reaches out
# through the host like any container (the internet and your LAN).
agent: {}
# agent-endpoint's, apart from the agent container's too.
agent-endpoint: {}

volumes:
staging: {}
agent-config: {}
endpoint-staging: {}

The points that matter:

  • The same host folders, mounted at the same path in both containers: read-only for the server, read-write for the Bridge. Then the Bridge finds each library at the server's own root path and needs no mapping. Mounted elsewhere, map each library on the Bridge's page or with AUDIOSILO_BRIDGE_LIBRARIES.
  • AUDIOSILO_BRIDGE_SERVER_URL is the server as the Bridge reaches it, which on a compose network is the service name, not the address you open in a browser.
  • The same PUID/PGID for both, the owner of the library folders.
  • Port 8091 is the Bridge's own page. It answers only the local network (see Development), so don't put it behind a public reverse proxy.
  • The staging volume is the only one the Bridge and the agent share, at the Bridge's agent.staging_dir. The agent mounts no library and no Bridge data. It runs as 10002:10002 with every capability dropped, no-new-privileges, a read-only root and a tmpfs /tmp, on a network of its own. That network keeps it from the stack's other services, and it reaches the internet and the LAN through the host like any container. group_add adds the Bridge's PGID through the YAML alias *bridge_pgid, so a credential the Bridge hands over is readable by that group alone (see Keeping it to the Bridge's group). Change the PGID on the Bridge only, and the agent follows it. Its credentials come in by name from the shell or a .env file, and are never written into the compose file. See The agent container.
  • agent-endpoint starts only with docker compose --profile endpoint up -d, for the openai-compatible backend. It runs as 10003:10003 with its own staging volume (endpoint-staging, at the Bridge's agent.endpoint_staging_dir), no /agent volume and no credential, so an endpoint's run can't reach the subscriptions' credentials. Keep it that way: the runner refuses every run while it holds a credential or reaches the agent volume. See The endpoint's own agent service.
  • stop_grace_period: 20s gives the runner time to stop the runs in progress (SIGTERM, then SIGKILL 10 seconds later) and mark them done, so the Bridge hears about it at once.