AIHUBMIX_BASE_URL=https://aihubmix.com/v1Provider: AiHubMix
AILIN_AUTO_MODEL_ALIASESAilin Virtual Model Aliases Optional comma-separated aliases that always resolve to autonomous orchestration. Example: AILIN_AUTO_MODEL_ALIASES=ailin-smart,ailin-pro
Ailin Virtual Model Aliases Optional comma-separated aliases that always resolve to autonomous orchestration. Example: AILIN_AUTO_MODEL_ALIASES=ailin-smart,ailin-pro
AILIN_BRAND_NAME=Ailin¹
AILIN_HIDE_MODELS=falseBranding Configuration
AILIN_LOG_DETAILED_METADATA=true
AILIN_MINIMAL_METADATA=false
AILIN_VIRTUAL_MODEL_PROFILESOptional JSON array with custom alias profiles. Example:
Optional JSON array with custom alias profiles. Example:
AIML_BASE_URL=https://api.aimlapi.com/v1Provider: AIML
AIML_MODELS_BASE_URL=https://api.aimlapi.com
ANTHROPIC_API_KEY_POOL
ANTHROPIC_BASE_URL=https://api.anthropic.comProvider: Anthropic
ANTHROPIC_ORGANIZATION_ID
API_KEY_ALLOW_NO_EXPIRATIONWhether to allow tokens with no expiration at all. Default true; set to false in regulated environments to force every token to carry a bound.
Whether to allow tokens with no expiration at all. Default true; set to false in regulated environments to force every token to carry a bound.
API_KEY_MAX_EXPIRATION_DAYSPersonal Access Tokens (PATs) Policy for end-user API keys created via /v1/internal/api-keys. These values are enforced when a key is created — existing keys with longer expirations are unaffected. Maximum lifetime in days. Set to 0 (and ALLOW_NO_EXPIRATION=true) to permit indefinite tokens. Default 730 mirrors GitHub's fine-grained PAT max — strikes a balance between rotation hygiene and CI ergon
Personal Access Tokens (PATs) Policy for end-user API keys created via /v1/internal/api-keys. These values are enforced when a key is created — existing keys with longer expirations are unaffected. Maximum lifetime in days. Set to 0 (and ALLOW_NO_EXPIRATION=true) to permit indefinite tokens. Default 730 mirrors GitHub's fine-grained PAT max — strikes a balance between rotation hygiene and CI ergon
APP_VERSION=2.1.0Application Metadata
AUTH_EMAIL_FROM_EMAIL=no-reply@ailin.dev
AUTH_EMAIL_FROM_NAME=Ailin¹ Developer Tool
AUTH_EMAIL_PROVIDEREmail (SMTP) SMTP password comes from GCP Secret: <prefix>-smtp-pass
Email (SMTP) SMTP password comes from GCP Secret: <prefix>-smtp-pass
AUTO_LEARNING_BUCKET_SIZE_HOURS=1
AUTO_LEARNING_ENABLED=trueAuto-Learning
AUTO_LEARNING_RETENTION_DAYS=365
AWS_BEDROCK_REGION=us-east-1Provider: AWS Bedrock
AZURE_OPENAI_API_VERSION=2024-08-01-preview
AZURE_OPENAI_DEPLOYMENT
AZURE_OPENAI_ENDPOINTProvider: Azure OpenAI
BILLING_API_SECRET_KEY
BILLING_ENTITLEMENTS_CACHE_TTL_SECONDSRedis cache TTL for a resolved tenant's entitlements, and the HTTP timeout for the resolve call — billing being unreachable/slow ALWAYS falls back to the hardcoded TIER_CONFIGS value, never blocks the request.
Redis cache TTL for a resolved tenant's entitlements, and the HTTP timeout for the resolve call — billing being unreachable/slow ALWAYS falls back to the hardcoded TIER_CONFIGS value, never blocks the request.
BILLING_ENTITLEMENTS_TIMEOUT_MS
BILLING_SERVICE_URLRequired for the entitlement call itself (also used today by the existing /v1/internal/billing/checkout-credits proxy — routes/internal/ internal-wallet-routes.ts):
Required for the entitlement call itself (also used today by the existing /v1/internal/billing/checkout-credits proxy — routes/internal/ internal-wallet-routes.ts):
BUILD_TIMESTAMP
CACHE_ENABLED=trueCache Configuration
CACHE_MAX_IN_MEMORY_ENTRIES=5000
CACHE_MAX_SIZE_MB=256
CACHE_TTL_DEFAULT=3600
CACHE_TTL_EMBEDDINGS=604800
CACHE_TTL_MODELS=3600
CACHE_TTL_RESPONSES=86400
CI_BILLING_CLIENT_ALLOWED_AUDIENCES
CI_BILLING_CLIENT_ALLOWED_SCOPES
CI_BILLING_CLIENT_OIDC_CLIENT_ID
CI_BILLING_CLIENT_OIDC_CLIENT_SECRET
CI_BILLING_CLIENT_OIDC_TOKEN_URLOutbound: ci -> billing entitlement resolution (Fase 5) ci calls billing's GET /v1/plans/resolve (services/billing-entitlements-client.ts) to resolve a tenant's REAL plan limits, with the M2M client_credentials client id registers specifically for this (ailin-ci-billing-client, audience=ailin-billing, scope=billing:tenant-context — see id/api/controllers/oidc_provider.py::_default_clients). Same e
Outbound: ci -> billing entitlement resolution (Fase 5) ci calls billing's GET /v1/plans/resolve (services/billing-entitlements-client.ts) to resolve a tenant's REAL plan limits, with the M2M client_credentials client id registers specifically for this (ailin-ci-billing-client, audience=ailin-billing, scope=billing:tenant-context — see id/api/controllers/oidc_provider.py::_default_clients). Same e
CI_COORDINATION_AGGREGATION_METHOD=weighted_confidence
CI_COORDINATION_ENABLE_EXPERIMENTS=true
CI_COORDINATION_MAX_COST_USD=0.50
CI_COORDINATION_MAX_DECISION_FLIP_RATE=0.15
CI_COORDINATION_MAX_DISSENT=0.35
CI_COORDINATION_MAX_LATENCY_MS=60000
CI_COORDINATION_MAX_MODELS=5
CI_COORDINATION_MAX_ROUNDS=3
CI_COORDINATION_MIN_CONVERGENCE_SCORE=0.82
CI_COORDINATION_MIN_MODELS=3
CI_COORDINATION_PERSIST_AUDIT=false
CI_COORDINATION_REQUIRE_QUALITY=0.8
CI_COORDINATION_STOP_ON_CRITICAL_RISK=true
CI_SENSITIVITY_CONSENSUS_ENABLED=falseCollective Coordination Layer (Sensitivity Consensus) Master switch — disabled by default, enable to activate sensitivity-consensus strategy
Collective Coordination Layer (Sensitivity Consensus) Master switch — disabled by default, enable to activate sensitivity-consensus strategy
CLI_LATEST_VERSION=0.1.9
CLI_MIN_VERSION=0.0.1
COHERE_BASE_URL=https://api.cohere.aiProvider: Cohere
COMPRESSION_ENABLED=true
CORS_ENABLED=trueSecurity
CORS_ORIGIN=http://localhost:3000,http://localhost:5173
COST_OPTIMIZATION_ENABLED=trueCost Optimization
COST_OPTIMIZATION_MAX_BUDGET_PER_REQUEST=1.00
COST_OPTIMIZATION_TARGET_SAVINGS=0.63
DATABASE_CONNECTION_TIMEOUT=5000
DATABASE_IDLE_TIMEOUT=30000
DATABASE_POOL_MAX=20
DATABASE_POOL_MINDatabase (PostgreSQL) - Non-sensitive Config Connection string comes from GCP Secret: <prefix>-database-url NOTE (2026-09 footgun fix): these are now genuinely live (see database/client.ts's createPgPool()/buildPgPoolOptions() and config/index.ts's resolveDatabasePoolMax()/resolveDatabasePoolMin()). Values below match this file's NODE_ENV=development default's real pool size (20/0) so copying this
Database (PostgreSQL) - Non-sensitive Config Connection string comes from GCP Secret: <prefix>-database-url NOTE (2026-09 footgun fix): these are now genuinely live (see database/client.ts's createPgPool()/buildPgPoolOptions() and config/index.ts's resolveDatabasePoolMax()/resolveDatabasePoolMin()). Values below match this file's NODE_ENV=development default's real pool size (20/0) so copying this
DEEPSEEK_BASE_URL=https://api.deepseek.com/v1Provider: DeepSeek
EDENAI_BASE_URL=https://api.edenai.run/v3/llmProvider: Eden AI
ENABLE_GRACEFUL_SHUTDOWN=true
ENABLE_PLAYGROUND=true
ENABLE_SWAGGER=true
FEATURE_ARBITRATION=true
FEATURE_AUTO_LEARNING=true
FEATURE_CACHING=true
FEATURE_COMPETITIVE_EXECUTION=true
FEATURE_EMBEDDINGS=true
FEATURE_FUNCTION_CALLING=true
FEATURE_STREAMING=trueFeature Flags
FEATURE_VISION=true
FRIENDLI_BASE_URL=https://api.friendli.ai/serverless/v1Provider: Friendli
FRIENDLI_TEAM_ID
GCP_SECRETS_CREDENTIALS_FILE─── Local dev authentication (RECOMMENDED PATH) ───────────────────────── Use Application Default Credentials (ADC). One-time setup: gcloud auth application-default login After login, gcloud writes credentials to ~/.config/gcloud/application_default_credentials.json and the Secret Manager client picks them up automatically — no key file needed. The boot-time preflight in `gcp-provider.ts` validate
─── Local dev authentication (RECOMMENDED PATH) ───────────────────────── Use Application Default Credentials (ADC). One-time setup: gcloud auth application-default login After login, gcloud writes credentials to ~/.config/gcloud/application_default_credentials.json and the Secret Manager client picks them up automatically — no key file needed. The boot-time preflight in `gcp-provider.ts` validate
GCP_SECRETS_PREFIX
GCP_SECRETS_PROJECT_IDGCP Secret Manager Set this to your GCP project id (override in .env).
GCP Secret Manager Set this to your GCP project id (override in .env).
GIT_COMMIT_SHA
GOOGLE_API_KEY_POOL
GOOGLE_BASE_URL=https://generativelanguage.googleapis.comProvider: Google (Gemini)
Provider: Google (Gemini)
HELICONEAI_BASE_URL=https://ai-gateway.helicone.ai/v1Provider: Helicone AI Gateway
Provider: Helicone AI Gateway
HELMET_ENABLED=true
HOST=0.0.0.0
IMAGEROUTER_BASE_URL=https://api.imagerouter.ioProvider: ImageRouter
JINA_API_BASE_URL=https://api.jina.ai/v1Provider: Jina
JINA_DEEPSEARCH_BASE_URL=https://deepsearch.jina.ai/v1
JINA_READER_BASE_URL=https://r.jina.ai
JINA_SEARCH_BASE_URL=https://s.jina.ai
JWT_EXPIRES_INJWT Authentication JWT secret comes from GCP Secret: <prefix>-jwt-secret
JWT Authentication JWT secret comes from GCP Secret: <prefix>-jwt-secret
LOG_LEVEL=info
MAX_REQUEST_SIZE_MB=10
MINIMAX_BASE_URL=https://api.minimax.io/v1Provider: MiniMax
MISTRAL_BASE_URL=https://api.mistral.ai/v1Provider: Mistral
MOCK_PROVIDERS=falseDevelopment
MOONSHOT_BASE_URL=https://api.moonshot.ai/v1Provider: Moonshot
NODE_ENV=developmentServer Configuration
NOVITA_BASE_URL=https://api.novita.ai/openai/v1Provider: Novita
NVIDIA_BASE_URL=https://integrate.api.nvidia.com/v1Provider: NVIDIA
NVIDIA_HUB_BASE_URL=https://integrate.api.nvidia.com/v1
OPENAI_API_KEY_POOLScale-to-100k Phase 2 (issue #152): optional multi-account pool, rotated round-robin alongside OPENAI_API_KEY so this provider's throughput isn't capped by a single account's rate limit. JSON array of additional keys.
Scale-to-100k Phase 2 (issue #152): optional multi-account pool, rotated round-robin alongside OPENAI_API_KEY so this provider's throughput isn't capped by a single account's rate limit. JSON array of additional keys.
OPENAI_BASE_URL=https://api.openai.com/v1
OPENAI_ORGANIZATIONProvider: OpenAI
OPENAI_PROJECT_ID
OPENROUTER_APP_NAME=Ailin¹
OPENROUTER_APP_URL=https://ailin.devProvider: OpenRouter
ORCHESTRATION_DEFAULT_STRATEGY=auto
ORCHESTRATION_ENABLE_ARBITRATION=true
ORCHESTRATION_ENABLE_COMPETITIVE=true
ORCHESTRATION_ENABLE_PARALLEL=true
ORCHESTRATION_MAX_MODELS=9Orchestration
ORQAI_BASE_URL=https://api.orq.ai/v2/routerProvider: ORQ.ai
ORQAI_MODELS_BASE_URL=https://api.orq.ai
OTEL_ENABLED=trueObservability: OpenTelemetry
Observability: OpenTelemetry
OTEL_EXPORTER_JAEGER_ENDPOINT=http://localhost:14268/api/traces
OTEL_EXPORTER_PROMETHEUS_PORT=9464
OTEL_SERVICE_NAME=ci-api
PORT=3000
PROMETHEUS_ENABLED=trueMonitoring: Prometheus
PROMETHEUS_PORT=9090
PROMETHEUS_SCRAPE_TOKEN
QUEUE_BACKOFF_INITIAL_DELAY_MS=1000
QUEUE_BACKOFF_STRATEGY=exponential
QUEUE_ENABLED=trueQueue (BullMQ)
QUEUE_MAX_ATTEMPTS=3
QUEUE_MAX_QUEUE_TIME_SECONDS=120
QUEUE_NAME=chat-requests
QUEUE_POLL_INTERVAL_MS=2000
QUEUE_RESULT_TTL_SECONDS=86400
QUEUE_RUN_WORKERS_IN_API=true
QUEUE_STATUS_TTL_SECONDS=600
QUEUE_WORKER_CONCURRENCY=100
QUEUE_WORKER_COUNT=20
QUEUE_WORKER_METRICS_PORT=9465
QUOTA_SERVICE_TIMEOUT=5
QUOTA_SERVICE_URL=http://gateway-quota:5004GATEWAY MIDDLEWARE CONFIGURATION
GATEWAY MIDDLEWARE CONFIGURATION
RATE_LIMIT_MAX=1000Rate Limiting
RATE_LIMIT_WINDOW=3600000
REDIS_CLUSTER_ENABLEDNOT supported yet — redis-client.ts fails fast rather than silently ignoring this (BullMQ's key scheme has no hash-tag prefixing and the redis-global cache layer uses db:1, both incompatible with Cluster mode's sharding). Use REDIS_SENTINEL_ENABLED below for HA instead.
NOT supported yet — redis-client.ts fails fast rather than silently ignoring this (BullMQ's key scheme has no hash-tag prefixing and the redis-global cache layer uses db:1, both incompatible with Cluster mode's sharding). Use REDIS_SENTINEL_ENABLED below for HA instead.
REDIS_CLUSTER_NODES
REDIS_DB=0
REDIS_HOST=localhostRedis (Cache & Queue) - Non-sensitive Config Connection strings come from GCP Secrets: - <prefix>-redis-url - <prefix>-redis-global-url
Redis (Cache & Queue) - Non-sensitive Config Connection strings come from GCP Secrets: - <prefix>-redis-url - <prefix>-redis-global-url
REDIS_PORT=6379
REDIS_QUEUE_DB
REDIS_QUEUE_HOSTScale-to-100k Phase 5 (issue #150) — money-path Redis (BullMQ queues + the idempotency store, via getQueueRedisClient()/createRedisClient()). Every field below falls back to the general REDIS_* value above when unset, so leaving these blank keeps today's single-instance behavior; set them to point the money path at a physically separate, non-evicting Redis so cache/rate-limit churn on the general
Scale-to-100k Phase 5 (issue #150) — money-path Redis (BullMQ queues + the idempotency store, via getQueueRedisClient()/createRedisClient()). Every field below falls back to the general REDIS_* value above when unset, so leaving these blank keeps today's single-instance behavior; set them to point the money path at a physically separate, non-evicting Redis so cache/rate-limit churn on the general
REDIS_QUEUE_PORT
REDIS_QUEUE_SENTINEL_ENABLED=false
REDIS_QUEUE_SENTINEL_NAME
REDIS_QUEUE_SENTINELS
REDIS_SENTINEL_ENABLED=falseSentinel-monitored HA (automatic primary failover, no sharding — safe for every current Redis consumer, unlike Cluster mode above).
Sentinel-monitored HA (automatic primary failover, no sharding — safe for every current Redis consumer, unlike Cluster mode above).
REDIS_SENTINEL_NAME=mymaster
REDIS_SENTINELScomma-separated host:port list, e.g. sentinel-1:26379,sentinel-2:26379,sentinel-3:26379
comma-separated host:port list, e.g. sentinel-1:26379,sentinel-2:26379,sentinel-3:26379
SECRETS_AUDIT_ENABLED=true
SECRETS_AUDIT_PERSIST=true
SECRETS_AUTO_REFRESH=true
SECRETS_CACHE_TTL_SECONDS=300
SECRETS_ENCRYPT_CACHE=true
SECRETS_PROVIDER_FALLBACK=env
SECRETS_PROVIDER_PRIMARY=gcpSecrets Manager Configuration
Secrets Manager Configuration
SECRETS_ROTATION_CRON=0 3 * * *
SECURITY_AUDIT_ENABLED=true
SECURITY_AUDIT_RETENTION_DAYS=365
SECURITY_RBAC_DEFAULT_ROLE=viewer
SECURITY_RBAC_SUPER_ROLES=owner,admin
SENSITIVE_ROUTES=/payment,/billing,/admin,/console/api/admin
SERVICE_AUTH_ALLOWED_CLIENTS=ailin-dev-server,ailin-chat-server
SERVICE_AUTH_AUDIENCE=ailin-ci
SERVICE_AUTH_CLOCK_TOLERANCE_SECONDS
SERVICE_AUTH_ENABLEDInternal M2M service-token auth (/v1/internal/*) The dev/platform BFF mints short-lived RS256 service tokens at id (client_credentials, client_id=ailin-dev-server, audience=ailin-ci) and calls ci's internal API-key endpoints with Bearer + X-Acting-User. ci verifies these against id's JWKS (same keypair as user OIDC tokens) — a path SEPARATE from user-token federation above. Defaults below match pr
Internal M2M service-token auth (/v1/internal/*) The dev/platform BFF mints short-lived RS256 service tokens at id (client_credentials, client_id=ailin-dev-server, audience=ailin-ci) and calls ci's internal API-key endpoints with Bearer + X-Acting-User. ci verifies these against id's JWKS (same keypair as user OIDC tokens) — a path SEPARATE from user-token federation above. Defaults below match pr
SERVICE_AUTH_ISSUER=https://ailin.id
SERVICE_AUTH_JWKS_CACHE_TTL_SECONDS
SERVICE_AUTH_JWKS_URI=https://ailin.id/.well-known/jwks.json
SERVICE_TOKEN_AUDIENCEService-token auth (BFF → ci-internal) These settings govern the `/v1/internal/*` endpoints that the dev/ BFF (and other trusted services) call on behalf of end users. Tokens are RS256, validated against id/'s JWKS via the existing federation config, and required to carry this audience plus an X-Acting-User header naming the console user. The user is then resolved server-side and used for all DB l
Service-token auth (BFF → ci-internal) These settings govern the `/v1/internal/*` endpoints that the dev/ BFF (and other trusted services) call on behalf of end users. Tokens are RS256, validated against id/'s JWKS via the existing federation config, and required to carry this audience plus an X-Acting-User header naming the console user. The user is then resolved server-side and used for all DB l
SHUTDOWN_TIMEOUT_MS=30000
SIGNATURE_VERIFIER_TIMEOUT=5
SIGNATURE_VERIFIER_URL=http://gateway-signature-verifier:5005
SMTP_HOST
SMTP_PORT=465
SMTP_SECURE=true
SMTP_USER
STRIPE_API_BASE_URL=https://api.stripe.com
STRIPE_API_VERSION=2024-06-20
STRIPE_AUTOMATIC_TAX=true
STRIPE_DEFAULT_CURRENCY=usd
STRIPE_ENABLEDPayments / Stripe Stripe keys come from GCP Secrets: - <prefix>-stripe-secret-key - <prefix>-stripe-webhook-secret
Payments / Stripe Stripe keys come from GCP Secrets: - <prefix>-stripe-secret-key - <prefix>-stripe-webhook-secret
STRIPE_PUBLISHABLE_KEY
STRUCTURED_EXTRAS_CODE_FILE_ENABLEDProactive structured extras (non-streaming responses only): when a finished text response already contains a large, well-formed, language-tagged fenced code block, also materialize it as a downloadable file (via FileGenerationService) and attach it via ailin_metadata.tool_artifacts. See proactive-code-file-extra.ts. Kill switch — set to false to disable without a code change.
Proactive structured extras (non-streaming responses only): when a finished text response already contains a large, well-formed, language-tagged fenced code block, also materialize it as a downloadable file (via FileGenerationService) and attach it via ailin_metadata.tool_artifacts. See proactive-code-file-extra.ts. Kill switch — set to false to disable without a code change.
STRUCTURED_EXTRAS_DOCUMENT_ENABLED=trueProactive structured extras (non-streaming responses only): when a finished text response is either a long multi-section report or a flat list of structurally-uniform "label: value" records, also materialize it as a downloadable markdown document or CSV (via FileGenerationService) and attach it via ailin_metadata.tool_artifacts. See proactive-document-extra.ts. Kill switch — set to false to disabl
Proactive structured extras (non-streaming responses only): when a finished text response is either a long multi-section report or a flat list of structurally-uniform "label: value" records, also materialize it as a downloadable markdown document or CSV (via FileGenerationService) and attach it via ailin_metadata.tool_artifacts. See proactive-document-extra.ts. Kill switch — set to false to disabl
STRUCTURED_EXTRAS_TABLE_CHART_ENABLEDProactive structured extras (non-streaming responses only): when a finished text response already contains a genuine multi-row/multi-column markdown comparison table, also render it as a chart image and attach it via ailin_metadata.tool_artifacts. See proactive-structured-extras.ts. Kill switch — set to false to disable without a code change.
Proactive structured extras (non-streaming responses only): when a finished text response already contains a genuine multi-row/multi-column markdown comparison table, also render it as a chart image and attach it via ailin_metadata.tool_artifacts. See proactive-structured-extras.ts. Kill switch — set to false to disable without a code change.
VERTEX_AI_BASE_URL
VERTEX_AI_LOCATION=us-central1
VERTEX_AI_PROJECT_IDProvider: Vertex AI (Google Cloud)
Provider: Vertex AI (Google Cloud)
VERTEX_AI_USE_EXPRESS_MODE=false
XAI_BASE_URL=https://api.x.aiProvider: xAI (Grok)
0 comments