Skip to content

Runtime configuration reference

alquimia-runtime is configured through environment variables (and an optional .env file). Environment variables always take precedence over values in .env.

The following secrets must be set before the runtime starts. They are never committed to version control.

SecretPurpose
API_TOKENBearer token for all authenticated endpoints
POSTGRES_USERNAME / POSTGRES_PASSWORDPostgreSQL credentials
VAULT_TOKENScoped Vault token for registry secret resolution
BLOB_S3_ACCESS_KEY / BLOB_S3_SECRET_KEYS3-compatible blob storage credentials
KAFKA_SIGNING_KEY64-character hex key shared across all runtime instances. Used to sign and verify events between masters and workers

Optionally, set ENCRYPTION_KEY (64-character hex) to enable application-layer AES-256-GCM encryption of Redis conversations and PostgreSQL worklog data at rest. Leave it empty to store data in plaintext.

VariableRequiredDefaultDescription
BACKEND_SERVER_HOSTNo0.0.0.0Bind address
BACKEND_SERVER_PORTNo8080Listen port
BACKEND_SERVER_WORKERSNo1Uvicorn worker count
BACKEND_TIMEOUT_KEEP_ALIVENo300Keep-alive timeout (seconds)
DEBUGNofalseEnable debug mode and verbose logging
RESPONSE_MAX_RETRIESNo3Max retries for inference responses
A2A_MAX_DEPTHNo5Maximum agent-to-agent call depth
MAX_FILE_CONTENT_SIZENo20971520Max knowledge file upload size in bytes (default 20 MB)
MAX_AUDIO_CONTENT_SIZENo6379Max audio blob size in bytes
VariableRequiredDefaultDescription
ALQUIMIA_RUNTIME_MODENomastermaster serves the external API (registry read/write); worker consumes Kafka events and opens the registry read-only. Use all for single-process local deployments

In production, run master and worker as separate replica sets so they can scale independently. Setting ALQUIMIA_RUNTIME_MODE=worker prevents the local registry from being mutated by inference pods.

VariableRequiredDefaultDescription
API_TOKENYesBearer token for all authenticated endpoints
AUTH_PROVIDERNoapi_tokenAuth backend: api_token, jwt, or keycloak
JWT_SECRETConditional""Required when AUTH_PROVIDER=jwt
JWT_ALGORITHMNoHS256JWT signing algorithm
KEYCLOAK_SERVER_URLConditional""Required when AUTH_PROVIDER=keycloak
KEYCLOAK_REALMConditional""Keycloak realm
KEYCLOAK_CLIENT_IDConditional""Keycloak client ID
KEYCLOAK_CLIENT_SECRETConditional""Keycloak client secret
KEYCLOAK_ADMIN_CLIENT_SECRETNo""Falls back to KEYCLOAK_CLIENT_SECRET
KEYCLOAK_CALLBACK_URINo""OAuth callback URI
IS_ALLOWED_CREDENTIALSNotrueCORS allow credentials
ALLOWED_ORIGINSNo["*"]CORS allowed origins. Cannot be ["*"] when IS_ALLOWED_CREDENTIALS=true
ALLOWED_METHODSNo["*"]CORS allowed methods
ALLOWED_HEADERSNo["*"]CORS allowed headers

See Authentication & authorization for the conceptual model and deployment patterns.

Channel webhook endpoints (/event/infer/{assistant_id}/{channel_id}) do not use the global bearer token. The runtime delegates authentication to the channel implementation from alquimia-core.

VariableRequiredDefaultDescription
CHANNEL_AUTH_REQUIREDNotrueRequire every channel to implement provider-specific auth
CHANNEL_MAX_BODY_SIZENo1048576Max channel webhook body size in bytes (default 1 MB)
CHANNEL_RATE_LIMIT_ENABLEDNotrueEnable per-source rate limiting
CHANNEL_RATE_LIMIT_REQUESTSNo60Allowed requests per source per window
CHANNEL_RATE_LIMIT_WINDOW_SECONDSNo60Rate-limit window

See Channels and Connect a channel for provider-specific setup.

