Skip to main content

Configuration

AI Labs reads all of its tunables from environment variables. Server basics (host, port, auth mode, JWT secret) also live in ~/.cptr/config.toml; everything an admin can change is in the Admin settings and stored in the database.

Data directory​

VariableDefaultPurpose
CPTR_DATA_DIR~/.cptrWhere the database (app.db), config.toml, logs/, memory/, and uploads live. Set to /data in Docker.

Logging​

VariableDefaultPurpose
CPTR_LOG_LEVELINFOApplication log level.
CPTR_LOG_FORMATtexttext or json.
CPTR_LOG_UPSTREAM_REQUESTSfalseCapture full upstream model requests.
CPTR_UPSTREAM_REQUEST_LOG_PATH<data>/logs/upstream-requests.jsonlWhere they go.
CPTR_UPSTREAM_REQUEST_LOG_ROTATION50 MBRotation size.

Audit log​

VariableDefaultPurpose
CPTR_AUDIT_LOG_LEVELNONESet to a level to enable the audit trail.
CPTR_AUDIT_LOG_PATH<data>/logs/audit.jsonlOutput file.
CPTR_AUDIT_LOG_ROTATION10 MBRotation size.
CPTR_AUDIT_MAX_BODY_SIZE2048Max request-body bytes recorded.
CPTR_AUDIT_EXCLUDED_PATHS/api/chats,/v1/chatComma-separated path prefixes to skip.

Chat & agent​

VariableDefaultPurpose
CHAT_MAX_ITERATIONS2048Max tool-loop iterations per turn.
CHAT_TOOL_MAX_CHARS50000Truncation cap for tool output.
CHAT_TOOL_COMMAND_MAX_CHARS8000Truncation cap for command output.
CHAT_COMPACT_TOKEN_THRESHOLD80000Default context-compaction threshold (overridable per model).
CHAT_AGENT_SEED_TRANSCRIPT_MAX_CHARS12000How much recent context seeds a coding-agent session.
CPTR_CLAUDE_CODE_MAX_BUFFER_SIZE128 MiBstdout JSON buffer for the Claude Code backend.
ENABLE_CHAT_RECONCILE_ON_STARTUPtrueReconcile interrupted chats on boot.
CPTR_EXECUTE_TIMEOUTunset (return immediately)Default wait (seconds) for run_command / check_task when no explicit wait is given.

Streaming timeouts​

VariableDefault
CPTR_STREAM_CONNECT_TIMEOUT30
CPTR_STREAM_READ_TIMEOUT300
CPTR_STREAM_WRITE_TIMEOUT600

Workspace​

VariableDefaultPurpose
CPTR_AUTO_GITIGNORE_DOT_CPTRtrueAuto-add .cptr/ to a workspace's .gitignore.

Schedulers​

VariableDefaultPurpose
AUTOMATION_POLL_INTERVAL10Seconds between automation scheduler checks.
TIMER_POLL_INTERVAL1Seconds between timer-worker checks.

Networking​

VariableDefaultPurpose
CPTR_CORS_ALLOWED_ORIGINS*Socket.IO CORS origins. Comma-separated list to restrict.
CPTR_PORTset by CLIPort advertised to the frontend.

Backups​

VariableDefaultPurpose
CPTR_BACKUP0Set to 1 to stream the database to a replica via Litestream (litestream.yml), with automatic restore on a fresh volume.

Startup token​

VariablePurpose
CPTR_STARTUP_TOKENOne-time first-run setup token. Set by cptr run, consumed by the app — you normally don't set this yourself.
Hrida.ai is proprietary software of Zlabs Innovation. See the license for terms. © 2026 Zlabs Innovation.