03 · REFERENCE

Environment variables

XERJ deliberately does not expose feature flags via environment variables. Behaviour lives in the TOML. The variables below find the config file and filter logs; the rerank provider pair further down carries a credential, not behaviour; and a few config keys name their own environment override on the Config TOML page.

NAME
DEFAULT
DESCRIPTION
XERJ_CONFIG
./xerj.toml
Config file path override. The --config CLI flag wins if both are set.
XERJ_LOG
info
Tracing filter. Accepts tracing_subscriber syntax, e.g. xerj_api=debug,info.
RUST_LOG
—
Fallback tracing filter. Checked only if XERJ_LOG is unset.

There are no feature gates via env. If you want to change XERJ's behaviour, change the config.

Rerank provider

The rerank search stage sends document text to a third-party judge, so it needs a provider key. The key and endpoint may come from the environment as a fallback: a non-empty value under [rerank] in the config file wins, so a stray variable in a service's environment cannot silently re-point where document text is sent. Both are read once, at startup — changing them on a running node does nothing. Setting the key does not switch reranking on for any search; a request still has to carry a rerank block, and [rerank] enabled = false overrides both variables.

NAME
DEFAULT
DESCRIPTION
TYPESAFE_API_KEY
—
Rerank provider key, used when rerank.api_key is empty. Unset in both places means a rerank request gets HTTP 503. Never echoed: GET /_xerj/rerank reports only that a key is set and that it came from env.
TYPESAFE_ENDPOINT
https://api.typesafe.ai/v1/systemone
Rerank provider endpoint, used when rerank.endpoint is empty. Point it at a proxy or a test double; it is where judged document text is POSTed. Validated at boot like the config value: it must be an absolute http:// or https:// URL with no user:password@ in it, or the node refuses to start.

Source · engine/crates/xerj-server/src/main.rs · engine/crates/xerj-rerank/src/lib.rs