VariableRequiredDefaultDescription
SPIFFE_ENABLEDNofalseEnable SPIFFE workload identity
SPIFFE_SOCKET_PATHNo/tmp/spire-agent/public/api.sockPath to the SPIFFE Workload API socket
SPIFFE_TRUST_DOMAINNoalquimia.aiSPIFFE trust domain
AGENTSPACE_PROVISIONING_ENABLEDNofalseAutomate SPIRE entries and Vault roles per agentspace
AGENTSPACE_PROVISIONING_INTERVAL_SECONDSNo300Reconciliation interval
AGENTSPACE_PROVISIONING_K8S_NAMESPACENospireNamespace for ClusterStaticEntry CRDs
AGENTSPACE_PROVISIONING_VAULT_JWT_AUTH_PATHNojwtVault JWT auth mount path

When AGENTSPACE_PROVISIONING_ENABLED=true, the master creates or updates SPIRE ClusterStaticEntry CRDs, scoped Vault ACL policies, and JWT auth roles for each agentspace. A background reconciler runs every AGENTSPACE_PROVISIONING_INTERVAL_SECONDS seconds to converge state with the registry list. This is what produces per-agentspace, per-tier identities that agents use to authenticate to Vault.

See Workload hardening and Authorization policies for the Zero Trust deployment pattern.

VariableRequiredDefaultDescription
KAFKA_BOOTSTRAP_SERVERSNolocalhost:9092Broker address(es)
KAFKA_TOPICNoalquimia.eventsTopic for agent events
KAFKA_CONSUMER_GROUPNoalquimia-workersConsumer group for workers
KAFKA_SIGNING_KEYYes""64-character hex signing key shared by all instances
KAFKA_SECURITY_PROTOCOLNoPLAINTEXTSASL_SSL or SSL in production
KAFKA_SASL_MECHANISMNo""SASL mechanism, e.g. SCRAM-SHA-256
KAFKA_SASL_USERNAMENo""SASL username
KAFKA_SASL_PASSWORDNo""SASL password
KAFKA_SSL_CA_FILENo""Path to CA certificate for broker verification
KAFKA_SSL_CERT_FILENo""Path to client certificate for mTLS
KAFKA_SSL_KEY_FILENo""Path to client key for mTLS
KAFKA_SSL_VERIFYNotrueVerify broker certificate hostname
KAFKA_DLQ_TOPICNoalquimia.events.dlqDead-letter topic for signature-verification failures
VariableRequiredDefaultDescription
REDIS_URLNoredis://localhost:6379Redis connection URL
REDIS_TTLNo86400Default TTL for Redis keys (seconds)
POSTGRES_HOSTNolocalhostPostgreSQL host
POSTGRES_PORTNo5432PostgreSQL port
POSTGRES_DBNoalquimiaDatabase name
POSTGRES_USERNAMEYesDatabase user
POSTGRES_PASSWORDYesDatabase password
POSTGRES_SCHEMANopostgresqlSQLAlchemy schema prefix
DB_POOL_SIZENo60Connection pool size
DB_MAX_POOL_CONNo80Max pool connections
DB_POOL_OVERFLOWNo20Pool overflow limit
DB_POOL_PRE_PINGNotruePre-ping connections before use
DB_POOL_RECYCLENo1800Connection recycle interval (seconds)
DB_TIMEOUTNo5Query timeout (seconds)
DB_CREATE_ON_STARTUPNofalseAuto-create tables on startup (dev only)
IS_DB_ECHO_LOGNofalseLog all SQL statements
QDRANT_URLNohttp://localhost:6333Qdrant vector store URL
QDRANT_API_KEYNoQdrant API key (optional)
ALQUIMIA_KNOWLEDGE_PROVIDERNoqdrantKnowledge-base backend: qdrant, redis, or in_memory. When set, this provider replaces the connector declared on every topic-based, connector-backed knowledge base in the process
VAULT_ADDRNovaultHashiCorp Vault address
VAULT_MOUNT_POINTNosecretVault KV mount point
VAULT_TOKENYes""Scoped Vault token
VariableRequiredDefaultDescription
BLOB_S3_ENDPOINT_URLYes""S3-compatible endpoint, e.g. http://minio:9000
BLOB_S3_ACCESS_KEYYes""S3 access key
BLOB_S3_SECRET_KEYYes""S3 secret key
BLOB_S3_BUCKET_NAMEYes""Bucket name
BLOB_S3_REGION_NAMENous-east-1S3 region
BLOB_S3_SECURENotrueUse TLS for S3 connections
VariableRequiredDefaultDescription
ALQUIMIA_REGISTRY_DIRNoLocal path for TinyDB registry files
ALQUIMIA_OCI_REGISTRY_DEFAULTNoghcr.ioDefault OCI registry for push/pull
ALQUIMIA_REGISTRY_SECRET_RESOLVERNovaultSecret resolver backend: vault or env. env reads directly from environment variables
ALQUIMIA_OCI_SIGNATURE_POLICYNorequiredSignature verification policy: required, warn, or off. required aborts on missing/invalid signatures; warn logs and continues; off skips verification
ALQUIMIA_OCI_COSIGN_KEYNoPath to a cosign public/private key file
ALQUIMIA_OCI_COSIGN_CERT_IDENTITYNoKeyless verification certificate identity
ALQUIMIA_OCI_COSIGN_CERT_OIDC_ISSUERNoKeyless verification OIDC issuer
ALQUIMIA_OCI_DEV_MODENofalseEnable insecure ORAS transport flags (dev only)
ORAS_PLAIN_HTTPNofalseUse plain HTTP for ORAS (gated by ALQUIMIA_OCI_DEV_MODE)
ORAS_INSECURENofalseSkip TLS verification for ORAS (gated by ALQUIMIA_OCI_DEV_MODE)

