Skip to content

Configuration

warpra-server reads an optional JSON config file and environment variables. Environment variables use the WARPRA_ prefix. The pre-rename NEXURA_LGS_* names are still read when the WARPRA_* name is not set.

WARPRA_CONFIG names the file. Without it, the server loads ./warpra.json when that file exists. The file is optional when all graphs are registered in code. In code, Server::builder().config_file(path)? or .config_json(value) set it directly.

Rules:

  • String values may contain ${{ env.VAR }}. Startup fails when the variable is not set.
  • Unknown top-level keys are a startup error, so typos are not silently ignored.
  • These keys are not supported and are refused with a message naming them: dependencies, python_version, pip_*, dockerfile_lines, node_version, base_image, image_distro, ui, ui_config, keep_pkg_tools, source, encryption, priority.
  • A graph given as a Python import path ("agent": "./agent.py:graph") is refused: use {"code": true} or a declarative agent.

This is deploy/warpra/warpra.json:

warpra.json
{
"graphs": {
"agent": {
"type": "react_agent",
"description": "General-purpose assistant (declarative ReAct agent)",
"model": "${{ env.AGENT_MODEL }}",
"model_settings": {"temperature": 0.2},
"prompt": "You are a helpful assistant. Answer concisely."
}
},
"checkpointer": {
"ttl": {"strategy": "delete", "default_ttl": 43200, "sweep_interval_minutes": 10, "sweep_limit": 1000}
},
"store": {
"ttl": {"refresh_on_read": true, "sweep_interval_minutes": 60}
},
"http": {
"cors": {"allow_origins": ["http://localhost:3000"]}
}
}
Key Meaning
$schema, description Ignored
graphs Graph entries by graph id
env Variables ({KEY: value}) or a path to a KEY=VALUE file. Loaded first. Does not override variables already set.
checkpointer Backend and thread TTL
store Store index and TTL
http CORS, route groups, mount prefix
auth Auth mode and deny-list exemptions
webhooks URL policy, headers, signing secret
models Provider settings for declarative agents
mcp_servers MCP servers for agent tools
openapi_tools OpenAPI specs for agent tools
limits Numeric overrides of the environment defaults below, in lower case (for example n_jobs_per_worker, bg_job_timeout_secs)

Each entry is one of:

  • {"code": true, "description": "..."}: a graph registered in code with Server::builder().graph(..).
  • A declarative ReAct agent ("type": "react_agent"), built with warpra_prebuilt::create_react_agent:
Field Default Meaning
type required "react_agent"
model required provider:model, for example openai:gpt-4o-mini. fake:echo runs offline.
description none Description of the default assistant
model_settings {} temperature, max_tokens, top_p, stop, …
allowed_models [] Models a client may pick per run via configurable.model. Anything else returns 422.
prompt none System prompt: a string, or {"file": path} relative to the config file
allow_prompt_override false Let configurable.system_prompt replace the prompt for a run
tools.mcp [] [{server, include?, exclude?, prefix?, max_result_chars?}] from mcp_servers
tools.openapi [] [{source, operations?}] from openapi_tools
wire_messages conversion on By default, messages are converted to client message dicts on the wire. "native" turns conversion off
interrupt_before / interrupt_after [] For example ["tools"] for human approval of tool calls
response_format none {name, schema, system_prompt?} for structured output
handle_tool_errors "default" "default", "all" or {"message": "..."}
recursion_limit 25 Default for runs
name graph id Agent name

Clients cannot add tools to a declarative agent.

checkpointer: {backend, uri, path, ttl}. backend is postgres, sqlite or memory. ttl is {strategy: "delete" | "keep_latest", default_ttl (minutes), sweep_interval_minutes, sweep_limit}.

A database URL in the environment wins over backend: the first of DATABASE_URI, POSTGRES_URI or WARPRA_DATABASE_URL that is set. postgres:// or postgresql:// selects Postgres, sqlite: selects SQLite. With nothing set, the server uses memory and logs a warning. The same database holds checkpoints, the store and the server’s tables.

