DOCS/BUILD
SELF-HOSTED10 MIN READUPDATED 03 SEP 2026

BUILD / 01

Put the gateway where the source already lives.

A deployment guide for the FastAPI gateway, encrypted Vault, receipts, and optional upstream.
The self-hosted gateway is the primary production-shaped surface. Keep it on a trusted host or private container network, provide secrets through protected files or environment injection, and expose only the clients that need it.
RECOMMENDED

Run the hardened Compose stack

  • The gateway container runs as an unprivileged user with a read-only root filesystem.
  • Linux capabilities are dropped and no-new-privileges is enabled.
  • State lives in a named project volume; temporary paths are noexec tmpfs mounts.
  • The web service binds to loopback by default; the gateway remains on the private Compose network.
TERMINALbash
cp .env.example .env
docker compose build
docker compose up -d
docker compose ps
AUTHENTICATION

Use secret files in public mode

SHREDDAR_PUBLIC_MODE=true refuses to start without at least one API key and refuses wildcard CORS. Direct secret values and *_FILE variants are mutually exclusive.

.ENV — PATHS ONLYdotenv
SHREDDAR_PUBLIC_MODE=true
SHREDDAR_API_KEYS_FILE=/run/secrets/api_key
SHREDDAR_ALLOWED_ORIGINS=https://your-app.example
SHREDDAR_DATA_DIR=/var/lib/shreddar
SHREDDAR_DATABASE_PATH=/var/lib/shreddar/shreddar.sqlite
SHREDDAR_KEY_FILE=/var/lib/shreddar/vault.key
OPTIONAL INFERENCE

Configure one OpenAI-compatible upstream

Demo mode is enabled by default. A self-hosted operator can instead configure an upstream base URL and API key. The alpha supports non-streaming chat only.

ENVIRONMENTdotenv
SHREDDAR_DEMO_MODE=false
SHREDDAR_UPSTREAM_BASE_URL=https://provider.example/v1
SHREDDAR_UPSTREAM_API_KEY_FILE=/run/secrets/upstream_api_key
SHREDDAR_UPSTREAM_TIMEOUT_SECONDS=60
RELEASE CHECK

Verify before authorized data

  1. 01

    HEALTH

    Check /healthz and /readyz from inside the intended network boundary.

  2. 02

    AUTH

    Confirm missing and invalid credentials return 401 for protected routes.

  3. 03

    CORS

    Confirm only the exact application origins are accepted.

  4. 04

    FAIL CLOSED

    Test blocked credentials, local_only data, upstream timeout, and unsafe output.

  5. 05

    RECOVERY

    Prove database and key backup integrity, restore procedure, expiry cleanup, and rollback.

SHREDDAR DOCSYOUR DOC. YOUR DATA. YOUR CONTROL.

Public alpha documentation. Capability labels describe implementation state, not certification or guaranteed suitability.