Skip to content

Configuration

Fabric is configured via environment variables (.env file), a TOML config file, or CLI flags. Resolution order (lowest to highest precedence):

  1. Built-in defaults
  2. TOML config file (fabric.toml)
  3. Environment variables / .env file
  4. CLI flags

Copy the example .env and fill in the keys you need:

Terminal window
cp .env.example .env

Only DATABASE_URL is required. Everything else is optional — Fabric auto-detects available providers and falls back gracefully when keys are missing.

Fabric looks for a TOML config file in this order:

  1. --config <path> CLI flag
  2. FABRIC_CONFIG env var
  3. ./fabric.toml (current directory)
  4. $XDG_CONFIG_HOME/fabric/config.toml (or ~/.config/fabric/config.toml)

Fabric requires a Postgres database.

Local development — start Postgres via Docker Compose:

Terminal window
just infra-up-db

This starts Postgres on localhost:5432 with the default credentials. Then set:

Terminal window
DATABASE_URL=postgres://postgres:postgres@localhost:5432/fabric

Production — use your hosted Postgres (Supabase, Neon, RDS, etc.) and set the connection string:

Terminal window
DATABASE_URL=postgres://user:password@host:5432/fabric
VariableDefaultDescription
DATABASE_URL(required)Postgres connection string
DATABASE_DIRECT_URLBypasses connection pooler (for LISTEN/NOTIFY + migrations). Falls back to DATABASE_URL.
DATABASE_MIGRATION_URLSeparate connection string for migrations (overrides DATABASE_DIRECT_URL)
DATABASE_POOL_MAX15Maximum connections in the pool
DATABASE_POOL_MIN2Minimum idle connections in the pool

Each provider is auto-enabled when its API key is set. You only need the providers your workflows use — Fabric routes to the cheapest available provider by default.

Used for: text generation, image generation (DALL-E), embeddings.

  1. Go to platform.openai.com/api-keys
  2. Click “Create new secret key”
  3. Copy the key (starts with sk-)
  4. Add to .env:
Terminal window
OPENAI_API_KEY=sk-proj-...

Used for: text generation.

  1. Go to console.anthropic.com/settings/keys
  2. Click “Create Key”
  3. Copy the key (starts with sk-ant-)
  4. Add to .env:
Terminal window
ANTHROPIC_API_KEY=sk-ant-...

Used for: text generation, image generation (Imagen), vision.

  1. Go to aistudio.google.com/apikey
  2. Click “Create API key” and select a project
  3. Copy the key (starts with AIza)
  4. Add to .env:
Terminal window
GOOGLE_API_KEY=AIza...

Used for: image generation (Flux), video generation (Kling, Seedance), TTS (Kokoro), lip sync.

  1. Go to fal.ai/dashboard/keys
  2. Click “Create Key”
  3. Copy the key ID and secret (format: key-id:key-secret)
  4. Add to .env:
Terminal window
FAL_API_KEY=0723b521-...:31d73b24...

Used for: high-quality text-to-speech.

  1. Go to elevenlabs.io and sign up
  2. Click your profile icon → “Profile + API key”
  3. Copy the API key (starts with sk_)
  4. Add to .env:
Terminal window
ELEVENLABS_API_KEY=sk_...

Used for: various ML models on demand.

  1. Go to replicate.com/account/api-tokens
  2. Copy your API token
  3. Add to .env:
Terminal window
REPLICATE_API_TOKEN=r8_...

Used for: Seedance video generation.

  1. Go to console.byteplus.com and create an account
  2. Navigate to API Keys in your account settings
  3. Create and copy an API key
  4. Add to .env:
Terminal window
BYTEPLUS_API_KEY=your_key_here

Used for: semantic web search in research workflows (deep-research, problem-intelligence).

  1. Go to dashboard.exa.ai/api-keys
  2. Click “Create API Key”
  3. Copy the key
  4. Add to .env:
Terminal window
EXA_API_KEY=your_key_here

Used for: web page scraping and content extraction.

  1. Go to firecrawl.dev and sign up
  2. Navigate to your dashboard and copy your API key
  3. Add to .env:
Terminal window
FIRECRAWL_API_KEY=fc-...