When ALQUIMIA_REGISTRY_KEY is set, the local TinyDB registry files (metadata.json, <agentspace>/dist.json) are transparently encrypted with AES-256-GCM. The key is a Base64-encoded AES-256 key sourced from Vault or another secret injector.

VariableRequiredDefaultDescription
ALQUIMIA_REGISTRY_KEYNoBase64-encoded AES-256 key for encryption at rest
ALQUIMIA_REGISTRY_KEY_IDNodefaultKey identifier stored in the ciphertext envelope (rotation support)

Encryption at rest protects against volume or bucket exposure. It does not protect against a compromised runtime process, which can still read decrypted data through the registry APIs. In production, run workers with ALQUIMIA_RUNTIME_MODE=worker so the registry is mounted read-only.

Changing ALQUIMIA_REGISTRY_KEY_ID alongside a new key causes the next write to re-encrypt with the new envelope. If ALQUIMIA_REGISTRY_KEY is absent, the registry falls back to plaintext for backward compatibility.

Registered topic files are stored outside the registry in a pluggable storage backend selected at deployment time.

VariableRequiredDefaultDescription
ALQUIMIA_FILE_STORAGE_PROVIDERNolocalStorage backend: local or s3
ALQUIMIA_FILE_STORAGE_LOCAL_DIRNo$ALQUIMIA_REGISTRY_DIR/filesLocal filesystem root for local provider
ALQUIMIA_FILE_STORAGE_S3_ENDPOINT_URLConditionalRequired for s3
ALQUIMIA_FILE_STORAGE_S3_ACCESS_KEYConditionalRequired for s3
ALQUIMIA_FILE_STORAGE_S3_SECRET_KEYConditionalRequired for s3
ALQUIMIA_FILE_STORAGE_S3_BUCKETConditionalRequired for s3
ALQUIMIA_FILE_STORAGE_S3_REGIONNous-east-1AWS region for s3

The same provider is used by search_mode="direct" file reads and by alquimia registry topics add-file.

VariableRequiredDefaultDescription
BRAIN_STORENomemoryWhere served brains live: memory, or layout:<root>
BRAIN_CACHE_TTLNo300Seconds before a cached brain is revalidated
BRAIN_CACHE_MAX_BRAINSNo4LRU cache size limit
BRAIN_WARMUP_ENABLEDNotrueOpen registered brains at worker startup
VariableRequiredDefaultDescription
OTEL_COLLECTOR_ENDPOINT_TRACESNoOTLP HTTP endpoint for traces
OTEL_COLLECTOR_ENDPOINT_LOGSNotraces endpointOTLP HTTP endpoint for logs
OTEL_COLLECTOR_ENDPOINTNoOTLP HTTP endpoint for metrics
OTEL_ALQUIMIA_SERVICE_NAMENoalquimiaService name reported to OTEL
OTEL_ALQUIMIA_METER_NAMENoalquimia-metricsMeter name for metrics
OTEL_EXPORTER_INTERVAL_MILLISNo5000Metrics export push interval
OTEL_EXCLUDED_ATTRIBUTESNo""Comma-separated metric attribute keys to strip before export

See Observability for how the signals correlate.