Skip to content

Params and config

How lAIfe loads settings and switches behavior between environments. The modules are documented in the params library page and the config library page.

Environment type

Behavior is keyed on two axes defined in params/env_type.py:

  • stage, dev or prod;
  • location, where the code runs.

Both default from environment variables, ENV_STAGE_TYPE and ENV_LOCATION_TYPE, so the same code path adapts by reading the environment rather than branching on hardcoded flags.

The params singleton

LaifeParams is the single entry point for project settings. It is a singleton, built on the Singleton metaclass, so the whole process shares one instance. It aggregates the paths and the LLM service params, and is constructed from an EnvType.

Access it where you need settings rather than threading values through call signatures.

Paths

LaifePaths resolves filesystem locations and dispatches on the environment location. Fixed, project-level locations that do not depend on the environment, such as the static and cache folders, live as constants in config/constants.py.

LLM services

LLMServicesParams holds the settings for the three LLM-facing services:

  • chat, the models behind the brain, planner, replier, generator, and judge;
  • embeddings, used to vectorize world entities;
  • vector search, which uses the embeddings to retrieve relevant entities.

Each is loaded per environment, so swapping a model or provider is a params change, not a code change in the chains.

Secrets

Secret values come only from the environment, loaded from ~/cred/laife/.env by load_env. Non-secret values are written as plain literals and selected by environment. Keep secrets out of the config models and out of version control.