Used for: downloading gated models (Llama, Mistral, etc.) for local inference.

  1. Go to huggingface.co/settings/tokens
  2. Click “New token” with at least read access
  3. Copy the token (starts with hf_)
  4. Add to .env:
Terminal window
HF_TOKEN=hf_...

Optionally set a custom cache directory:

Terminal window
HF_HOME=/path/to/huggingface/cache

Used for: free stock video footage for b-roll.

  1. Go to pexels.com/api
  2. Click “Your API Key” (sign up if needed)
  3. Describe your project and submit
  4. Copy the API key from your email or dashboard
  5. Add to .env:
Terminal window
PEXELS_API_KEY=your_key_here

Used for: free stock images.

  1. Go to unsplash.com/developers
  2. Click “Your apps”“New Application”
  3. Accept the terms and create the app
  4. Copy the Access Key (not the Secret Key)
  5. Add to .env:
Terminal window
UNSPLASH_ACCESS_KEY=your_access_key

These power research and ingestion workflows. Each one is optional — Fabric falls back to web search scraping when API keys are missing.

Used by: deep-research, problem-intelligence, trend-analyst, reddit-stories.

Without credentials, Reddit scraping is rate-limited to ~10 req/min and increasingly returns 403 errors. The free OAuth2 API gives 100 req/min.

  1. Go to reddit.com/prefs/apps (log in first)
  2. Scroll to the bottom and click “create another app…”
  3. Fill in:
    • name: fabric (or any name)
    • type: select script
    • description: optional
    • about url: leave blank
    • redirect uri: http://localhost (required but unused for script apps)
  4. Click “create app”
  5. Copy the values:
    • client ID — the string under the app name (e.g. a1b2c3d4e5f6g7)
    • client secret — labeled “secret”
  6. Add to .env:
Terminal window
REDDIT_CLIENT_ID=a1b2c3d4e5f6g7
REDDIT_CLIENT_SECRET=your_secret_here

Used by: problem-intelligence, trend-analyst, post-engagement.

  1. Go to developer.x.com/en/portal/dashboard
  2. Sign up for a developer account (free tier available)
  3. Create a Project and an App within it
  4. Go to Keys and tokensBearer Token
  5. Click “Generate” and copy the token
  6. Add to .env:
Terminal window
TWITTER_BEARER_TOKEN=AAAA...

Used by: problem-intelligence, trend-analyst, post-engagement.

Requires a Meta Business account with an Instagram Business or Creator account connected.

  1. Go to developers.facebook.com and create an app
  2. Add the Instagram Graph API product
  3. Connect your Instagram Business account
  4. Go to ToolsGraph API Explorer
  5. Select your app, then generate a User Token with instagram_basic and instagram_manage_insights permissions
  6. Copy the access token
  7. Add to .env:
Terminal window
INSTAGRAM_ACCESS_TOKEN=your_token_here

Used by: post-engagement (Shorts metrics).

  1. Go to console.cloud.google.com/apis/library
  2. Search for “YouTube Data API v3” and click Enable
  3. Go to CredentialsCreate CredentialsAPI key
  4. Copy the API key
  5. Add to .env:
Terminal window
YOUTUBE_DATA_API_KEY=AIza...

Used for: transactional email (invitations, notifications).

  1. Go to resend.com and sign up
  2. Navigate to API Keys in the dashboard
  3. Click “Create API Key” with sending access
  4. Copy the key (starts with re_)
  5. Add to .env:
Terminal window
RESEND_API_KEY=re_...

Optionally configure the sender:

Terminal window
FABRIC_EMAIL_FROM=noreply@yourdomain.com
VariableDefaultDescription
RESEND_API_KEYResend API key for transactional email
FABRIC_EMAIL_FROMnoreply@fabric.localDefault sender email address
FABRIC_INVITE_TOKEN_KEYauto-generated64-char hex string (32-byte BLAKE3 key) for invitation tokens
FABRIC_INVITE_REDIRECT_URLURL to redirect to after invitation accept

Generate a signing secret for OAuth tokens:

Terminal window
openssl rand -hex 32

Add to .env:

Terminal window
OAUTH_SIGNING_SECRET=your_64_char_hex_string
VariableDefaultDescription
OAUTH_SIGNING_SECRETSecret for signing native OAuth tokens
JWT_SECRETSecret for JWT token validation
PUBLIC_BASE_URLPublic API base URL (for email links)
AUTH_SITE_URLFrontend URL for auth redirects
AUTH_CALLBACK_REDIRECT_URLOAuth callback redirect URL
  1. Go to console.cloud.google.com/apis/credentials
  2. Click “Create Credentials”“OAuth client ID”
  3. Select Web application
  4. Add your callback URL to Authorized redirect URIs (e.g. http://localhost:3000/auth/callback/google)
  5. Copy the Client ID and Client Secret
  6. Add to .env:
Terminal window
GOOGLE_CLIENT_ID=123456789-abc.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=GOCSPX-...
  1. Go to github.com/settings/developers
  2. Click “New OAuth App”
  3. Set the Authorization callback URL (e.g. http://localhost:3000/auth/callback/github)
  4. Click “Register application”
  5. Copy the Client ID, then click “Generate a new client secret” and copy that too
  6. Add to .env:
Terminal window
GITHUB_CLIENT_ID=Ov23li...
GITHUB_CLIENT_SECRET=your_secret_here

Local providers run on your machine — no API keys needed, but they require the services to be running.

Run local LLMs (Llama, Mistral, Gemma, etc.):

  1. Install Ollama from ollama.com
  2. Pull a model: ollama pull llama3.2
  3. Ollama runs automatically on localhost:11434
  4. Add to .env:
Terminal window
OLLAMA_ENABLED=true
OLLAMA_URL=http://localhost:11434

Local audio transcription:

  1. Start a Whisper-compatible server (e.g. faster-whisper-server)
  2. Add to .env:
Terminal window
WHISPER_URL=http://localhost:8000
WHISPER_MODEL=large-v3 # optional: override model selection

Free local text-to-speech:

  1. Start a Piper server (included in just infra-up-ai)
  2. Add to .env:
Terminal window
PIPER_URL=http://localhost:5000

Local voice cloning TTS:

  1. Start a Chatterbox server
  2. Add to .env:
Terminal window
CHATTERBOX_URL=http://localhost:8001

Local Stable Diffusion image generation:

  1. Install ComfyUI and start it
  2. Add to .env:
Terminal window
COMFYUI_ENABLED=true
COMFYUI_URL=http://localhost:8188

Local LLM Server (vLLM / LM Studio / LocalAI)

Section titled “Local LLM Server (vLLM / LM Studio / LocalAI)”

Use any OpenAI-compatible local server:

Terminal window
LOCAL_INFERENCE_URL=http://localhost:8080/v1

Also accepts VLLM_URL or FABRIC_LOCAL_URL as aliases.

VariableDefaultDescription
OLLAMA_ENABLEDfalseEnable Ollama LLM provider
OLLAMA_URLhttp://localhost:11434Ollama server URL
WHISPER_URLWhisper transcription server URL
WHISPER_MODELWhisper model selection override
PIPER_URLPiper TTS server URL
CHATTERBOX_URLChatterbox voice cloning server URL
COMFYUI_ENABLEDfalseEnable ComfyUI image generation
COMFYUI_URLhttp://localhost:8188ComfyUI server URL
ONNX_MODEL_DIRONNX model directory
CANDLE_ENABLEDtrueEnable Candle ML inference
LLAMA_CPP_MODELPath to GGUF model file (requires llama-cpp feature)
LOCAL_INFERENCE_URLLocal LLM server URL (also accepts VLLM_URL or FABRIC_LOCAL_URL)
FABRIC_DIFFUSERS_ENABLEDtrueEnable Python Diffusers model server

The model server auto-spawns during workflow execution to host local ML models (Diffusers, Kokoro, Whisper). No manual setup needed — it starts automatically when a workflow requires a local model.

VariableDefaultDescription
FABRIC_MODEL_SERVER_URLhttp://localhost:8199Model server endpoint
FABRIC_MODEL_SERVER_PORT8199Model server port
FABRIC_MODEL_WARM_TTL1800Seconds to keep models loaded in memory after last use
FABRIC_MODEL_STORES3/GCS bucket for model storage (e.g. s3://my-models)
FABRIC_NO_MODEL_SERVERSet to 1 to disable the auto-spawned model server
FABRIC_GPU_COUNTauto-detectedOverride GPU count detection
FABRIC_GPU_TIMEOUT600GPU operation timeout in seconds

Override the default model for any operation by setting FABRIC_<OPERATION>_MODEL to a model ID or skip to disable.

Terminal window
# Use Gemini Flash for text (cheapest)
FABRIC_TEXT_MODEL=gemini-2.5-flash
# Use Imagen for thumbnails (fast, renders text natively)
FABRIC_THUMBNAIL_MODEL=imagen-4.0-fast-generate-001
# Disable avatar generation entirely
FABRIC_AVATAR_MODEL=skip
# Use FAL for b-roll video
FABRIC_BROLL_MODEL=fal-ai/veo3.1/fast

All available overrides:

VariableDescription
FABRIC_TEXT_MODELText generation / LLM
FABRIC_VISION_MODELVision / image understanding
FABRIC_IMAGE_MODELImage generation
FABRIC_IMAGE_FAST_MODELFast image generation (lower quality)
FABRIC_IMAGE_EDIT_MODELImage-to-image editing
FABRIC_THUMBNAIL_MODELThumbnail generation
FABRIC_POST_MODELSocial media post image generation
FABRIC_KEYFRAME_GRID_MODELKeyframe grid generation
FABRIC_AVATAR_MODELAvatar generation
FABRIC_VIDEO_MODELVideo generation
FABRIC_BROLL_MODELB-roll video generation
FABRIC_BROLL_FAST_MODELFast b-roll generation
FABRIC_BROLL_FLF_MODELB-roll first/last frame generation
FABRIC_BROLL_I2V_MODELB-roll image-to-video
FABRIC_BROLL_REF2V_MODELB-roll reference-to-video
FABRIC_TTS_MODELText-to-speech
FABRIC_TRANSCRIPTION_MODELAudio transcription
FABRIC_MUSIC_MODELMusic generation
FABRIC_LIPSYNC_MODELLip sync
FABRIC_PERCEPTION_MODELPerceptual analysis

Configure where Fabric stores workflow artifacts (generated images, videos, audio).

Local development (default):

Terminal window
ASSET_STORE_URL=file:///tmp/fabric/assets

S3-compatible storage (production):

Terminal window
ASSET_STORE_URL=s3://my-fabric-assets
AWS_ACCESS_KEY_ID=AKIA...
AWS_SECRET_ACCESS_KEY=...
AWS_REGION=us-east-1
# For MinIO, Supabase Storage, or other S3-compatible services:
# AWS_ENDPOINT=https://s3.example.com

Google Cloud Storage:

Terminal window
ASSET_STORE_URL=gs://my-fabric-assets
VariableDefaultDescription
ASSET_STORE_URLStorage backend: file:///path, s3://bucket, gs://bucket, memory://
ASSET_TTL_HOURS72Auto-expire workflow assets (0 = never)
ASSET_REAPER_INTERVAL_SECS300Cleanup poll interval in seconds

VariableDefaultDescription
HOST127.0.0.1HTTP bind address
PORT3001HTTP port
GRPC_PORT3002gRPC port
RUST_LOGinfoLog level filter (tracing)
VariableDefaultDescription
FABRIC_ENVdevelopmentSet to production to disable dev-header auth
FABRIC_MODEserverserver (default) or request-only (stateless/serverless)
FABRIC_DEV_MODESet to 1 or true to force dev-header auth regardless of FABRIC_ENV
FABRIC_API_KEYAdmin API key for CLI subcommands (fab_* prefix)
FABRIC_API_URLAPI server endpoint (for SDK/worker connections)
FABRIC_CONFIGExplicit path to fabric.toml config file
FABRIC_WORKFLOW_DIRSComma-separated list of extra directories to load workflow YAMLs from
FABRIC_KEEP_WORKDIRSet to 1 to retain workflow working directories after execution (useful for debugging)
FABRIC_STRICT_WIRINGEnforce strict type checking on workflow task wiring
FABRIC_INTERNAL_SECRETShared secret for service-to-service authentication
FABRIC_ORGANIZATION_IDDefault organization ID for workflow execution context
FABRIC_QUALITYQuality profile selection (overrides per-workflow defaults)
FABRIC_VIDEO_BACKENDffmpegVideo processing backend: ffmpeg (default) or gstreamer
FABRIC_LOCAL_ONLYfalseDisable all remote providers
FABRIC_ROUTING_STRATEGYcheapest_qualifiedDefault routing strategy (local_first, fastest, best_quality, balanced)
FABRIC_PREFER_LOCAL1Prefer local backends when available
VariableDefaultDescription
CORS_ALLOWED_ORIGINSComma-separated list of allowed origins (e.g. http://localhost:3000,http://localhost:5173)
VariableDefaultDescription
RATE_LIMIT_MAX_REQUESTS200Max requests per window
RATE_LIMIT_WINDOW_SECS60Rate limit window in seconds
RATE_LIMIT_BACKENDmemoryBackend: memory or redis
VariableDefaultDescription
FABRIC_WORKERS1Number of worker threads
FABRIC_WORKER_ID_PREFIXfabric-workerWorker ID prefix
FABRIC_WORKER_POLL_INTERVAL2.0Poll interval in seconds
FABRIC_WORKER_TAGSComma-separated list of worker capability tags (e.g. python,ai)
VariableDefaultDescription
CRON_POLL_INTERVAL_SECS30Cron job poll interval in seconds
VariableDefaultDescription
FAB_QUIETSuppress workflow log output
NO_COLORDisable colored log output

Terminal window
fabric serve --host 0.0.0.0 --port 8080 --grpc-port 9090
fabric serve --database-url postgres://user:pass@host/db
fabric serve --oauth-signing-secret $(openssl rand -hex 32)
fabric serve --openai-api-key sk-... --anthropic-api-key sk-ant-...
fabric serve --ollama-enabled --ollama-url http://gpu-server:11434
fabric serve --comfyui-enabled --comfyui-url http://localhost:8188
fabric serve --fabric-env production
Terminal window
fabric executor --concurrency 8 --worker-id gpu-worker-1
fabric executor --poll-interval 500 --lease-seconds 60 --max-retries 5

For serverless environments (Lambda, Modal, microVMs):

Terminal window
FABRIC_MODE=request-only fabric serve --database-url postgres://...

This disables gRPC, background tasks, and SSE streaming. Workflow execution runs inline.


All settings can also be set in fabric.toml:

[server]
host = "0.0.0.0"
port = 8080
grpc_port = 9090
[database]
url = "postgres://fabric:fabric@localhost:5432/fabric"
# direct_url = "postgres://..." # bypasses pooler for LISTEN/NOTIFY + migrations
pool_max = 15
pool_min = 2
[auth]
oauth_signing_secret = "your-secret-here"
[providers]
openai_api_key = "sk-..."
anthropic_api_key = "sk-ant-..."
ollama_enabled = true
ollama_url = "http://localhost:11434"
# Custom OpenAI-compatible endpoints (LocalAI, vLLM, LM Studio)
[[providers.custom_openai_endpoints]]
name = "localai"
url = "http://localhost:8080/v1"
api_key = "no-key"
model = "mistral-7b"
tier = "basic"
[assets]
store_url = "file:///tmp/fabric/assets"
generated_asset_ttl_hours = 72
[workers]
count = 2
tags = ["python", "ai"]
[runtime]
env = "development"
[cors]
allowed_origins = ["http://localhost:3000"]

Terminal window
just infra-up # Full stack (Postgres + Ollama + Whisper + ComfyUI)
just infra-up-db # Postgres only
just infra-up-ai # Postgres + AI services
just infra-down # Stop everything
just infra-reset # Fresh start (delete volumes)
just infra-psql # Open psql shell
just infra-migrate # Re-apply migrations
just infra-smoke-test # Verify migrations on clean DB
just ollama-pull <model> # Pull an Ollama model
just ollama-list # List available Ollama models
Terminal window
just dev # Start control plane + executor
just run # Start control plane only
just fmt # Format all code
just clippy # Lint with -D warnings
just test # Run all tests
just doc # Build documentation
just ci # All of the above