Documentation menu

Reference

Environment variables

Every environment variable read by elelem core and its plugins, with defaults.

elelem has no config file. Settings that are not command-line options are environment variables, and most belong to a plugin. This is every variable read by core and the plugin gems, found by searching each repository for ENV and getenv.

“Required” means the provider stops with an error when the variable is missing. “Build” means the variable is read when the gem’s native extension compiles, during gem install, not at run time.

VariableRead byDefaultWhat it does
ELELEM_LOG_LEVELelelem, elelem-llamawarnLog level for messages on stderr: debug, info, warn, error, or fatal. elelem-llama applies it to llama.cpp’s own log too.
ELELEM_CMD_TIMEOUTelelem-builtinsnoneSeconds before an execute command is stopped with TERM, then KILL half a second later. The result notes the timeout and reports exit status 124. Unset means no limit.
XDG_STATE_HOMEelelem-builtins~/.local/stateSession transcripts are written to elelem/sessions/ under this directory.
ANTHROPIC_API_KEYelelem-anthropicrequired for -p anthropicAPI key, sent as x-api-key.
ANTHROPIC_MODELelelem-anthropicclaude-opus-4-5-20250514Model for -p anthropic when --model is not given.
VERTEX_MODELelelem-anthropicclaude-opus-4-5@20251101Model for -p vertex when --model is not given.
GOOGLE_CLOUD_PROJECTelelem-anthropicrequired for -p vertexGoogle Cloud project for Vertex AI. The access token comes from gcloud auth application-default print-access-token.
GOOGLE_CLOUD_REGIONelelem-anthropicus-east5Vertex AI region.
OPENAI_API_KEYelelem-openairequiredAPI key, sent as a bearer token.
OPENAI_MODELelelem-openaigpt-4oModel when --model is not given.
OLLAMA_HOSTelelem-ollamalocalhost:11434Host and port of the Ollama server.
OLLAMA_MODELelelem-ollamagpt-oss:latestModel when --model is not given.
OLLAMA_THINKelelem-ollamanoneSent as the think field of each request.
OLLAMA_KEEP_ALIVEelelem-ollamanoneSent as the keep_alive field of each request.
ELELEM_GGUF_MODELelelem-llama, elelem-ggml~/.agents/models/default.gguf, or the only .gguf file therePath to the GGUF model. For elelem-llama, --model takes precedence.
ELELEM_GGUF_N_CTXelelem-llama0Context size in tokens. 0 uses the model’s training context, capped at 65,536. If that does not fit in memory, it halves the size down to 4,096.
ELELEM_GGUF_N_GPU_LAYERSelelem-llama999 or 0Layers to put on the GPU. Default is 999 (all) on a Vulkan, CUDA, or Apple Silicon Metal build when the model file is under 80% of free GPU memory, otherwise 0.
ELELEM_GGUF_MAX_TOKENSelelem-llama, elelem-ggml0 (llama), 256 (ggml)Most tokens to generate per reply. For elelem-llama, 0 means the rest of the context.
ELELEM_GGUF_TEMPelelem-llama0.7Sampling temperature. 0 or below means greedy decoding.
ELELEM_GGUF_SEEDelelem-llama-1Sampling seed.
ELELEM_TOP_Kelelem-llama40Top-k sampling. Ignored when decoding is greedy.
ELELEM_TOP_Pelelem-llama0.95Top-p sampling. Ignored when decoding is greedy.
ELELEM_REPEAT_LAST_Nelelem-llama0Tokens to look back for the repeat penalty. 0 turns the penalty off.
ELELEM_REPEAT_PENALTYelelem-llama1.0Repeat penalty. 1.0 is no penalty.
ELELEM_KV_CACHE_TYPEelelem-llamaq8_0KV cache type: f16, f32, q4_0, or q8_0. Anything else means q8_0.
ELELEM_LLAMA_BACKENDelelem-llama (build)autoGPU backend to compile: cpu, vulkan, cuda, hip, or metal. auto picks Metal on macOS, then CUDA if nvcc is found, Vulkan if glslc and the Vulkan loader are found, HIP if hipcc and a GPU target are found, else CPU.
ELELEM_HIP_ARCHelelem-llama (build)detected, else gfx1100AMD GPU target for a HIP build.
ELELEM_CANDLE_MODELelelem-candlerequiredA safetensors directory or a Hugging Face repo id.
ELELEM_CANDLE_DEVICEelelem-candlecpuDevice name passed to Candle.
ELELEM_LLAMA2_CHECKPOINTelelem-llama2requiredPath to a llama2.c .bin checkpoint.
ELELEM_LLAMA2_TOKENIZERelelem-llama2the gem’s bundled tokenizer.binPath to the tokenizer.
ELELEM_LLAMA2_STEPSelelem-llama20Most tokens to generate. 0 means the model’s full sequence length.
ELELEM_LLAMA2_TEMPelelem-llama21.0Sampling temperature.
ELELEM_LLAMA2_TOPPelelem-llama20.9Top-p sampling.
ELELEM_LLAMA2_SEEDelelem-llama2-1Sampling seed.
ELELEM_SD_IMAGE_MODELelelem-diffusionnoneStable Diffusion model for the image tool. The tool returns an error while it is unset.
ELELEM_SD_VIDEO_MODELelelem-diffusionnoneDiffusion model for the video tool. Required by that tool.
ELELEM_SD_VIDEO_VAEelelem-diffusionnoneVAE for the video tool. Required by that tool.
ELELEM_SD_VIDEO_T5XXLelelem-diffusionnoneT5-XXL text encoder for the video tool. Required by that tool.
ELELEM_SD_ESRGAN_MODELelelem-diffusionnoneESRGAN model for the upscale tool. Required by that tool.
ELELEM_PROVIDERelelem-server, elelem-evalsstub (server), llama (evals)Provider when -p is not given. The elelem command does not read it.
Any ${NAME} in mcp.jsonelelem-mcprequired when referencedSubstituted into a server’s env and headers. A missing variable is an error for that server.
CCelelem-ggml, elelem-llama2 (build)ccC compiler.
CXXelelem-llama, elelem-llama2, elelem-diffusion (build)c++C++ compiler.

The build scripts of elelem-llama and elelem-ratatui also search PATH for build tools: nvcc, glslc, hipcc, and vulkaninfo for llama, cargo for ratatui. Paths under ~ are resolved through HOME.

Setting them #

For one command:

ELELEM_LOG_LEVEL=debug elelem ask -p ollama "hello"

For every session, export them from your shell profile:

export ANTHROPIC_API_KEY=your-key
export ELELEM_CMD_TIMEOUT=120

--model on the command line wins over the provider’s model variable for anthropic, vertex, openai, ollama, and llama.