store: {index: {embed: "provider:model", dims, fields}, ttl: {refresh_on_read, default_ttl, sweep_interval_minutes}}. With Postgres and pgvector, the index uses pgvector.

cors (allow_origins, allow_origin_regex, allow_methods, allow_headers, expose_headers, allow_credentials, max_age). CORS is off unless allow_origins or allow_origin_regex is set.

disable_assistants, disable_threads, disable_runs, disable_store, disable_meta and disable_webhooks turn route groups off. mount_prefix (for example /api) moves every route, /ok included, under the prefix. disable_mcp, disable_a2a and disable_ui are accepted and do nothing. app, middleware_order, enable_custom_route_auth, configurable_headers and logging_headers are refused.

{mode: "api_key" | "none", configurable_allow: [..]}. WARPRA_AUTH overrides mode. Keys are never read from the config file. configurable_allow exempts specific keys from the credential deny-list, for code graphs that need them.

{env_prefix, url: {require_https, allowed_domains, allowed_ports, max_url_length, allowed_private_hosts}, headers, signing_secret}. require_https defaults to true and max_url_length to 2048. Header values may use ${{ env.VAR }} only for variables that start with env_prefix (default LG_WEBHOOK_).

{providers: {<provider>: {api_key_env, base_url, timeout_secs, headers, extra}}}. Without api_key_env, a provider reads its usual variable, for example OPENAI_API_KEY. These are the only sources of model credentials and endpoints. Clients can never set them.

mcp_servers.<name>: {transport: "stdio", command, args, env, cwd} or {transport: "http", url, headers}, plus optional, timeout_secs and allowed_private_hosts.

openapi_tools.<name>: {spec, base_url, auth: {type: "bearer" | "api_key" | "basic", token_env, header, query}, operations, allowed_private_hosts}.

Variable Default Meaning
WARPRA_CONFIG ./warpra.json Config file path
WARPRA_HOST 127.0.0.1 Bind address
WARPRA_PORT (alias PORT) 8000 Listen port
DATABASE_URI, POSTGRES_URI, WARPRA_DATABASE_URL unset Backend URL, first set wins
WARPRA_AUTH api_key api_key or none
WARPRA_API_KEYS unset Comma-separated keys, each key or principal=key, at least 24 characters
WARPRA_API_KEYS_FILE unset One key per line, # comments
WARPRA_ALLOW_UNAUTHENTICATED_NETWORK false Required with AUTH=none on a non-loopback bind
WARPRA_N_JOBS_PER_WORKER (alias N_JOBS_PER_WORKER) 10 Concurrent runs per process. 0 = API-only replica.
WARPRA_BG_JOB_TIMEOUT_SECS 3600 Run timeout
WARPRA_LEASE_SECONDS 30 Run lease
WARPRA_HEARTBEAT_SECONDS 10 Lease renewal interval
WARPRA_MAX_ATTEMPTS 3 Recovery attempts for a run
WARPRA_SHUTDOWN_GRACE_SECONDS 30 Drain time on SIGTERM
WARPRA_SSE_HEARTBEAT_SECONDS 15 SSE heartbeat
WARPRA_EVENT_RETENTION_SECONDS 3600 Run event log retention
WARPRA_MAX_EVENTS_PER_RUN 100000 Event log cap per run
WARPRA_MAX_PENDING_RUNS 10000 New runs get 429 above this
WARPRA_STATELESS_GRACE_SECONDS 60 Grace before a stateless run’s thread is deleted
WARPRA_CRON_INTERVAL_SECONDS 10 Cron tick
WARPRA_POLL_INTERVAL_MS 1000 Claim poll fallback
WARPRA_REPLICA_ID {hostname}-{pid}-{random} Worker identity in leases
WARPRA_MIGRATE auto auto, or skip (startup fails when migrations are pending)
WARPRA_LOG_FORMAT text text or json
RUST_LOG info Log filter

API keys: clients send them as x-api-key or Authorization: Bearer. Only GET /ok (and CORS preflight) is public. With WARPRA_AUTH=api_key and no key configured, startup fails.

Warpra is open source under Apache-2.0. Made by Liceron.