Environment variable reference for AFK defaults and backend configuration.
AFK is configured primarily through code. Environment variables provide fallback defaults for LLM settings, memory backends, queues, and prompt directories. Runtime configuration APIs always take precedence.
All variables are optional. If unset, AFK uses the defaults listed below.
These variables configure the default LLM provider and behavior. They are read by LLMSettings.from_env() at startup.
Variable
Default
Description
AFK_LLM_PROVIDER
litellm
Default provider id (openai, litellm, anthropic_agent)
AFK_LLM_MODEL
gpt-5.2-mini
Default model name
AFK_EMBED_MODEL
(none)
Embedding model for vector operations
AFK_LLM_API_BASE_URL
(none)
Provider API base URL
AFK_LLM_API_KEY
(none)
Provider API key
AFK_LLM_TIMEOUT_S
30
Request timeout in seconds
AFK_LLM_STREAM_IDLE_TIMEOUT_S
45
Stream idle timeout in seconds
AFK_LLM_MAX_RETRIES
3
Retry attempts on transient failures
AFK_LLM_BACKOFF_BASE_S
0.5
Exponential backoff base in seconds
AFK_LLM_BACKOFF_JITTER_S
0.15
Random jitter added to backoff
AFK_LLM_JSON_MAX_RETRIES
2
Structured output repair attempts
AFK_LLM_MAX_INPUT_CHARS
200000
Input truncation ceiling in characters
API keys for specific providers (e.g. OPENAI_API_KEY,
ANTHROPIC_API_KEY) are read by the underlying provider libraries, not by AFK
directly. Set AFK_LLM_API_KEY only if you want a single key shared across
providers.